I have this longstanding issue, which I raised in one of the mad_in_api Q&As in December 2024, about how to test API proxies that have Service Callouts in their flow. This is a common flow that we have:
As part of developing our proxies, we use Javascript testing libraries to call our proxy (most of the time running Apigee in the emulator, but also in the cloud after deployment) and validate the responses' status codes, payloads, etc. We usually have a flag that prevents Apigee from calling the target system, and instead return the message that would have been sent to the latter.
This works fine for proxies that do not use service callouts, but fails (or forces us to use test cases that actually exist in a target system) when a proxy has a SC, since we get 500s back from the SC.
In the mad_in_api Q&A, @tylerayers presented us his solution using a mock proxy. It seems this could work for my team, but we would like to get more details on how to implement this.
Hope this will be useful for others as well!