Fitnesse in spring boot test

2k views Asked by At

I am relatively new to Fitnesse. What I am currently trying to do is look at Fitnesse for my new project and try to study if this is the right tool for my acceptance tests.

The project I'm working on is essentially a microservices project where I would have multiple spring boot microservices and ideally I would want to have my acceptance tests call the rest controllers directly (via rest) in some cases and in others call the spring services directly.

I did a lot of research on the internet, but I was not able to clearly identify how would I be able to achieve this using Fitnesse.

I'm using maven to build my projects and intend to use jenkins as the CI tool. Can I use it with springboottest like I can with cucumber for example?

Any suggestions?

1

There are 1 answers

0
Fried Hoeben On

FitNesse itself is a testing environment, with its own strength and weaknesses like mentioned in some of the comments. Out of the box it does not have any capabilities to test an application. It allows you to write test definitions and execute these. To connect the test definitions to the actual system to be tested (the SUT, system under test) you need some code (called fixtures). These may be written in Java (or some other language supported by FitNesse). These fixtures will interact with the system to be tested, and define the elements your test definitions will be composed of. (This is all similar, from my perspective, as Cucumber and its step definitions)

You can either write your own (custom) fixtures, or use some existing 'plugins' or use fixture libraries that already exist. If you use an existing library you may want/need to use some custom fixtures building upon the features provided by them.

Running the tests can be done from a Jenkins environments, either using the jUnit test runner included in FitNesse, or via a specialised Jenkins plugin. So that matches your requirements, no problem.

I don't know springboottest, or of any specialised fixtures to work with Spring Boot application. But multiple fixture libraries support testing of REST services (e.g. RestFixture or HSAC's FitNesse fixtures (disclosure: I've written a lot the code in that library)) or web applications built on top of them.

I use the HSAC's FitNesse fixtures extensively to test web applications and REST (and SOAP) services, using Maven in Jenkins jobs. To me it offers a good baseline of a FitNesse setup that allows me to focus on writing tests, not test plumbing. Maybe you can take a look at the documentation of its REST fixture (http test and json http test), or download and try the examples its 'standalone zip' package to see whether it allows you to express your tests in a way that suits you (and your project). Running tests via Jenkins is pre-configured in the projects pom.xml and documented in its README.