Search in sources :

Example 1 with HttpTunnelPayload

use of org.springframework.boot.devtools.tunnel.payload.HttpTunnelPayload in project spring-boot by spring-projects.

the class HttpTunnelServerTests method httpConnectionRespondWithPayload.

@Test
public void httpConnectionRespondWithPayload() throws Exception {
    HttpConnection connection = new HttpConnection(this.request, this.response);
    connection.waitForResponse();
    connection.respond(new HttpTunnelPayload(1, ByteBuffer.wrap("hello".getBytes())));
    assertThat(this.servletResponse.getStatus()).isEqualTo(200);
    assertThat(this.servletResponse.getContentAsString()).isEqualTo("hello");
    assertThat(this.servletResponse.getHeader(SEQ_HEADER)).isEqualTo("1");
}
Also used : HttpConnection(org.springframework.boot.devtools.tunnel.server.HttpTunnelServer.HttpConnection) HttpTunnelPayload(org.springframework.boot.devtools.tunnel.payload.HttpTunnelPayload) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 HttpTunnelPayload (org.springframework.boot.devtools.tunnel.payload.HttpTunnelPayload)1 HttpConnection (org.springframework.boot.devtools.tunnel.server.HttpTunnelServer.HttpConnection)1