Package io.helidon.webserver.testsupport
Class TestResponse
- java.lang.Object
-
- io.helidon.webserver.testsupport.TestResponse
-
public class TestResponse extends Object
Represents a response suitable for testing asserts. Cache all data in memory.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<byte[]>asBytes()Returns content as bytes when response is completed.CompletableFuture<String>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.io.helidon.webserver.WebServerwebServer()Returns a web server instance.
-
-
-
Method Detail
-
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
public CompletableFuture<byte[]> asBytes()
Returns content as bytes when response is completed.- Returns:
- a completion stage of body bytes.
-
asString
public CompletableFuture<String> 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
public io.helidon.webserver.WebServer webServer()
Returns a web server instance.- Returns:
- a web server associated with this test call.
-
-