Skip to Content
Mastering Spring Cloud
book

Mastering Spring Cloud

by Piotr Mińkowski
April 2018
Intermediate to advanced content levelIntermediate to advanced
432 pages
10h 38m
English
Packt Publishing
Content preview from Mastering Spring Cloud

Verifying a contract on the consumer side

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microservices with Spring Boot and Spring Cloud - Second Edition

Microservices with Spring Boot and Spring Cloud - Second Edition

Magnus Larsson

Publisher Resources

ISBN: 9781788475433Supplemental Content