I have an Azure API Management API for which I am mocking a particular operation. I have set up the mock to simulate the back-end service response (including urls in the response that look like they are emerging from the back-end service).
I have found that none of my outbound policies, including the redirect-content-urls policy, are getting applied for this mocked response so the urls being returned to the consumer are incorrect.
Now I know I can work around this in the mock itself, but what I would like is to be able to have all of my outbound policies applied to the mock response so that I can fully test my API without needing the back-end in place.
Is there a way around this other than by stubbing the back-end service?
The mock response policy will pick up the matching response from the responses that are configured for the api. If no response is defined then an empty response will be returned for the status code. As for the execution, as soon as the policy is encountered the policy execution is interrupted and the service will return the response based on your mock policy. Consider following scenarios where the mock-response policy is placed and its effect
So there is no direct way to implement the outbound polices when the mock response is defined in inbound. Best bet is to implemented the masked redirect content url in the mock response sample itself.