Hi,
I try to create a Wiremock stub which uses a response body that originates from an InputStream. The InputStream will be generated on the fly by the tests and will be large - eventually up into the gigabyte range. However, I have not found a way to achieve this without actually buffering the whole thing. Looking at StubResponseRenderer#renderDirectly(ServeEvent serveEvent), I can see two possible sources for the response body: an InputStreamSource originating from filesBlobStore (which, as far as I see this, can only render files), and a ByteBody that needs the full byte array. I don't want to store the body as a file, and I don't want to buffer it as the full byte array. It would be nice if there'd be a way to define a response that originates in an arbitrary InputStream. I think what we need here is not just a response body definition specifying an InputStream directly, but rather something like an InputStream supplier, otherwise the stub would be a one-shot stub.
Is there anything I missed? Preferably of course another way to achieve this without requiring lots of disk space or memory?