Home / Function/ clientShouldveSentPrefaceAndSettingsFrameWhenUserEventIsTriggered() — netty Function Reference

clientShouldveSentPrefaceAndSettingsFrameWhenUserEventIsTriggered() — netty Function Reference

Architecture documentation for the clientShouldveSentPrefaceAndSettingsFrameWhenUserEventIsTriggered() function in Http2ConnectionHandlerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  5b447a7c_7a71_561b_e05f_0a8a83177755["clientShouldveSentPrefaceAndSettingsFrameWhenUserEventIsTriggered()"]
  e8b32c7d_fa9d_422b_0744_82047ac00ea5["Http2ConnectionHandlerTest"]
  5b447a7c_7a71_561b_e05f_0a8a83177755 -->|defined in| e8b32c7d_fa9d_422b_0744_82047ac00ea5
  style 5b447a7c_7a71_561b_e05f_0a8a83177755 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ConnectionHandlerTest.java lines 269–302

    @ParameterizedTest
    @ValueSource(booleans = { true, false })
    public void clientShouldveSentPrefaceAndSettingsFrameWhenUserEventIsTriggered(boolean flushPreface)
            throws Exception {
        when(connection.isServer()).thenReturn(false);
        when(channel.isActive()).thenReturn(false);
        handler = newHandler(flushPreface);
        when(channel.isActive()).thenReturn(true);

        final Http2ConnectionPrefaceAndSettingsFrameWrittenEvent evt =
                Http2ConnectionPrefaceAndSettingsFrameWrittenEvent.INSTANCE;

        final AtomicBoolean verified = new AtomicBoolean(false);
        final Answer<Object> verifier = new Answer<Object>() {
            @Override
            public Object answer(final InvocationOnMock in) throws Throwable {
                assertEquals(in.getArgument(0), evt);  // sanity check...
                verify(ctx).write(eq(connectionPrefaceBuf()));
                verify(encoder).writeSettings(eq(ctx), any(Http2Settings.class), any(ChannelPromise.class));
                verified.set(true);
                return null;
            }
        };

        doAnswer(verifier).when(ctx).fireUserEventTriggered(evt);

        handler.channelActive(ctx);
        if (flushPreface) {
            verify(ctx, times(1)).flush();
        } else {
            verify(ctx, never()).flush();
        }
        assertTrue(verified.get());
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free