use of com.couchbase.client.core.deps.io.netty.handler.codec.http.DefaultFullHttpResponse in project couchbase-jvm-clients by couchbase.
the class NonChunkedHttpMessageHandlerTest method callsMarkRequestCompletedOnceFinished.
@Test
void callsMarkRequestCompletedOnceFinished() throws Exception {
channel.pipeline().addFirst(NonChunkedHttpMessageHandler.IDENTIFIER, new TestNonChunkedHttpMessageHandler(endpoint));
channel.pipeline().fireChannelActive();
CoreHttpRequest request = CoreHttpRequest.builder(CoreCommonOptions.of(Duration.ofSeconds(1), BestEffortRetryStrategy.INSTANCE, null), endpoint.context(), HttpMethod.GET, CoreHttpPath.path("/"), RequestTarget.views("bucket")).build();
channel.writeAndFlush(request);
FullHttpRequest written = channel.readOutbound();
assertEquals("/", written.uri());
FullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
channel.writeInbound(response);
assertEquals(ResponseStatus.SUCCESS, request.response().get().status());
verify(endpoint, times(1)).markRequestCompletion();
}
Aggregations