I have just read articles about contract-based testing for verifying contracts between microservices:
- Testing Strategies in a Microservice Architecture
- Consumer-Driven Contracts: A Service Evolution Pattern
In my company our team has built a REST service (A) that is used by other applications (B, C, D, ...) of other teams. I wonder how should we implement this idea. I envision the process like that:
- We provide other teams access to our test repository.
- Other teams, let say team of B, provide pull request w tests that test simulate behaviour of their application B against our contract A.
- We accept their pull request
- We run tests from other consumers (teams whose applications consume our service) as a part of our build.
- Is this correct understanding? Am I missing anything?
- Is there any rule how consumer tests should look like? Should it be a real application B, C, D that calls our service or rather it should be a test that simulate those applications?
- What are the tools supporting contract-based testing?