user13368585
user13368585

Reputation: 1

Testing dependent microservices

How to test a microservice A which is dependent on another microservice B which is further dependent on microservice C and so on? What testing strategy for testing microservice A we can plan?

Upvotes: 0

Views: 332

Answers (1)

Cosmin Ioniță
Cosmin Ioniță

Reputation: 4055

I think it depends on the testing level you want to implement, and also on the business logic:

  • For unit-testing (let's say the microservice A), you can just mock the response from the dependent microservices.
  • For integration/acceptance testing, you can just create an in-memory version of dependent microservices, or even container-based, sandboxed environment with them, and run it in the CI/CD workflow
  • For end-to-end testing, you can just add test data (depends on business logic) in production and create (or use an existing) test runner that runs different scenarios.

Upvotes: 1

Related Questions