Search in sources :

Example 26 with HttpRequest

use of io.servicetalk.http.api.HttpRequest in project servicetalk by apple.

the class H2PriorKnowledgeFeatureParityTest method clientReserveConnectionMultipleRequests.

@ParameterizedTest(name = "{displayName} [{index}] client={0}, h2PriorKnowledge={1}")
@MethodSource("clientExecutors")
void clientReserveConnectionMultipleRequests(HttpTestExecutionStrategy strategy, boolean h2PriorKnowledge) throws Exception {
    setUp(strategy, h2PriorKnowledge);
    String responseBody1 = "1.hello world.1";
    String responseBody2 = "2.hello world.2";
    InetSocketAddress serverAddress = bindHttpEchoServer();
    try (BlockingHttpClient client = forSingleAddress(HostAndPort.of(serverAddress)).protocols(h2PriorKnowledge ? h2Default() : h1Default()).executionStrategy(clientExecutionStrategy).buildBlocking()) {
        HttpRequest request = client.get("/");
        ReservedBlockingHttpConnection reservedConnection = client.reserveConnection(request);
        try {
            // We interleave the requests intentionally to make sure the internal transport sequences the
            // reads and writes correctly.
            HttpResponse response1 = client.request(request.payloadBody(responseBody1, textSerializerUtf8()));
            HttpResponse response2 = client.request(request.payloadBody(responseBody2, textSerializerUtf8()));
            assertEquals(responseBody1, response1.payloadBody(textSerializerUtf8()));
            assertEquals(responseBody2, response2.payloadBody(textSerializerUtf8()));
        } finally {
            reservedConnection.release();
        }
    }
}
Also used : HttpRequest(io.servicetalk.http.api.HttpRequest) StreamingHttpRequest(io.servicetalk.http.api.StreamingHttpRequest) BlockingHttpClient(io.servicetalk.http.api.BlockingHttpClient) InetSocketAddress(java.net.InetSocketAddress) HttpResponse(io.servicetalk.http.api.HttpResponse) StreamingHttpResponse(io.servicetalk.http.api.StreamingHttpResponse) Matchers.emptyString(org.hamcrest.Matchers.emptyString) ReservedBlockingHttpConnection(io.servicetalk.http.api.ReservedBlockingHttpConnection) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 27 with HttpRequest

use of io.servicetalk.http.api.HttpRequest in project servicetalk by apple.

the class H2PriorKnowledgeFeatureParityTest method cookiesRoundTrip.

@ParameterizedTest(name = "{displayName} [{index}] client={0}, h2PriorKnowledge={1}")
@MethodSource("clientExecutors")
void cookiesRoundTrip(HttpTestExecutionStrategy strategy, boolean h2PriorKnowledge) throws Exception {
    setUp(strategy, h2PriorKnowledge);
    InetSocketAddress serverAddress = bindHttpEchoServer();
    try (BlockingHttpClient client = forSingleAddress(HostAndPort.of(serverAddress)).protocols(h2PriorKnowledge ? h2Default() : h1Default()).executionStrategy(clientExecutionStrategy).buildBlocking()) {
        HttpRequest request = client.get("/");
        String requestCookie = "name1=value1; name2=value2; name3=value3";
        request.addHeader(COOKIE, requestCookie);
        HttpResponse response = client.request(request);
        CharSequence responseCookie = response.headers().get(COOKIE);
        assertNotNull(responseCookie);
        HttpCookiePair cookie = response.headers().getCookie("name1");
        assertNotNull(cookie);
        assertEquals("value1", cookie.value());
        cookie = response.headers().getCookie("name2");
        assertNotNull(cookie);
        assertEquals("value2", cookie.value());
        cookie = response.headers().getCookie("name3");
        assertNotNull(cookie);
        assertEquals("value3", cookie.value());
    }
}
Also used : HttpRequest(io.servicetalk.http.api.HttpRequest) StreamingHttpRequest(io.servicetalk.http.api.StreamingHttpRequest) BlockingHttpClient(io.servicetalk.http.api.BlockingHttpClient) InetSocketAddress(java.net.InetSocketAddress) HttpCookiePair(io.servicetalk.http.api.HttpCookiePair) DefaultHttpCookiePair(io.servicetalk.http.api.DefaultHttpCookiePair) HttpResponse(io.servicetalk.http.api.HttpResponse) StreamingHttpResponse(io.servicetalk.http.api.StreamingHttpResponse) Matchers.emptyString(org.hamcrest.Matchers.emptyString) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 28 with HttpRequest

