Skip to content
This workbench demonstrates how to do consumer driven contract development (CDC) by using the Spring Cloud Contract Verifier.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
contract-consumer
contract-producer
gradle/wrapper
.gitignore
LICENSE
README.md
build.gradle
gradlew
gradlew.bat
settings.gradle

README.md

Spring Consumer Driven Contract Development Workbench

This workbench demonstrates how to do consumer driven contract development (CDC) by using the Spring Cloud Contract Verifier.

It is inspired by a talk from Josh Long given on October, 3rd 2018 on YouTube for the v JUG.

You can find Joshs example using reactive paradigms at GitHub: bootiful-testing

The talk can be watched on YouTube: Bootiful Testing by Josh Long

This workbench contains an application offering a REST api (producer) and another application that implements a client to access this service (consumer).

Building and Testing the Producer and its Stubs

The contract stubs are build and tested by a regular gradle build.

If you want to perform the generation of contract tests as a separate task, you can use the following command:

$ ./gradlew :contract-producer:generateContractTests :contract-producer:test

The following command will then publish the generated (and tested) stubs to the local maven repository:

$ ./gradlew :contract-producer:publishToMavenLocal

Build and Test the Consumer

To build and test the consumer use ./gradlew :contract-consumer:check. This will pull the test stubs generated by the producer from the local maven repository and use them for running the tests.

You can’t perform that action at this time.