I have to integrate API test-automation on a project that has a microservice architecture. Each back-end service has a different repository and is deployed separately. I haven't had the opportunity of implementing test-automation on a microservice architecture before, therefore I am not sure how to approach setting up the test data.
Let me introduce you to my dilemma: let's say we have a service called
Categories and a service called
Subjects, both services have create and delete operations, each with its own API endpoint. But here is the pickle, in order to create a Subject using the
Subjects service, a Category already has to exist, in order to be selected. But since a microservice architecture is in place, I don't have access to the
Categories API endpoints in the
Subjects service, so I cannot create a Category while the tests for the
Subjects service run in the
Subjects repo, which leads to my question: what approach should I opt for in order to provide the required-dependent test data?