use of io.servicetalk.http.api.HttpRequest in project servicetalk by apple.

the class H2PriorKnowledgeFeatureParityTest method serverSendsInvalidContentLength.

private void serverSendsInvalidContentLength(boolean addTrailers, BiConsumer<HttpHeaders, Integer> headersModifier) throws Exception {
    assumeFalse(!h2PriorKnowledge && addTrailers, "HTTP/1.1 does not support Content-Length with trailers");
    InetSocketAddress serverAddress = bindHttpEchoServer(service -> new StreamingHttpServiceFilter(service) {

        @Override
        public Single<StreamingHttpResponse> handle(final HttpServiceContext ctx, final StreamingHttpRequest request, final StreamingHttpResponseFactory responseFactory) {
            return delegate().handle(ctx, request, responseFactory).flatMap(resp -> resp.transformMessageBody(// honored during "streaming -> aggregated -> streaming" conversion.
            pub -> addTrailers ? pub : pub.filter(i -> i instanceof Buffer)).toResponse().map(aggResp -> {
                aggResp.headers().remove(TRANSFER_ENCODING);
                headersModifier.accept(aggResp.headers(), aggResp.payloadBody().readableBytes());
                return aggResp.toStreamingResponse();
            }));
        }
    }, null);
    try (BlockingHttpClient client = forSingleAddress(HostAndPort.of(serverAddress)).protocols(h2PriorKnowledge ? h2Default() : h1Default()).executionStrategy(clientExecutionStrategy).buildBlocking()) {
        HttpRequest request = client.get("/").payloadBody("a", textSerializerUtf8());
        if (addTrailers) {
            request.trailers().set("mytrailer", "myvalue");
        }
        if (h2PriorKnowledge) {
            assertThrows(Http2Exception.class, () -> client.request(request));
        } else {
            try (ReservedBlockingHttpConnection reservedConn = client.reserveConnection(request)) {
                assertThrows(IOException.class, () -> {
                    // Either the current request or the next one should fail
                    reservedConn.request(request);
                    reservedConn.request(client.get("/"));
                });
            }
        }
    }
}
Also used : TestUtils.assertNoAsyncErrors(io.servicetalk.test.resources.TestUtils.assertNoAsyncErrors) UnaryOperator.identity(java.util.function.UnaryOperator.identity) ChannelInboundHandlerAdapter(io.netty.channel.ChannelInboundHandlerAdapter) SingleSource(io.servicetalk.concurrent.SingleSource) StreamingHttpServiceFilterFactory(io.servicetalk.http.api.StreamingHttpServiceFilterFactory) UnaryOperator(java.util.function.UnaryOperator) LogLevel(io.servicetalk.logging.api.LogLevel) DefaultHttp2DataFrame(io.netty.handler.codec.http2.DefaultHttp2DataFrame) Disabled(org.junit.jupiter.api.Disabled) Matchers.hasItems(org.hamcrest.Matchers.hasItems) SourceAdapters.fromSource(io.servicetalk.concurrent.api.SourceAdapters.fromSource) H2StreamResetException(io.servicetalk.http.netty.NettyHttp2ExceptionUtils.H2StreamResetException) AsyncContext(io.servicetalk.concurrent.api.AsyncContext) HttpRequest(io.servicetalk.http.api.HttpRequest) Assumptions.assumeFalse(org.junit.jupiter.api.Assumptions.assumeFalse) Matchers.nullValue(org.hamcrest.Matchers.nullValue) PROTOCOL_ERROR(io.netty.handler.codec.http2.Http2Error.PROTOCOL_ERROR) HttpCookiePair(io.servicetalk.http.api.HttpCookiePair) DefaultHttp2ResetFrame(io.netty.handler.codec.http2.DefaultHttp2ResetFrame) EXPECT(io.servicetalk.http.api.HttpHeaderNames.EXPECT) BlockingHttpClient(io.servicetalk.http.api.BlockingHttpClient) PrintWriter(java.io.PrintWriter) Matchers.notNullValue(org.hamcrest.Matchers.notNullValue) DefaultHttp2SettingsFrame(io.netty.handler.codec.http2.DefaultHttp2SettingsFrame) HttpClients.forSingleAddress(io.servicetalk.http.netty.HttpClients.forSingleAddress) HttpResponse(io.servicetalk.http.api.HttpResponse) Http2SettingsAckFrame(io.netty.handler.codec.http2.Http2SettingsAckFrame) TRANSFER_ENCODING(io.servicetalk.http.api.HttpHeaderNames.TRANSFER_ENCODING) POST(io.servicetalk.http.api.HttpRequestMethod.POST) BlockingQueue(java.util.concurrent.BlockingQueue) ChannelPipeline(io.netty.channel.ChannelPipeline) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) StatelessTrailersTransformer(io.servicetalk.http.api.StatelessTrailersTransformer) StreamingHttpClientFilter(io.servicetalk.http.api.StreamingHttpClientFilter) StreamingHttpConnectionFilter(io.servicetalk.http.api.StreamingHttpConnectionFilter) Arguments(org.junit.jupiter.params.provider.Arguments) Assertions.assertNotSame(org.junit.jupiter.api.Assertions.assertNotSame) Http2HeadersFrame(io.netty.handler.codec.http2.Http2HeadersFrame) UPGRADE(io.servicetalk.http.api.HttpHeaderNames.UPGRADE) CountDownLatch(java.util.concurrent.CountDownLatch) HttpSetCookie(io.servicetalk.http.api.HttpSetCookie) Buffer(io.servicetalk.buffer.api.Buffer) Stream(java.util.stream.Stream) Http2Headers(io.netty.handler.codec.http2.Http2Headers) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) COOKIE(io.servicetalk.http.api.HttpHeaderNames.COOKIE) Matchers.is(org.hamcrest.Matchers.is) CONTENT_TYPE(io.netty.handler.codec.http.HttpHeaderNames.CONTENT_TYPE) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) Processor(io.servicetalk.concurrent.PublisherSource.Processor) BuilderUtils.serverChannel(io.servicetalk.transport.netty.internal.BuilderUtils.serverChannel) TRAILER(io.netty.handler.codec.http.HttpHeaderNames.TRAILER) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) HttpHeaders(io.servicetalk.http.api.HttpHeaders) ConsumableEvent(io.servicetalk.client.api.ConsumableEvent) StreamingHttpRequester(io.servicetalk.http.api.StreamingHttpRequester) FilterableStreamingHttpConnection(io.servicetalk.http.api.FilterableStreamingHttpConnection) ArrayList(java.util.ArrayList) EMPTY_BUFFER(io.servicetalk.buffer.api.EmptyBuffer.EMPTY_BUFFER) MAX_CONCURRENCY(io.servicetalk.http.api.HttpEventKey.MAX_CONCURRENCY) HeaderUtils.isTransferEncodingChunked(io.servicetalk.http.api.HeaderUtils.isTransferEncodingChunked) HttpServiceContext(io.servicetalk.http.api.HttpServiceContext) Single.succeeded(io.servicetalk.concurrent.api.Single.succeeded) Processors(io.servicetalk.concurrent.api.Processors) BiConsumer(java.util.function.BiConsumer) Assumptions.assumeTrue(org.junit.jupiter.api.Assumptions.assumeTrue) StreamingHttpRequest(io.servicetalk.http.api.StreamingHttpRequest) AddressUtils.serverHostAndPort(io.servicetalk.transport.netty.internal.AddressUtils.serverHostAndPort) Matchers.contentEqualTo(io.servicetalk.buffer.api.Matchers.contentEqualTo) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Nullable(javax.annotation.Nullable) CHUNKED(io.servicetalk.http.api.HttpHeaderValues.CHUNKED) SMALLEST_MAX_CONCURRENT_STREAMS(io.netty.handler.codec.http2.Http2CodecUtil.SMALLEST_MAX_CONCURRENT_STREAMS) DEFAULT(io.servicetalk.http.netty.HttpTestExecutionStrategy.DEFAULT) Single(io.servicetalk.concurrent.api.Single) StringWriter(java.io.StringWriter) Completable(io.servicetalk.concurrent.api.Completable) DefaultHttp2HeadersFrame(io.netty.handler.codec.http2.DefaultHttp2HeadersFrame) IOException(java.io.IOException) ReservedBlockingHttpConnection(io.servicetalk.http.api.ReservedBlockingHttpConnection) OK(io.servicetalk.http.api.HttpResponseStatus.OK) GET(io.servicetalk.http.api.HttpRequestMethod.GET) Channel(io.netty.channel.Channel) Http2Settings(io.netty.handler.codec.http2.Http2Settings) AfterEach(org.junit.jupiter.api.AfterEach) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) String.valueOf(java.lang.String.valueOf) Completable.completed(io.servicetalk.concurrent.api.Completable.completed) Http2MultiplexHandler(io.netty.handler.codec.http2.Http2MultiplexHandler) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) HttpResponseStatus(io.servicetalk.http.api.HttpResponseStatus) HostAndPort(io.servicetalk.transport.api.HostAndPort) HttpRequestMethod(io.servicetalk.http.api.HttpRequestMethod) Matchers.emptyString(org.hamcrest.Matchers.emptyString) Http2FrameCodecBuilder(io.netty.handler.codec.http2.Http2FrameCodecBuilder) Key.newKey(io.servicetalk.context.api.ContextMap.Key.newKey) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) StreamingHttpClient(io.servicetalk.http.api.StreamingHttpClient) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Http2DataFrame(io.netty.handler.codec.http2.Http2DataFrame) CONNECTION(io.servicetalk.http.api.HttpHeaderNames.CONNECTION) MethodSource(org.junit.jupiter.params.provider.MethodSource) ChannelDuplexHandler(io.netty.channel.ChannelDuplexHandler) ChannelInitializer(io.netty.channel.ChannelInitializer) PublisherSource(io.servicetalk.concurrent.PublisherSource) CONTENT_LENGTH(io.servicetalk.http.api.HttpHeaderNames.CONTENT_LENGTH) InetSocketAddress(java.net.InetSocketAddress) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) HttpEventKey(io.servicetalk.http.api.HttpEventKey) Test(org.junit.jupiter.api.Test) List(java.util.List) ContextMap(io.servicetalk.context.api.ContextMap) DelegatingConnectionAcceptor(io.servicetalk.transport.api.DelegatingConnectionAcceptor) Matchers.equalTo(org.hamcrest.Matchers.equalTo) Writer(java.io.Writer) Queue(java.util.Queue) CONTINUE(io.servicetalk.http.api.HttpHeaderValues.CONTINUE) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) StreamingHttpResponse(io.servicetalk.http.api.StreamingHttpResponse) Publisher(io.servicetalk.concurrent.api.Publisher) Http2Exception(io.servicetalk.http.api.Http2Exception) AtomicReference(java.util.concurrent.atomic.AtomicReference) StreamingHttpServiceFilter(io.servicetalk.http.api.StreamingHttpServiceFilter) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) HttpMetaData(io.servicetalk.http.api.HttpMetaData) HttpProtocolConfigs.h1Default(io.servicetalk.http.netty.HttpProtocolConfigs.h1Default) HttpProtocolConfigs.h2Default(io.servicetalk.http.netty.HttpProtocolConfigs.h2Default) HttpSerializers.textSerializerUtf8(io.servicetalk.http.api.HttpSerializers.textSerializerUtf8) HttpExecutionStrategy(io.servicetalk.http.api.HttpExecutionStrategy) NettyConnectionContext(io.servicetalk.transport.netty.internal.NettyConnectionContext) DELIBERATE_EXCEPTION(io.servicetalk.concurrent.internal.DeliberateException.DELIBERATE_EXCEPTION) HttpServerBuilder(io.servicetalk.http.api.HttpServerBuilder) ConnectionContext(io.servicetalk.transport.api.ConnectionContext) KEEP_ALIVE(io.servicetalk.http.api.HttpHeaderValues.KEEP_ALIVE) INTERNAL_SERVER_ERROR(io.servicetalk.http.api.HttpResponseStatus.INTERNAL_SERVER_ERROR) AddressUtils.localAddress(io.servicetalk.transport.netty.internal.AddressUtils.localAddress) EventLoopGroup(io.netty.channel.EventLoopGroup) ServerContext(io.servicetalk.transport.api.ServerContext) Iterator(java.util.Iterator) EXPECTATION_FAILED(io.servicetalk.http.api.HttpResponseStatus.EXPECTATION_FAILED) NettyIoExecutors.createIoExecutor(io.servicetalk.transport.netty.internal.NettyIoExecutors.createIoExecutor) UTF_8(java.nio.charset.StandardCharsets.UTF_8) Processors.newPublisherProcessor(io.servicetalk.concurrent.api.Processors.newPublisherProcessor) Consumer(java.util.function.Consumer) Matchers.emptyIterable(org.hamcrest.Matchers.emptyIterable) PROXY_CONNECTION(io.servicetalk.http.netty.H2ToStH1Utils.PROXY_CONNECTION) StreamingHttpResponseFactory(io.servicetalk.http.api.StreamingHttpResponseFactory) NO_OFFLOAD(io.servicetalk.http.netty.HttpTestExecutionStrategy.NO_OFFLOAD) ServerBootstrap(io.netty.bootstrap.ServerBootstrap) ChannelHandler(io.netty.channel.ChannelHandler) SET_COOKIE(io.servicetalk.http.api.HttpHeaderNames.SET_COOKIE) DefaultHttpCookiePair(io.servicetalk.http.api.DefaultHttpCookiePair) DefaultHttp2Headers(io.netty.handler.codec.http2.DefaultHttp2Headers) Buffer(io.servicetalk.buffer.api.Buffer) HttpRequest(io.servicetalk.http.api.HttpRequest) StreamingHttpRequest(io.servicetalk.http.api.StreamingHttpRequest) StreamingHttpServiceFilter(io.servicetalk.http.api.StreamingHttpServiceFilter) Single(io.servicetalk.concurrent.api.Single) BlockingHttpClient(io.servicetalk.http.api.BlockingHttpClient) InetSocketAddress(java.net.InetSocketAddress) HttpServiceContext(io.servicetalk.http.api.HttpServiceContext) StreamingHttpResponseFactory(io.servicetalk.http.api.StreamingHttpResponseFactory) StreamingHttpRequest(io.servicetalk.http.api.StreamingHttpRequest) ReservedBlockingHttpConnection(io.servicetalk.http.api.ReservedBlockingHttpConnection)

