Consumer Driven Contracts and Your Microservice Architecture
summary
Claim: treat APIs as tests by writing consumer-driven contracts that generate executable checks and runnable stubs. Uses Spring Boot, Spring Cloud Contract (Groovy DSL), the Maven/Gradle plugin to emit a stubs JAR and WireMock stubs, plus stub-runner (standalone or JUnit) to run predictable HTTP or messaging integration tests. Workflow generates JUnit tests, uncovers breaking changes (demo catches a removed X27 field), supports stateful scenarios and CI publishing of contracts.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 1:33Legacy testing challenges
- 4:42Reviewing existing code
- 8:37Introducing contract testing
- 12:11Implementing stub runner
- 19:08Externalizing contracts
- 22:26Contract generation process
- 26:02Refactoring API breaking
- 30:58Consumer driven workflow
- 37:01Advanced contract features
- 47:15Node.js and CLI support
- 50:59Q&A and conclusion
related talks
30mManaging APIs and Contracts in a Microservices World Using Spring Cloud Contract
49mCollaborative Contract Driven Development
17mConsumer driven development with Spring cloud contract
47mCollaborative Contract Driven Development
01h 21mContract Driven Development-Deploy MicroServices Independently W/out Integration Testing
38mConsumer driven contracts in a polyglot world
33mPractical Contract Testing with Spring Cloud Contract
48mConsumer Driven with OpenAPI
