Spring Cloud Contract in a polyglot world
This article contains a short reminder of what Contract Testing is, how Spring Cloud Contract implements it, and how Spring Cloud Contract can be used in a polyglot world.
What is Contract Testing
In order to increase the certainty that our systems behave properly, we write different types of tests. According to the test pyramid the main types of tests are unit, integration, and UI. The more complex the tests, the more time and effort they require and the more brittle they become.
In a distributed system, one of the most frequent problems is testing integrations between applications. Let’s assume that your service sends a REST request to another application. When using Spring Boot, you can write a @SpringBootTest
in which you test that behavior. You set up a Spring context, you prepare a request to be sent… and where do you send it? You haven’t started the other application, so you get a Connection Refused
…