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