In this article, take a look at Spring Cloud Contract and put some ideas into code.

In a previous post, we saw how new needs arose in the field of testing derived from the evolution of application architectures.

Through a simple example, we established concepts such as consumerproducer, and service and showed that just as important as testing the functionalities in consumer and producer independently is, so also is ensuring that the interaction between them both is right.

We introduced the concept of Contract Testing, which we delved into in another post, which allowed us to get familiar with the different approaches and tools.

Now, with all the information to hand, it’s time to put all those ideas into code. We will do it step by step, starting from the example in the first post, which we can download from here. Remember that here we highlighted the problem that we might encounter: an application that fails in production despite passing all the unit and integration tests.

We have chosen the producer-driven approach and as a tool, we will use Spring Cloud Contract. The code is available on GitHub. Let’s go!

#testing #spring #software quality #spring cloud contract #contract testing

Playing With Spring Cloud Contract
1.20 GEEK