Assert.assertEquals(MessageState.BODY_STREAM, httpExchange.getResponseState());
}
@Test
public void testResponseContentOutputCompleted() throws Exception {
HttpExchange httpExchange = this.protocolHandler.new HttpExchange();
HttpRequest request = new BasicHttpRequest("GET", "/");
httpExchange.setRequest(request);
BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
httpExchange.setResponse(response);
httpExchange.setHandler(this.exchangeHandler);
this.connContext.setAttribute(HttpAsyncClientProtocolHandler.HTTP_EXCHANGE, httpExchange);
Mockito.when(this.reuseStrategy.keepAlive(response, this.exchangeContext)).thenReturn(true);
Mockito.when(this.exchangeHandler.getConnectionReuseStrategy()).thenReturn(this.reuseStrategy);
Mockito.when(this.decoder.isCompleted()).thenReturn(true);
this.protocolHandler.inputReady(this.conn, this.decoder);
Assert.assertEquals(MessageState.READY, httpExchange.getRequestState());
Assert.assertEquals(MessageState.READY, httpExchange.getResponseState());
Mockito.verify(this.exchangeHandler).consumeContent(this.decoder, this.conn);
Mockito.verify(this.exchangeHandler).responseCompleted(this.exchangeContext);
Mockito.verify(this.conn, Mockito.never()).close();
}