Bird
0
0

You want to implement contract testing with Pact in a microservices system where multiple teams develop services independently. Which approach best ensures smooth integration?

hard📝 Trade-off Q15 of 15
Microservices - Testing Microservices
You want to implement contract testing with Pact in a microservices system where multiple teams develop services independently. Which approach best ensures smooth integration?
AEach team publishes their Pact contracts to a shared broker for others to verify
BTeams test contracts only locally without sharing
CUse end-to-end tests only, skipping contract tests
DManually review API changes without automated tests
Step-by-Step Solution
Solution:
  1. Step 1: Identify best practice for contract sharing

    Using a shared Pact broker allows teams to publish and verify contracts centrally, enabling independent development with integration confidence.
  2. Step 2: Compare alternatives

    Local-only tests lack visibility; end-to-end tests are slower and less focused; manual reviews are error-prone.
  3. Final Answer:

    Each team publishes their Pact contracts to a shared broker for others to verify -> Option A
  4. Quick Check:

    Shared Pact broker = smooth integration [OK]
Quick Trick: Use shared Pact broker for contract visibility and verification [OK]
Common Mistakes:
  • Skipping contract tests for only end-to-end tests
  • Not sharing contracts causing integration surprises
  • Relying on manual API reviews

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes