Assert.assertEquals(MessageState.BODY_STREAM, state.getRequestState());
}
@Test
public void testEntityEnclosingRequestWithExpectContinue() throws Exception {
final State state = new HttpAsyncRequestExecutor.State();
this.connContext.setAttribute(HttpAsyncRequestExecutor.HTTP_EXCHANGE_STATE, state);
this.connContext.setAttribute(HttpAsyncRequestExecutor.HTTP_HANDLER, this.exchangeHandler);
final BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest("POST", "/");
request.setHeader(HTTP.EXPECT_DIRECTIVE, HTTP.EXPECT_CONTINUE);
Mockito.when(this.exchangeHandler.generateRequest()).thenReturn(request);
Mockito.when(this.conn.getSocketTimeout()).thenReturn(1000);
this.protocolHandler.requestReady(this.conn);
Mockito.verify(this.exchangeHandler).generateRequest();
Assert.assertSame(request, state.getRequest());
Mockito.verify(this.conn).submitRequest(request);
Mockito.verify(this.conn).setSocketTimeout(3000);
Assert.assertEquals(1000, state.getTimeout());
Mockito.verify(this.exchangeHandler, Mockito.never()).requestCompleted();
Assert.assertEquals(MessageState.ACK_EXPECTED, state.getRequestState());
}