Pact Broker

During your build process, you will need a mechanism for delivering the Pact files your consumer tests generate to your provider ready for verification. Or if you are the provider service, you will need somewhere you can collect the Pact contract files your consumers generate.

You can do this any way you like, they are just JSON files after all, but the tool of choice is pact-broker. Pact Broker is a Ruby service that allows you to upload, look up, and retrieve versioned Pact files.

An opinionated note on versioning:

Focus on versioning your API’s not your Pact files! It can be handy to have versions of Pact files around but you should avoid pushing breaking API changes and communicating them to your provider with versioned Pact files. A breaking API change is a new API version. Theoretically your provider should always be able to ask for the latest Pact files for each API version and have confidence that they are correct.

The source code for this page can be found here.