REST and Messaging contracts with Spring Cloud Contract
summary
Spring Cloud Contract converts Groovy DSL contracts into auto-generated contract tests that fail the producer build if the API or message format diverges, produces WireMock stubs and publishes them alongside artifacts, and starts an in-memory stub server for consumers via a stub-runner dependency or Docker image. It supports REST and messaging (Spring Cloud Stream), Gradle/Maven, and JUnit 5; the workflow enforces consumer-driven contracts and aims to replace most E2E tests so pipelines finish in minutes.
AI-written summary · about
chapters (10)
- 0:00Introduction to contracts
- 1:01Challenges in testing
- 6:38Stubbing and limitations
- 12:23Introducing contracts
- 15:12Working with the framework
- 20:05Consumer-side implementation
- 26:07Messaging contracts
- 30:13Advanced use cases
- 33:59Architectural benefits
- 38:04Future and Q&A
related talks
30mManaging APIs and Contracts in a Microservices World Using Spring Cloud Contract
33mPractical Contract Testing with Spring Cloud Contract
17mConsumer driven development with Spring cloud contract
47mCollaborative Contract Driven Development
44mBuild Resilient Systems with Spring Cloud Contract and Testcontainers
50mFrom Contracts to Confidence: Spring Cloud Contract 5 in the Age of AI
01h 04mConsumer Driven Contracts and Your Microservice Architecture
49mCollaborative Contract Driven Development
