concept proxy response in category microservice

This is an excerpt from Manning's book Testing Microservices with Mountebank.
Mountebank lacks the comedic flair of Saturday Night Live impersonators, but it does support a high-fidelity form of mimicry. Rather than creating a canned response for each request, an imposter can go directly to the source. It’s as if the imposter is wearing an earpiece, and every time your system under test asks it a question, the real service whispers the answer in your imposter’s ear. Better yet, mountebank imposters have a great memory, so once the imposter has heard a response, it can replay the response in the future even without the earpiece. Thanks to the magic of proxy responses, a mountebank imposter can be almost indistinguishable from the real thing.
Listing 5.4. Saved proxy responses with predicates
{ "stubs": [ { "predicates": [{ "deepEquals": { "path": "/inventory/2599b7f4" } #1 }], "responses": [{ "is": { "body": "54" } #2 }] }, { "predicates": [{ "deepEquals": { "path": "/inventory/e1977c9e" } #3 }], "responses": [{ "is": { "body": "100" } #4 }] }, { "responses": [{ "proxy": { "to": "http://localhost:8080", "predicateGenerators": [{ "matches": { "path": true } }], "mode": "proxyOnce" } }] } ] }
The basic is response is easy to understand but limited in functionality. Proxy responses provide high-fidelity mimicry, but each saved response represents a snapshot in time. Response injection provides significant flexibility but comes with high complexity. Sometimes, you want the simplicity of is and proxy responses with a touch of dynamism, all without the complexity of inject.
Behaviors are agnostic to the type of response they are applied to, which means you can decorate a proxy response as well. But by default, the decoration applies only to the proxy response itself, not to the is response it saves. (See figure 7.3.)