I'm introducing this change because we have dozens and dozens of APIs that use request classes, but right now we have one new set of requests that have to interoperate as if they're live, but still return mocked data.
Adding this capability to the request classes seemed like smart encapsulation, all the surrounding code can act as if the requests are really using the network. And re-using Tapper is firmly within our wheelhouse -- that seems like it leaves the door open for really feature rich mocks like using addMatch with a lambda that reads and reacts to the request body.
I'm introducing this change because we have dozens and dozens of APIs that use request classes, but right now we have one new set of requests that have to interoperate as if they're live, but still return mocked data.
Adding this capability to the request classes seemed like smart encapsulation, all the surrounding code can act as if the requests are really using the network. And re-using Tapper is firmly within our wheelhouse -- that seems like it leaves the door open for really feature rich mocks like using
addMatch
with a lambda that reads and reacts to the request body.