Lesson 1 of 88 min read
Choose a consumer-driven contract boundary
Foundation 1: Our synthetic CatalogueWidget consumes ProductService. Its readProduct function depends on status, JSON id, name and available; it does not depend on a database implementation. Write consumer expectations at the HTTP boundary. A schema can describe allowed payloads without proving a particular consumer actually uses them; a contract exercised through that consumer ties expectations to behaviour. Keep permission, price calculation, load and browser journeys in separate tests. A passing pact is evidence for recorded interactions, not a guarantee that every integration works. The local provider is deliberately only a GET exercise, not production software. Start with a short boundary note before adding tooling. This free orientation uses a synthetic product lookup; it does not run a provider or connect to a Broker inside the website.
Key takeaways
- 1Identify the consumer dependency.
- 2Write an observable expectation and an excluded claim.
- 3Keep proposed deployment work distinct from performed checks.
Synthetic boundary note
Consumer: CatalogueWidget Provider: ProductService Used fields: id, name, available Out of scope: authentication, performance, full UI
Go deeper
Expert notes beyond the basics
- 01
Reason through the boundary
Our synthetic CatalogueWidget consumes ProductService. Its readProduct function depends on status, JSON id, name and available; it does not depend on a database implementation. Write consumer expectations at the HTTP boundary. A schema can describe allowed payloads without proving a particular consumer actually uses them; a contract exercised through that consumer ties expectations to behaviour. Keep permission, price calculation, load and browser journeys in separate tests. A passing pact is evidence for recorded interactions, not a guarantee that every integration works. The local provider is deliberately only a GET exercise, not production software.
- 02
Official reference
Pact documentation: https://docs.pact.io/ . Use installed-version guidance and actual evidence, not assumed deployment results.
Common mistakes to avoid
- - Calling a mock-only check provider verification.
- - Publishing private contracts or tokens.
Try it yourself
Write a consumer/provider boundary, action, evidence and limitation for this topic.
Write your answer on paper or in a sheet first, then compare.
Interview questions
How to answer like a confident QA engineer
- Q1
What does a passing local pact demonstrate?
Model answer
Recorded consumer/provider interactions match
- Q2
What is outside this check?
Model answer
Functional correctness, real permission security, performance and deployed-version history need separate evidence.
Knowledge check
+5 points
What does a passing local pact demonstrate?
