Skip to main content

Example Java Spring Boot + RestAssured Provider

Source Code​

https://github.com/pactflow/example-provider-restassured

Build Status

This is an example of a Spring boot API provider that uses RestAssured, PactFlow and its Bi-Directional Contract Testing feature to ensure that it is compatible with the expectations its consumers have of it.

The project uses a Makefile to simulate a very simple build pipeline with two stages - test and deploy.

It is using a public tenant on PactFlow, which you can access here using the credentials dXfltyFMgNOFZAxr8io9wJ37iUpY42M/O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1. The latest version of the Example Consumer/Example Provider pact is published here.

Pre-requisites​

Software:

Environment variables​

To be able to run some of the commands locally, you will need to export the following environment variables into your shell:

Usage​

  • make test - run the tests locally
  • make fake_ci - run the CI process locally

Other examples of how to do this form of testing​