I have an API A which is used by UI to display some data. There are some internal APIs called and the data is collected and returned by API A. So, the flow is something like this:
API A —> API B
On a happy path, API B returns all the attributes, but on a bad day, same API B may excludes some of the attributes which in turn changes the response of API A. The processing of API A tackles the missing attributes and performs necessary steps.
We are planning to use wiremock to test this. The problem is that we are ending with too many wiremock stubs to tackle missing attribute scenario. If we were to do this programmatically, it would be lot easier, since we could have just one input and can change the response depending on the test case.
Is there a way do the same via file stubbing ?, i.e. we have one stub mapping but the mock response is edited in the setup of the test case ?