April 2018
Intermediate to advanced
432 pages
10h 38m
English
Assuming we have successfully built and run tests on the provider side, the stubs will have been generated and then published in our local Maven repository. To be able to use them during the consumer application test, we should include Spring Cloud Contract Stub Runner to the project dependencies:
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-contract-stub-runner</artifactId> <scope>test</scope></dependency>
Then we should annotate our test class with @AutoConfigureStubRunner. It takes two input parameters—ids and workOffline. The Ids field is a concatenation of the artifactId, groupId, version number, stubs qualifier, and port number, and generally points ...