@Test public void testBuild() throws IOException { HttpResponse httpResponse = new DefaultFullHttpResponse(HttpVersion.HTTP_1_0, HttpResponseStatus.GATEWAY_TIMEOUT); RecordedHttpResponseBuilder recordedHttpResponseBuilder = new RecordedHttpResponseBuilder(httpResponse); String charset = "UTF-8"; String str1 = "Hello world"; HttpContent httpContent1 = new DefaultHttpContent(Unpooled.copiedBuffer(str1.getBytes(charset))); recordedHttpResponseBuilder.appendHttpContent(httpContent1); String str2 = "second content"; HttpContent httpContent2 = new DefaultHttpContent(Unpooled.copiedBuffer(str2.getBytes(charset))); recordedHttpResponseBuilder.appendHttpContent(httpContent2); String lastStr = "Last chunk"; HttpContent lastContent = new DefaultLastHttpContent(Unpooled.copiedBuffer(lastStr.getBytes(charset))); recordedHttpResponseBuilder.appendHttpContent(lastContent); RecordedHttpResponse recordedHttpResponse = recordedHttpResponseBuilder.build(); Assert.assertEquals(recordedHttpResponse.getStatus(), HttpResponseStatus.GATEWAY_TIMEOUT.code()); Assert.assertEquals((str1 + str2 + lastStr).getBytes(charset), recordedHttpResponse.getHttpBody().getContent(charset)); }
public RecordedHttpResponse build() { return new RecordedHttpResponse(_status, getHeaders(), getBody()); }
RecordedHttpResponseBuilder extends RecordedHttpMessageBuilder { public RecordedHttpResponse build() { return new RecordedHttpResponse(_status, getHeaders(), getBody()); } }
RecordedHttpResponseBuilder extends RecordedHttpMessageBuilder { public RecordedHttpResponse build() { return new RecordedHttpResponse(_status, getHeaders(), getBody()); } RecordedHttpResponseBuilder(HttpResponse nettyHttpResponse); }
RecordedHttpResponseBuilder extends RecordedHttpMessageBuilder { public RecordedHttpResponse build() { return new RecordedHttpResponse(_status, getHeaders(), getBody()); } RecordedHttpResponseBuilder(HttpResponse nettyHttpResponse); RecordedHttpResponse build(); }
RecordedHttpResponseBuilder extends RecordedHttpMessageBuilder { public RecordedHttpResponse build() { return new RecordedHttpResponse(_status, getHeaders(), getBody()); } RecordedHttpResponseBuilder(HttpResponse nettyHttpResponse); RecordedHttpResponse build();  }