Have a question?
Message sent Close
View Categories

Contract Testing for APIs

Contract Testing for APIs

  • Consumer: The system or service that makes requests to the API (e.g., a frontend application).
  • Provider: The system or service that responds to the requests (e.g., a backend service).
  • Consumer-Driven Contracts (CDC): The consumer defines its expectations of the provider’s API. The contract reflects the specific interactions that the consumer relies on, and the provider agrees to fulfill these interactions.

  • Consumer Tests: The consumer tests are written to generate the expected contract. These tests ensure that the consumer’s expectations are correctly captured in the contract.
  • Provider Tests: The provider tests validate that the API adheres to the contract. These tests ensure that the provider meets the expectations defined by the consumer.