Contract Testing — testing microservice boundaries
In a monolith, integration testing is straightforward. In microservices, you have 12 services talking to each other — and a breaking API change in one can cascade silently until production. Contract testing with PACT solves this by verifying the agreements between services at build time, not at release time.
This track teaches consumer-driven contract testing using PACT. You’ll write consumer contracts in JavaScript/TypeScript, verify them against provider APIs, and integrate the PACT Broker into CI so breaking changes are caught before they merge.
From the contract to the CI gate
Contract Testing Fundamentals
What consumer-driven contract testing is, why it beats integration testing for microservices, and how PACT implements the pattern.
~30 min read · ~65 min with exercises · Contract Testing
Lesson 2Writing PACT Tests
Write consumer tests in JavaScript, verify them against a provider API in Node.js, and understand the PACT lifecycle end to end.
~30 min read · ~70 min with exercises · Contract Testing
Lesson 3PACT in CI
Set up a PACT Broker, integrate consumer and provider pipelines in GitHub Actions, and use can-i-deploy to gate releases.
~30 min read · ~75 min with exercises · Contract Testing
The problem contract testing solves
Integration tests for microservices have a fundamental problem: they require all the services to be running at the same time. That means a slow test environment, scheduling conflicts between teams, and test failures that are often environmental rather than functional. And they still only catch breaking changes when the system is assembled — which is usually too late to fix cheaply.
Contract testing decouples consumer and provider. The consumer defines what it needs from the provider. The provider verifies it can deliver that, in isolation, using a mock of the consumer. Both sides run in their own CI pipeline, and a central PACT Broker coordinates the verification. A breaking change on the provider side fails the provider’s own build — before anyone else is affected.
This track teaches the full pattern with PACT, the most widely used consumer-driven contract testing framework. Every example uses NZ fintech and banking service patterns.
Other specialised tracks
API Testing
Status codes, idempotency, and API test design — the foundation under contract testing.
SpecialisedDevOps QA
CI/CD pipelines, feature flags, and container testing — where contract tests run in practice.
SpecialisedPlaywright Deep-Dive
End-to-end automation for the layer above your contract-tested APIs.