@Test(expected=InterruptedIOException.class) public void testExecConnectionShutDown() throws Exception { final HttpRoute route = new HttpRoute(target); final HttpClientContext context = new HttpClientContext(); final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test")); Mockito.when(requestExecutor.execute( Mockito.<HttpRequest>any(), Mockito.<HttpClientConnection>any(), Mockito.<HttpClientContext>any())).thenThrow(new ConnectionShutdownException()); mainClientExec.execute(route, request, context, execAware); }
@Test(expected=InterruptedIOException.class) public void testExecConnectionShutDown() throws Exception { final HttpRoute route = new HttpRoute(target); final HttpClientContext context = new HttpClientContext(); final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test")); Mockito.when(requestExecutor.execute( Mockito.<HttpRequest>any(), Mockito.<HttpClientConnection>any(), Mockito.<HttpClientContext>any())).thenThrow(new ConnectionShutdownException()); minimalClientExec.execute(route, request, context, execAware); }