Skip to content

What & Why

Why Use Contract Testing

While functional testing is something that happens post deployment and is heavier by nature due to the tests checking for side effects, contract testing is something that can happen earlier in the SDLC and provider faster feedback. Because contract testing allows us to check some integrations prior to deployment, we are able to prevent any breaking changes from being deployed.

Contract testing also allows for consumers to define their requirements and make them visible to providers.

Why Use Pact Broker

Pact Broker allows us to share contracts between consumers and providers. To properly have contract testing setup within a CI/CD system, there needs to be automation setup for the sharing of contracts and automating the verification of contracts. Without Pact Broker, consumers and providers would need some other way to share the pact between each other, either by pushing the contract up to an artifact repository or a Git repository.

Besides being a central store for pacts, Pact Broker has several other features that are essential for contract testing.

Some features of Pact Broker

  • Autogenerated documentation for each Pact
  • An API for publishing, retrieving, and checking verification of contracts
  • Ability to create webhooks for triggering CI pipelines based on events in Pact Broker
  • Versioning and tagging of pacticipants
  • Contract Matrix view to see which consumer and provider versions are compatible with each other based on verification
  • Network diagrams for visualizing the interactions between applications
  • CLI tool for interacting with Pact Broker