Which of the following best describes the primary purpose of using Pact in microservices?
Think about what contract testing ensures between two services before they communicate.
Pact is used to verify that the consumer and provider agree on the API contract, ensuring compatibility without needing to deploy both services together.
Which component is responsible for generating the contract file in a Pact testing setup?
Consider which side defines the expected interactions first.
The consumer writes tests that define expected requests and responses, generating the Pact contract file used to verify the provider.
In a system with 50 microservices, each with multiple consumers and providers, what is the best approach to manage Pact contract testing efficiently?
Think about automation and centralization for large-scale coordination.
A Pact Broker centralizes contracts and automates verification, making it scalable and manageable for many services.
Which statement best describes a tradeoff when choosing Pact contract testing over full end-to-end testing?
Consider what contract testing focuses on versus what end-to-end testing covers.
Contract testing isolates API compatibility issues quickly but does not test full user flows or infrastructure, which end-to-end tests cover.
You have 20 microservices, each with 5 consumers. Each Pact verification test takes 10 seconds. Assuming all tests run sequentially, estimate the total Pact verification time in the CI pipeline.
Calculate total tests as number of microservices × consumers, then multiply by test time.
Total tests = 20 services × 5 consumers = 100 tests. Each test takes 10 seconds, so total time = 100 × 10 = 1000 seconds.