Skip to main content

Contract Testing, Spring Cloud Contract, End-to-End, Performance and Fault-Injection Testing

Learn Contract Testing, Spring Cloud Contract, End-to-End, Performance and Fault-Injection Testing (Phase 13 · Microservices Testing (Core), Microservices) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Contract testing • Problem: service A calls service B; each team tests with mocks, but the mocks drift from reality, so integration breaks in staging. Consumer-driven contract testing : the consumer states what it needs (request → response); the provider verifies it still satisfies every consumer's contract in its own build. Breaking changes fail the provider's CI before deployment, without running both services together. • Tools: Spring Cloud Contract (contracts in Groovy/YAML/Kotlin on the provider side; generates provider tests and WireMock stubs published as a jar for consumers), Pact...

More lessons in Phase 13 · Microservices Testing (Core)