Pact
What is Pact?
The Pact family of frameworks provide support for Consumer Driven Contracts testing.
Consumer Driven Contracts
A Contract is a collection of agreements between a client (Consumer) and an API (Provider) that describes the interactions that can take place between them.
Consumer Driven Contracts is a pattern that drives the development of the Provider from its Consumers point of view.
Pact is a testing tool that guarantees those Contracts are satisfied.
Why do you want to use Pact
| Confidence | Faster | Less Error Prone |
|---|---|---|
| Continuously evolve your codebase knowing that Pact will guarantee Contracts are met. | No need to setup end-to-end environments. No need for manual testing. | Generation and verification of Contracts are automatically managed by Pact. |
I still need convincing.
Talks and Presentations
Check out this talk about Pact and the slides below from one of the Pact authors for an introduction.
For a JVM specific talk, Deploy with Confidence! was presented at the April meet-up of MelbJVM and at the June meet-up of Melbourne Microservices. Slides for the talk can be found here.
For a great explanation of consumer-driven contracts (and Pact!), check out this talk from Atlassian at their 2016 summit: Verifying Microservice Integrations with Contract Testing.
Hear how Soundcloud "Move Fast and Consumer-Driven-Contract-Testing Things" in their talk from MicroXchg 2017.
Implementations
- Ruby Pact
- JVM Pact and Scala-Pact
- .NET Pact
- JS Pact
- Go Pact (there is also a v1.1 native Pact Go)
- Swift / Objective-C Pact
- Python
Introductory articles
Getting Help
You can get help on Pact from the following channels:
- Stack Overflow: https://stackoverflow.com/questions/tagged/pact
- Gitter: Join the chat at https://gitter.im/realestate-com-au/pact and https://gitter.im/DiUS/pact-jvm
- Twitter: @pact_up