This project contains the code from my article "Behaviour-Driven Development in practice"
The catalog-spec folder contains the specification project for the Catalog Service.
The project is cloned from the cucumber-java-skeleton and uses Maven for automation. The command
mvn test
will run the Behavior Tests against a service deployed on http://localhost:8080
. You can change the endpoint by editing the OpenAPI file.
In catalog-service you will find the service implementation. It is a Micronaut application that implements the interface defined in OpenAPI.
Thanks to the embedded OpenAPI code generator included with the Micronaut Maven plugin, the command:
mvn compile
Will generate the model classes, as well as the interface definition, for the REST layer.
The command:
mvn test
Will execute both Unit and Integration tests.
In order to run the Behavior Tests defined in the specification project, you need to run first this service with the command:
mvn mn:run