Interview Prep/CI/CD/Testing and Quality Gates

What is contract testing and when does it beat integration tests?

AdvancedConceptTesting and Quality Gates
Answer

Contract testing (Pact, Spring Cloud Contract) verifies that a service consumer and provider agree on the API shape without deploying both. The consumer test generates a contract; the provider pipeline verifies it can satisfy all consumer contracts, and a broker tracks compatibility (can-i-deploy). It beats full integration environments in microservice estates because tests are fast, deterministic and run in each service's own pipeline.

pact-broker can-i-deploy --pacticipant orders --version $GIT_SHA --to-environment production
All CI/CD questions Roadmap: CI/CD fundamentals

More on Testing and Quality Gates