Package io.helidon.webserver.testsupport
Class TestResponse
java.lang.Object
io.helidon.webserver.testsupport.TestResponse
Represents a response suitable for testing asserts. Cache all data in memory.
-
Method Summary
Modifier and TypeMethodDescriptionCompletableFuture<byte[]>asBytes()Returns content as bytes when response is completed.asString()Returns content asStringwhen response is completed when coding charset is get from response and defaults toUTF-8.io.helidon.common.http.Parametersheaders()Returns all response headers.io.helidon.common.http.Http.ResponseStatusstatus()Returns an HTTP status code of the response.Returns a web server instance.
-
Method Details
-
status
public io.helidon.common.http.Http.ResponseStatus status()Returns an HTTP status code of the response.- Returns:
- an HTTP status code.
-
headers
public io.helidon.common.http.Parameters headers()Returns all response headers.- Returns:
- response headers.
-
asBytes
Returns content as bytes when response is completed.- Returns:
- a completion stage of body bytes.
-
asString
Returns content asStringwhen response is completed when coding charset is get from response and defaults toUTF-8.- Returns:
- a completion stage of response.
-
webServer
Returns a web server instance.- Returns:
- a web server associated with this test call.
-