Class TestResponse


  • public class TestResponse
    extends Object
    Represents a response suitable for testing asserts. Cache all data in memory.
    • 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 as String when response is completed when coding charset is get from response and defaults to UTF-8.
        Returns:
        a completion stage of response.
      • webServer

        public WebServer webServer()
        Returns a web server instance.
        Returns:
        a web server associated with this test call.