Class AbstractTransportEncodeSmokeIntegrationTest

Direct Known Subclasses:
AbstractBasicMockingIntegrationTest

public abstract class AbstractTransportEncodeSmokeIntegrationTest extends AbstractTransportDecodeSmokeIntegrationTest
Explicit per-transport response-encode smoke tests — the counterpart to AbstractTransportDecodeSmokeIntegrationTest, which covers only request decode.

That asymmetry is the structural cause of a recurring defect class. Every bug in the family was a response-encode bug, invisible to a decode test and invisible to any test that asserts against MockServer's own model objects:

  • GitHub issue #2419 — server-streaming gRPC delivered zero messages to a real client over HTTP/2, because the handler wrote raw Netty objects that nothing stamped with the HTTP/2 stream id, so the whole stream went out on a phantom server-initiated stream;
  • the same omission in the SSE handler, the streaming-body writer, the metrics endpoint and the MCP handler — all found only by auditing, because no test drove them over HTTP/2.
The common signature is that the server believes it responded and the client receives nothing. Only a test that asserts the client actually received the body, run over the transport in question, can see it.

Each method therefore sends withSecure(true): in the HTTP/2 subclasses getRequestModifier upgrades a secure request to Protocol.HTTP_2, so these run over real HTTP/2 there and over HTTPS elsewhere — one set of methods covering both. (The plaintext leg cannot exercise h2c: NettyHttpClient downgrades HTTP_2 to HTTP/1.1 when the request is not secure, since h2c needs prior knowledge rather than ALPN. h2c encode coverage is a separate gap, noted in the audit.)

Because this class sits between AbstractTransportDecodeSmokeIntegrationTest and AbstractBasicMockingIntegrationTest in the inheritance chain, every concrete transport subclass inherits and runs these methods, forming an explicit per-transport encode contract that a future change cannot silently drop.

  • Constructor Details

    • AbstractTransportEncodeSmokeIntegrationTest

      public AbstractTransportEncodeSmokeIntegrationTest()
  • Method Details

    • supportsChunkedResponses

      protected boolean supportsChunkedResponses()
      Whether this transport can serve responses chunked by ConnectionOptions.chunkSize. Override to false on transports that do not honour it.
    • encodeSmoke_staticResponseBody

      public void encodeSmoke_staticResponseBody()
    • encodeSmoke_chunkedResponseBody

      public void encodeSmoke_chunkedResponseBody()
    • encodeSmoke_largeResponseBody

      public void encodeSmoke_largeResponseBody()