Mockito.verify(this.conn, Mockito.never()).close();
}
@Test
public void testResponseNotModified() throws Exception {
State state = new HttpAsyncRequestExecutor.State();
HttpRequest request = new BasicHttpRequest("Connect", "/");
state.setRequest(request);
this.connContext.setAttribute(HttpAsyncRequestExecutor.HTTP_EXCHANGE_STATE, state);
this.connContext.setAttribute(HttpAsyncRequestExecutor.HTTP_HANDLER, this.exchangeHandler);
BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1,
HttpStatus.SC_NOT_MODIFIED, "Not modified");
response.setEntity(new BasicHttpEntity());
Mockito.when(this.conn.getHttpResponse()).thenReturn(response);
Mockito.when(this.reuseStrategy.keepAlive(response, this.exchangeContext)).thenReturn(true);
this.protocolHandler.responseReceived(this.conn);
Assert.assertEquals(MessageState.READY, state.getResponseState());
Assert.assertEquals(MessageState.READY, state.getRequestState());
Assert.assertNull(state.getRequest());
Assert.assertNull(state.getResponse());
Assert.assertNull(response.getEntity());
Mockito.verify(this.exchangeHandler).responseReceived(response);
Mockito.verify(this.conn).resetInput();
Mockito.verify(this.conn, Mockito.never()).close();
}