Example 29 with HttpRequest

use of io.servicetalk.http.api.HttpRequest in project servicetalk by apple.

the class H2PriorKnowledgeFeatureParityTest method clientHeaderCookieRemovalAndIteration.

@ParameterizedTest(name = "{displayName} [{index}] client={0}, h2PriorKnowledge={1}")
@MethodSource("clientExecutors")
void clientHeaderCookieRemovalAndIteration(HttpTestExecutionStrategy strategy, boolean h2PriorKnowledge) throws Exception {
    setUp(strategy, h2PriorKnowledge);
    InetSocketAddress serverAddress = bindHttpEchoServer();
    try (BlockingHttpClient client = forSingleAddress(HostAndPort.of(serverAddress)).protocols(h2PriorKnowledge ? h2Default() : h1Default()).executionStrategy(clientExecutionStrategy).buildBlocking()) {
        HttpRequest request = client.get("/");
        headerCookieRemovalAndIteration(request.headers());
    }
}
Also used : HttpRequest(io.servicetalk.http.api.HttpRequest) StreamingHttpRequest(io.servicetalk.http.api.StreamingHttpRequest) BlockingHttpClient(io.servicetalk.http.api.BlockingHttpClient) InetSocketAddress(java.net.InetSocketAddress) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 30 with HttpRequest

