Test API compatibility with consumer contracts
8 steps · about 3 h 21 min · Intermediate
- Understand consumer-driven contracts (guide, Pact documentation, 25 min)
See how consumer expectations become independently verifiable provider examples.
- Use contract terms precisely (guide, Pact documentation, 18 min)
Distinguish consumers, providers, interactions, pacts and verification before wiring a workflow.
- Write the consumer interaction (guide, Pact documentation, 30 min)
Generate a contract from the behavior the consuming code actually exercises.
- Verify the provider independently (guide, Pact documentation, 30 min)
Replay the contract against the real provider boundary and report mismatches before release.
- Arrange deterministic provider states (guide, Pact documentation, 22 min)
Set up only the data condition an interaction needs without sharing a mutable test database snapshot.
- Match meaning instead of fixed samples (guide, Pact documentation, 24 min)
Use types and constrained patterns where exact example values are not part of the agreement.
- Gate deployment on compatible versions (guide, Pact documentation, 22 min)
Ask whether the exact consumer and provider versions have a verified relationship.
- Run one complete contract loop (guide, Pact documentation, 30 min)
Finish with a bounded example from consumer test through provider verification.