testLastResponseWithTrailingHeader() — netty Function Reference
Architecture documentation for the testLastResponseWithTrailingHeader() function in HttpResponseDecoderTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 8595ef72_f32c_21ac_4800_3ee859e519aa["testLastResponseWithTrailingHeader()"] 90546a8c_51c4_a9dc_b6e8_695d29269596["HttpResponseDecoderTest"] 8595ef72_f32c_21ac_4800_3ee859e519aa -->|defined in| 90546a8c_51c4_a9dc_b6e8_695d29269596 style 8595ef72_f32c_21ac_4800_3ee859e519aa fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-http/src/test/java/io/netty/handler/codec/http/HttpResponseDecoderTest.java lines 587–616
@Test
public void testLastResponseWithTrailingHeader() {
EmbeddedChannel ch = new EmbeddedChannel(new HttpResponseDecoder());
ch.writeInbound(Unpooled.copiedBuffer(
"HTTP/1.1 200 OK\r\n" +
"Transfer-Encoding: chunked\r\n" +
"\r\n" +
"0\r\n" +
"Set-Cookie: t1=t1v1\r\n" +
"Set-Cookie: t2=t2v2; Expires=Wed, 09-Jun-2021 10:18:14 GMT\r\n" +
"\r\n",
CharsetUtil.US_ASCII));
HttpResponse res = ch.readInbound();
assertSame(HttpVersion.HTTP_1_1, res.protocolVersion());
assertEquals(HttpResponseStatus.OK, res.status());
LastHttpContent lastContent = ch.readInbound();
assertFalse(lastContent.content().isReadable());
HttpHeaders headers = lastContent.trailingHeaders();
assertEquals(1, headers.names().size());
List<String> values = headers.getAll(of("Set-Cookie"));
assertEquals(2, values.size());
assertTrue(values.contains("t1=t1v1"));
assertTrue(values.contains("t2=t2v2; Expires=Wed, 09-Jun-2021 10:18:14 GMT"));
lastContent.release();
assertFalse(ch.finish());
assertNull(ch.readInbound());
}
Domain
Subdomains
Source
Frequently Asked Questions
What does testLastResponseWithTrailingHeader() do?
testLastResponseWithTrailingHeader() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpResponseDecoderTest.java.
Where is testLastResponseWithTrailingHeader() defined?
testLastResponseWithTrailingHeader() is defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpResponseDecoderTest.java at line 587.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free