BDD approach in restful services with spring boot

435 views Asked by At

I have been reading a lot to find a solution to my problem. In my current service I have some cucumber tests running under the src/test folder. But I am using the spring boot application context to run this tests (doing injections and things like that). So, from my point of view this is not a real end to end test. What I try to do is to have my cucumber tests (BDD) under a different folder to src/test and hit the service without using the app context. I am trying to distinguish between integration tests and end to end cucumber test. So, first I would need to run the service and then hit it to get the responses. Any idea?

Thank you very much.

1

There are 1 answers

0
Fany Castro Vizoso On

In the end I have a multi module maven project. The main module contains three submodules: service (with unit tests), integration tests and end to end test. I have used maven surefire and maven failsafe plugins. I have also used profiles (unit, integration and e2e) to run the tests. Now everything is working properly. In my opinion this is a good approach (the end to end tests hit the service from outside and the integration tests depend on the service even they are in a different module). What is your opinion guys? Let me know it please.

Thank you.