Class HttpRequestResult

java.lang.Object
com.soklet.HttpRequestResult

@ThreadSafe public final class HttpRequestResult extends Object
Encapsulates the results of a request that would normally be handled by your HttpServer (both logical response and bytes to be sent over the wire), used for integration testing via Simulator.performHttpRequest(Request).

Instances can be acquired via the withMarshaledResponse(MarshaledResponse) builder factory method. A convenience instance factory is also available via fromMarshaledResponse(MarshaledResponse).

This type is also delivered to the response consumers of HttpServer.RequestHandler and SseServer.RequestHandler. Custom SSE transports use getSseHandshakeResult() to obtain the logical handshake and any accepted client initializer or client context.

The Server-Sent Event equivalent of this type is SseRequestResult, which is used for integration testing via Simulator.performSseRequest(Request).

See https://www.soklet.com/docs/testing#integration-testing for detailed documentation.

Author:
Mark Allen