Hi I have a question. I need to mock two differen...
# help
Hi I have a question. I need to mock two different APIs for the /accounts/$accountId/eligibility endpoint, but they return different responses. I tried adding two mappings like this, but since the endpoints are exactly the same, they conflict with each other. What can I do?
Copy code
fun stubXXX(statusCode: Int, accountId: Int, responseSample: Sample): StubMapping {
    return stubFor(
                    .withHeader(CONTENT_TYPE, APPLICATION_JSON)

Language: kotlin
In the API you're mocking, what determines whether response 1 or response 2 is returned?
actually there is two API that I want to mock but these two API has same endpoint. Like API 1 - sameEndpoint - return X API 2 - sameEndpoint - return Y api url = wiremock url
There are a couple of potential solutions I can think of: • Use two different WireMock instances • See if you can tell the app calling the WireMock instances to call
instead of having them both call
• See if you can have the application inject a header that allows you to differentiate between the two (but that might involve duplicating all your mocks)