use of io.servicetalk.http.api.HttpRequest in project servicetalk by apple.

the class H2PriorKnowledgeFeatureParityTest method trailersWithContentLength.

@ParameterizedTest(name = "{displayName} [{index}] client={0}, h2PriorKnowledge={1}")
@MethodSource("clientExecutors")
void trailersWithContentLength(HttpTestExecutionStrategy strategy, boolean h2PriorKnowledge) throws Exception {
    setUp(strategy, h2PriorKnowledge);
    final String expectedPayload = "Hello World!";
    final String expectedPayloadLength = valueOf(expectedPayload.length());
    final String expectedTrailer = "foo";
    final String expectedTrailerValue = "bar";
    final AtomicReference<HttpRequest> requestReceived = new AtomicReference<>();
    try (ServerContext serverContext = HttpServers.forAddress(localAddress(0)).protocols(h2PriorKnowledge ? h2Default() : h1Default()).listenBlockingAndAwait((ctx, request, responseFactory) -> {
        requestReceived.set(request);
        return responseFactory.ok().addTrailer(expectedTrailer, expectedTrailerValue).addHeader(CONTENT_LENGTH, expectedPayloadLength).payloadBody(expectedPayload, textSerializerUtf8());
    });
        BlockingHttpClient client = forSingleAddress(HostAndPort.of((InetSocketAddress) serverContext.listenAddress())).protocols(h2PriorKnowledge ? h2Default() : h1Default()).executionStrategy(clientExecutionStrategy).buildBlocking()) {
        HttpResponse response = client.request(client.post("/").addTrailer(expectedTrailer, expectedTrailerValue).addHeader(CONTENT_LENGTH, expectedPayloadLength).payloadBody(expectedPayload, textSerializerUtf8()));
        assertThat(response.status(), is(OK));
        assertThat(response.payloadBody(textSerializerUtf8()), equalTo(expectedPayload));
        assertHeaders(h2PriorKnowledge, response.headers(), expectedPayloadLength);
        assertTrailers(response.trailers(), expectedTrailer, expectedTrailerValue);
        // Verify what server received:
        HttpRequest request = requestReceived.get();
        assertThat(request.payloadBody(textSerializerUtf8()), equalTo(expectedPayload));
        assertHeaders(h2PriorKnowledge, request.headers(), expectedPayloadLength);
        assertTrailers(request.trailers(), expectedTrailer, expectedTrailerValue);
    }
}
Also used : HttpRequest(io.servicetalk.http.api.HttpRequest) StreamingHttpRequest(io.servicetalk.http.api.StreamingHttpRequest) ServerContext(io.servicetalk.transport.api.ServerContext) BlockingHttpClient(io.servicetalk.http.api.BlockingHttpClient) HttpResponse(io.servicetalk.http.api.HttpResponse) StreamingHttpResponse(io.servicetalk.http.api.StreamingHttpResponse) AtomicReference(java.util.concurrent.atomic.AtomicReference) Matchers.emptyString(org.hamcrest.Matchers.emptyString) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

