Home / Function/ testEncodeHttpsSchemeWhenSslHandlerExists() — netty Function Reference

testEncodeHttpsSchemeWhenSslHandlerExists() — netty Function Reference

Architecture documentation for the testEncodeHttpsSchemeWhenSslHandlerExists() function in Http2StreamFrameToHttpObjectCodecTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  d19ea09a_74c1_e4d4_971f_bb7893a5b13f["testEncodeHttpsSchemeWhenSslHandlerExists()"]
  f77629dd_309f_f368_8220_46ddc65ad871["Http2StreamFrameToHttpObjectCodecTest"]
  d19ea09a_74c1_e4d4_971f_bb7893a5b13f -->|defined in| f77629dd_309f_f368_8220_46ddc65ad871
  style d19ea09a_74c1_e4d4_971f_bb7893a5b13f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/Http2StreamFrameToHttpObjectCodecTest.java lines 450–485

    @Test
    public void testEncodeHttpsSchemeWhenSslHandlerExists() throws Exception {
        final Queue<Http2StreamFrame> frames = new ConcurrentLinkedQueue<Http2StreamFrame>();

        final SslContext ctx = SslContextBuilder.forClient().sslProvider(SslProvider.JDK).build();
        EmbeddedChannel ch = new EmbeddedChannel(ctx.newHandler(ByteBufAllocator.DEFAULT),
                new ChannelOutboundHandlerAdapter() {
                    @Override
                    public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
                        if (msg instanceof Http2StreamFrame) {
                            frames.add((Http2StreamFrame) msg);
                            ctx.write(Unpooled.EMPTY_BUFFER, promise);
                        } else {
                            ctx.write(msg, promise);
                        }
                    }
                }, new Http2StreamFrameToHttpObjectCodec(false));

        try {
            FullHttpRequest req = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/hello/world");
            assertTrue(ch.writeOutbound(req));

            ch.finishAndReleaseAll();

            Http2HeadersFrame headersFrame = (Http2HeadersFrame) frames.poll();
            Http2Headers headers = headersFrame.headers();

            assertEquals("https", headers.scheme().toString());
            assertEquals("GET", headers.method().toString());
            assertEquals("/hello/world", headers.path().toString());
            assertTrue(headersFrame.isEndStream());
            assertNull(frames.poll());
        } finally {
            ch.finishAndReleaseAll();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testEncodeHttpsSchemeWhenSslHandlerExists() do?
testEncodeHttpsSchemeWhenSslHandlerExists() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2StreamFrameToHttpObjectCodecTest.java.
Where is testEncodeHttpsSchemeWhenSslHandlerExists() defined?
testEncodeHttpsSchemeWhenSslHandlerExists() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2StreamFrameToHttpObjectCodecTest.java at line 450.

Analyze Your Own Codebase

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

Try Supermodel Free