servicetalk-http-netty/src/testFixtures/java/io/servicetalk/http/netty/AsyncContextHttpFilterVerifier.java
/**
     * Verify that all interactions with the request/response and message-body from a request that goes through
     * the provided {@link StreamingHttpServiceFilterFactory} filter, have valid visibility of the {@link AsyncContext}.
     *
     * @param filter The {@link StreamingHttpServiceFilterFactory} filter to verify.
     */
Verify that all interactions with the request/response and message-body from a request that goes through
the provided  StreamingHttpServiceFilterFactory filter, have valid visibility of the  AsyncContext.

@param filter The  StreamingHttpServiceFilterFactory filter to verify.
Verify that all interactions with the request / response and message - body from a request that goes through the provided StreamingHttpServiceFilterFactory filter have valid visibility of the AsyncContext . @param filter The StreamingHttpServiceFilterFactory filter to verify .
public static void verifyServerFilterAsyncContextVisibility(final StreamingHttpServiceFilterFactory filter)
            throws Exception {
        final BlockingQueue<Throwable> errors = new LinkedBlockingDeque<>();
        final List<String> payload = singletonList("Hello World");
        final ServerContext serverContext = forAddress(localAddress(0))
                .appendServiceFilter(asyncContextAssertionFilter(errors))
                .appendServiceFilter(filter)
                .listenStreamingAndAwait(asyncContextRequestHandler(errors));
        final BlockingStreamingHttpClient client = forSingleAddress(serverHostAndPort(serverContext))
                .buildBlockingStreaming();
        final BlockingStreamingHttpRequest request = client.post("/test")
                .payloadBody(payload, appSerializerUtf8FixLen());
        final BlockingStreamingHttpResponse resp = client.request(request);
        assertThat(resp.status(), is(OK));
        Iterator<String> itr = resp.payloadBody(appSerializerUtf8FixLen()).iterator();
        assertThat(itr.hasNext(), is(true));
        assertThat(itr.next(), is(payload.get(0)));
        assertThat(itr.hasNext(), is(false));
        assertNoAsyncErrors(errors);
    }
public static void verifyServerFilterAsyncContextVisibility ( final StreamingHttpServiceFilterFactory filter ) throws Exception { final BlockingQueue < Throwable > errors = new LinkedBlockingDeque < > ( ) ; final List < String > payload = singletonList ( "Hello World" ) ; final ServerContext serverContext = forAddress ( localAddress ( 0 ) ) . appendServiceFilter ( asyncContextAssertionFilter ( errors ) ) . appendServiceFilter ( filter ) . listenStreamingAndAwait ( asyncContextRequestHandler ( errors ) ) ; final BlockingStreamingHttpClient client = forSingleAddress ( serverHostAndPort ( serverContext ) ) . buildBlockingStreaming ( ) ; final BlockingStreamingHttpRequest request = client . post ( "/test" ) . payloadBody ( payload , appSerializerUtf8FixLen ( ) ) ; final BlockingStreamingHttpResponse resp = client . request ( request ) ; assertThat ( resp . status ( ) , is ( OK ) ) ; Iterator < String > itr = resp . payloadBody ( appSerializerUtf8FixLen ( ) ) . iterator ( ) ; assertThat ( itr . hasNext ( ) , is ( true ) ) ; assertThat ( itr . next ( ) , is ( payload . get ( 0 ) ) ) ; assertThat ( itr . hasNext ( ) , is ( false ) ) ; assertNoAsyncErrors ( errors ) ; }
Verify that all interactions with the request/response and message-body from a request that goes through
 the provided {@link StreamingHttpServiceFilterFactory} filter, have valid visibility of the {@link AsyncContext}.
Verify that all interactions with the request / response and message - body from a request that goes through the provided { @link StreamingHttpServiceFilterFactory } filter have valid visibility of the { @link AsyncContext } .