Spring Cloud Contract

Spring Cloud Contract is a project that, simply put, helps us write Consumer-Driven Contracts (CDC). This ensures the contract between a Producer and a Consumer, in a distributed system – for both HTTP-based and message-based interactions. Producer – Server Side For our producer side, we'll need the spring-cloud-starter-contract-verifier dependency. Producer Side Setup Test stubs are in /src/test/resources/contracts/ package. When the build is run, the plugin automatically generates a test class named ContractVerifierTest that extends our BaseTestClass and puts it in /target/generated-test-sources/contracts/. The names of the test methods are derived from the prefix “validate_” concatenated with the names of our Groovy test stubs. For the above Groovy file, the generated method name will be “validate_find_provider_by_id()”. Consumer – Client Side The consumer side of our CDC consume stubs generated by the producer side through HTTP interaction to maintain the contract...