Class AbstractTransportEncodeSmokeIntegrationTest
- Direct Known Subclasses:
AbstractBasicMockingIntegrationTest
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.
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.
-
Field Summary
Fields inherited from class org.mockserver.testing.integration.mock.AbstractMockingIntegrationTestBase
clientEventLoopGroup, defaultTimeout, HEADERS_TO_IGNORE, httpClient, insecureEchoServer, MOCK_SERVER_LOGGER, mockServerClient, secureEchoServer, servletContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidprotected booleanWhether this transport can serve responses chunked byConnectionOptions.chunkSize.Methods inherited from class org.mockserver.testing.integration.mock.AbstractTransportDecodeSmokeIntegrationTest
decodeSmoke_binaryPngBody, decodeSmoke_contentEncodingGzip, decodeSmoke_jsonBody, decodeSmoke_multiValueHeader, decodeSmoke_parameterBody, decodeSmoke_utf16Body, decodeSmoke_xmlBodyViaXPath, supportsRequestBodyDecompressionMethods inherited from class org.mockserver.testing.integration.mock.AbstractMockingIntegrationTestBase
addContextToPath, authorisationHeader, calculatePath, createClientAndEventLoopGroup, filterHeaders, getHeadersToRemove, getRequestModifier, getServerPort, getServerSecurePort, isSecureControlPlane, makeRequest, resetServer, resetServletContext, startEchoServer, stopEventLoopGroup, verifyRequestsMatches, verifyRequestsMatches
-
Constructor Details
-
AbstractTransportEncodeSmokeIntegrationTest
public AbstractTransportEncodeSmokeIntegrationTest()
-
-
Method Details
-
supportsChunkedResponses
protected boolean supportsChunkedResponses()Whether this transport can serve responses chunked byConnectionOptions.chunkSize. Override tofalseon transports that do not honour it. -
encodeSmoke_staticResponseBody
public void encodeSmoke_staticResponseBody() -
encodeSmoke_chunkedResponseBody
public void encodeSmoke_chunkedResponseBody() -
encodeSmoke_largeResponseBody
public void encodeSmoke_largeResponseBody()
-