Mockito.verify(this.conn, Mockito.never()).close();
}
@Test
public void testResponseContentCompletedNoKeepAlive() throws Exception {
State state = new HttpAsyncService.State();
HttpContext exchangeContext = state.getContext();
BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
response.setEntity(new NStringEntity("stuff"));
state.setRequestState(MessageState.COMPLETED);
state.setResponseState(MessageState.BODY_STREAM);
state.setResponse(response);
state.setResponseProducer(this.responseProducer);
this.connContext.setAttribute(HttpAsyncService.HTTP_EXCHANGE_STATE, state);
Mockito.when(this.encoder.isCompleted()).thenReturn(true);
Mockito.when(this.reuseStrategy.keepAlive(response, exchangeContext)).thenReturn(false);
this.protocolHandler.outputReady(conn, this.encoder);
Assert.assertEquals(MessageState.READY, state.getRequestState());
Assert.assertEquals(MessageState.READY, state.getResponseState());
Mockito.verify(this.responseProducer).produceContent(this.encoder, this.conn);
Mockito.verify(this.responseProducer).responseCompleted(exchangeContext);
Mockito.verify(this.conn, Mockito.never()).requestInput();
Mockito.verify(this.conn).close();