Mockito.verify(this.conn, Mockito.never()).close();
}
@Test
public void testResponseNotModified() throws Exception {
final State state = new State();
final HttpContext exchangeContext = new BasicHttpContext();
final HttpRequest request = new BasicHttpRequest("HEAD", "/", HttpVersion.HTTP_1_1);
final Incoming incoming = new Incoming(
request, this.requestHandler, this.requestConsumer, exchangeContext);
state.setIncoming(incoming);
state.setRequestState(MessageState.COMPLETED);
final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1,
HttpStatus.SC_NOT_MODIFIED, "Not modified");
final Outgoing outgoing = new Outgoing(
request, response, this.responseProducer, exchangeContext);
state.setOutgoing(outgoing);
state.setResponseState(MessageState.INIT);
this.connContext.setAttribute(HttpAsyncService.HTTP_EXCHANGE_STATE, state);
response.setEntity(new NStringEntity("stuff"));
Mockito.when(this.responseProducer.generateResponse()).thenReturn(response);
Mockito.when(this.reuseStrategy.keepAlive(response, exchangeContext)).thenReturn(Boolean.TRUE);
this.protocolHandler.responseReady(this.conn);
Assert.assertEquals(MessageState.READY, state.getResponseState());
Mockito.verify(this.httpProcessor).process(response, exchangeContext);
Mockito.verify(this.conn).submitResponse(response);
Mockito.verify(this.responseProducer).responseCompleted(exchangeContext);
Mockito.verify(this.conn).requestInput();