O'Reilly logo

TypeScript Microservices by Parth Ghiya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Contract tests

There is a lot of collaboration going on between microservices in a distributed system. Collaborations need to be implemented as requests from one microservice to another. Any change in an endpoint can break all the microservices calling that particular endpoint. This is where contract tests come into the picture.

When any microservices communicate, the one that makes a request to another has some expectations about how the other microservice will act. This is how the collaboration would work out: the calling microservice expects the called microservice to implement a certain fixed contract. A contract test is a test for the purpose of checking whether the called microservice implements the contract as per the calling microservice's ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required