Home / Function/ assertEmptyResponse() — netty Function Reference

assertEmptyResponse() — netty Function Reference

Architecture documentation for the assertEmptyResponse() function in HttpResponseEncoderTest.java from the netty codebase.

Function java Buffer Allocators calls 1 called by 9

Entity Profile

Dependency Diagram

graph TD
  83a60783_c879_3bf7_0aef_b701b1dae5ff["assertEmptyResponse()"]
  9235a1ad_cba8_50c2_25b1_57ce61f5b623["HttpResponseEncoderTest"]
  83a60783_c879_3bf7_0aef_b701b1dae5ff -->|defined in| 9235a1ad_cba8_50c2_25b1_57ce61f5b623
  f2e55e81_25b2_463e_4fb2_174a47fa9254["testStatusNoContent()"]
  f2e55e81_25b2_463e_4fb2_174a47fa9254 -->|calls| 83a60783_c879_3bf7_0aef_b701b1dae5ff
  808088f5_ae15_c07c_a6af_14f6c9aef0b0["testStatusNoContentContentLength()"]
  808088f5_ae15_c07c_a6af_14f6c9aef0b0 -->|calls| 83a60783_c879_3bf7_0aef_b701b1dae5ff
  812c6442_fe95_489f_a3b3_09b6cf8f5962["testStatusNoContentTransferEncoding()"]
  812c6442_fe95_489f_a3b3_09b6cf8f5962 -->|calls| 83a60783_c879_3bf7_0aef_b701b1dae5ff
  33f69b7d_a35a_6149_b2c8_f3d22acc168a["testStatusNotModified()"]
  33f69b7d_a35a_6149_b2c8_f3d22acc168a -->|calls| 83a60783_c879_3bf7_0aef_b701b1dae5ff
  a671365d_91e0_59b1_823e_de5376407cc4["testStatusNotModifiedContentLength()"]
  a671365d_91e0_59b1_823e_de5376407cc4 -->|calls| 83a60783_c879_3bf7_0aef_b701b1dae5ff
  9d5cbe2b_4834_8e67_e7bd_c630c0912add["testStatusNotModifiedTransferEncoding()"]
  9d5cbe2b_4834_8e67_e7bd_c630c0912add -->|calls| 83a60783_c879_3bf7_0aef_b701b1dae5ff
  e18c4a0f_46dd_e3d0_774c_8b2ea5b25f34["testStatusInformational()"]
  e18c4a0f_46dd_e3d0_774c_8b2ea5b25f34 -->|calls| 83a60783_c879_3bf7_0aef_b701b1dae5ff
  961f77fb_5760_37a9_6f8e_ed08f8209e08["testStatusInformationalContentLength()"]
  961f77fb_5760_37a9_6f8e_ed08f8209e08 -->|calls| 83a60783_c879_3bf7_0aef_b701b1dae5ff
  e753c10f_fb34_066f_f303_5b5475065c93["testStatusInformationalTransferEncoding()"]
  e753c10f_fb34_066f_f303_5b5475065c93 -->|calls| 83a60783_c879_3bf7_0aef_b701b1dae5ff
  dc0150e4_fa1e_faa8_3643_9c1860fad9ee["release()"]
  83a60783_c879_3bf7_0aef_b701b1dae5ff -->|calls| dc0150e4_fa1e_faa8_3643_9c1860fad9ee
  style 83a60783_c879_3bf7_0aef_b701b1dae5ff fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/HttpResponseEncoderTest.java lines 273–306

    private static void assertEmptyResponse(EmbeddedChannel channel, HttpResponseStatus status,
                                            CharSequence headerName, boolean headerStripped) {
        HttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, status);
        if (HttpHeaderNames.CONTENT_LENGTH.contentEquals(headerName)) {
            response.headers().set(headerName, "0");
        } else if (HttpHeaderNames.TRANSFER_ENCODING.contentEquals(headerName)) {
            response.headers().set(headerName, HttpHeaderValues.CHUNKED);
        }

        assertTrue(channel.writeOutbound(response));
        assertTrue(channel.writeOutbound(LastHttpContent.EMPTY_LAST_CONTENT));

        ByteBuf buffer = channel.readOutbound();
        StringBuilder responseText = new StringBuilder();
        responseText.append(HttpVersion.HTTP_1_1).append(' ').append(status.toString()).append("\r\n");
        if (!headerStripped && headerName != null) {
            responseText.append(headerName).append(": ");

            if (HttpHeaderNames.CONTENT_LENGTH.contentEquals(headerName)) {
                responseText.append('0');
            } else {
                responseText.append(HttpHeaderValues.CHUNKED);
            }
            responseText.append("\r\n");
        }
        responseText.append("\r\n");

        assertEquals(responseText.toString(), buffer.toString(CharsetUtil.US_ASCII));

        buffer.release();

        buffer = channel.readOutbound();
        buffer.release();
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does assertEmptyResponse() do?
assertEmptyResponse() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpResponseEncoderTest.java.
Where is assertEmptyResponse() defined?
assertEmptyResponse() is defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpResponseEncoderTest.java at line 273.
What does assertEmptyResponse() call?
assertEmptyResponse() calls 1 function(s): release.
What calls assertEmptyResponse()?
assertEmptyResponse() is called by 9 function(s): testStatusInformational, testStatusInformationalContentLength, testStatusInformationalTransferEncoding, testStatusNoContent, testStatusNoContentContentLength, testStatusNoContentTransferEncoding, testStatusNotModified, testStatusNotModifiedContentLength, and 1 more.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free