Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this tutorial i I will show you how to use Cucumber and CWB REST to test a Spring Boot microservice.  Starting from a Spring Boot application using an embedded Tomcat, we will first setup the CWB integration and write a simple feature.  The feature will connect to the actual running webserver and execute its scenario's. As a next step we will configure the embedded tomcat to use a dynamic server port and see a simple code based approach for starting the webserver en running the Cucumber features on any port.

This is really a step-by-step tutorial.  It helps if you already know some Spring Boot and Cucumber, but it is not strictly required.  In the first part of this tutorial we'll create the microservice using Spring Boot, in the second part we'll test it with CWB REST.

 You You will need Java 8, Maven and your favourite IDE... and 15 to 30 minutes of time.

...

This scenario show cases some other features of CWB REST: posting data using YAML and using a table syntax to find an item in an array.

 

As I hope to have illustrated, setting up CWB Rest to test Spring Boot microservices is fairly easy.  In this tutorial I showed the absolute basics, in a follow-up I'll extend this sample and show how you can test REST webservices secured with basic or OAuth2 authentication.