Mockito.verify(this.conn, Mockito.never()).close();
}
@Test
public void testResponseNotModified() throws Exception {
final State state = new HttpAsyncRequestExecutor.State();
final HttpRequest request = new BasicHttpRequest("Connect", "/");
state.setRequest(request);
this.connContext.setAttribute(HttpAsyncRequestExecutor.HTTP_EXCHANGE_STATE, state);
this.connContext.setAttribute(HttpAsyncRequestExecutor.HTTP_HANDLER, this.exchangeHandler);
final 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);
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();
}