Learn from the best and brightest in our community.

Creating and testing REST and Messaging contracts with Spring Cloud Contract

Micro-service architecture Micro-service Rest Message-driven architecture Contract tests Consumer driven contracts Spring cloud Gradle level intermediate


REST and Messaging solutions do not come with an in-built contract compliance mechanism, which in many ways is a great thing. However, while working with microservice-based systems, it often appears that a practical mechanism that would provide help in shaping and describing REST and Messaging contracts would come in handy. Similarly, creating integration and acceptance tests in such systems presents many challenges.

In this talk, I will present Spring Cloud Contract, a contract verification solution, written in big part in Groovy, that allows for both: easily shaping REST and Messaging contracts and verifying if our app adheres to them using automatically generated Spock tests. I will show how, using Spring Cloud Contract, we can quickly generate automatically-tested stubs from simple Groovy DSL scripts. I will talk about the typical usages and script examples, as well as possible problems and ways of handling them.


50 min