Creating A Simple Java Test Framework

Using Reactive pipelines to implement Gherkin based integrated tests

Randal Kamradt Sr
Javarevisited

--

Cucumbers
Image by Krzysztof Jaracz from Pixabay

One thing about integration tests is that you need to have state carried along from step to step. Let’s say you’re testing an application that implements a RESTful API. First, you want to create some test data and pass it along to the create endpoint.

Then you want to call another endpoint to see if you can retrieve it. You need the test data from the first step to be able to make assertions that the data retrieved in the second step is correct. It gets even worse when you have reusable steps that can be called in different orders. Each step may need to have information from previous steps and needs to know what subsequent steps can expect from it.

So I thought I would put together a proof-of-concept testing framework that uses a Gherkin syntax and tests out a side-project that I’ve been working on for a while. The test subject is a set of microservices that intake used vehicles and process them in a simple microservice system. You can find the details about that system and how to deploy it in my article How To Create Java Services Without Spring Bloat. Just to note, I’m doing this entirely for fun and have no intention of actually using this on other projects or making it a full-featured framework.

--

--