What is API
Contract Testing with Microservice API
Testing microservices application is complex. Environments are difficult to setup and maintain along with the running costs. Therefore API Contract Testing allows you to scale your automation testing for microservices.
The way I describe API Contract Testing is that its integration testing flipped upside down. Instead of the API service (provider) testing itself. The web app (consumer) definews what the API service should request and respond with. To learn more with a contract testing microservices example.
To demonstrate this with an example:
You have a web app which returns a list of courses and answers like Udemy. The web and mobile app displays the courses connected to the topic searched for. When calling the API service to get the courses associated with the topic the Web App passes the topic text. In return the Web App expects the API service to return all courses as a list. Therefore the API service must accept these values in the request and return the courses in list format.