HttpRequest (io.servicetalk.http.api.HttpRequest)42 HttpResponse (io.servicetalk.http.api.HttpResponse)28 StreamingHttpRequest (io.servicetalk.http.api.StreamingHttpRequest)26 BlockingHttpClient (io.servicetalk.http.api.BlockingHttpClient)22 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)20 Test (org.junit.jupiter.api.Test)19 HttpClient (io.servicetalk.http.api.HttpClient)17 MethodSource (org.junit.jupiter.params.provider.MethodSource)16 ServerContext (io.servicetalk.transport.api.ServerContext)15 StreamingHttpResponse (io.servicetalk.http.api.StreamingHttpResponse)14 Single.succeeded (io.servicetalk.concurrent.api.Single.succeeded)11 HostAndPort (io.servicetalk.transport.api.HostAndPort)10 InetSocketAddress (java.net.InetSocketAddress)10 MatcherAssert.assertThat (org.hamcrest.MatcherAssert.assertThat)10 OK (io.servicetalk.http.api.HttpResponseStatus.OK)9 StreamingHttpClient (io.servicetalk.http.api.StreamingHttpClient)9 Buffer (io.servicetalk.buffer.api.Buffer)8 Nullable (javax.annotation.Nullable)8 Matchers.emptyString (org.hamcrest.Matchers.emptyString)8 ReservedBlockingHttpConnection (io.servicetalk.http.api.ReservedBlockingHttpConnection)5