This is an example of a Java consumer that uses Wiremock (with Junit5), Pactflow and Travis CI 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
This project is currently compatible with the following providers:
- Java Springboot tested via RestAssured: https://github.com/pactflow/example-provider-restassured
- JS express tested via Dredd: https://github.com/pactflow/example-bi-directional-contracts-provider
- Tools listed at: https://docs.pactflow.io/docs/workshops/ci-cd/set-up-ci/prerequisites/
- A pactflow.io account with an valid API token
To be able to run some of the commands locally, you will need to export the following environment variables into your shell:
PACT_BROKER_TOKEN: a valid API token for Pactflow
PACT_BROKER_BASE_URL: a fully qualified domain name with protocol to your pact broker e.g. https://testdemo.pactflow.io
PACT_PROVIDER: You can use this to override the name of the provider you want to test for this. It defaults to
pactflow-example-provider-restassuredfor compatibility with the Java RestAssured provider
make test- run the tests locally
make fake_ci- run the CI process locally