For consumer-driven contracts, Spring also has a project to help the user to easily achieve their contract testing, Spring Cloud Contract (SCC). It basically consists of three major tools:
- SCC verifier tool
- SCC WireMock
- SCC Stub Runner
By default, SCC supports JSON-based stub (WireMock). The verifier should be added on the producer side. You have to define the contract for your URLs. You can keep that in the same repository or have a completely different repository for it. The producer and the consumer both refer to this repository as the common contract. The following is the sample POM file:
<dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-contract-dependencies</artifactId> ...