jeudi 17 octobre 2019

Mock external dependencies in integration tests

Let's say I in a service-oriented architecture I have service A and service B I own. My clients talk to service A only. I have an integration test package that tests service A, service B, and together. The integration test package has no visibility to the code of service A and B (it's a legit client to service A and B). Service A and B depends on a number of things, AWS services, other services in the organization, local file system, and they do different things depending on the current CPU utilization of the machine they run.

What's the best tactic to mock the behavior of the said dependencies? I'm hoping my tests are not just happy cases. (Service A and B are Java, if that helps)

Thanks

Aucun commentaire:

Enregistrer un commentaire