@Test public void executeShouldThrowRequestExceptionForAnyIOException() throws Exception { Request request = mock(Request.class); IOException expected = new IOException(); mockStatic(HttpRequests.class); when(HttpRequests.toUrl(request)).thenThrow(expected); try { toTest.execute(request); fail(); }catch(RequestException e){ assertNull(e.getResponse()); assertSame(expected, e.getCause()); } }
public Response execute(Request request) throws Exception { try { return doExecute(request); }catch(IOException e){ throw new RequestException(e); } }
HttpRequestExecutor implements RequestExecutor, Disposable { public Response execute(Request request) throws Exception { try { return doExecute(request); }catch(IOException e){ throw new RequestException(e); } } }
HttpRequestExecutor implements RequestExecutor, Disposable { public Response execute(Request request) throws Exception { try { return doExecute(request); }catch(IOException e){ throw new RequestException(e); } } HttpRequestExecutor(HttpChannelFactory channelFactory, ResponseDeserializer baseResponseDeserializer, ResponseDeserializer customTypeResponseDeserializer); }
HttpRequestExecutor implements RequestExecutor, Disposable { public Response execute(Request request) throws Exception { try { return doExecute(request); }catch(IOException e){ throw new RequestException(e); } } HttpRequestExecutor(HttpChannelFactory channelFactory, ResponseDeserializer baseResponseDeserializer, ResponseDeserializer customTypeResponseDeserializer); Response execute(Request request); void dispose(); }
HttpRequestExecutor implements RequestExecutor, Disposable { public Response execute(Request request) throws Exception { try { return doExecute(request); }catch(IOException e){ throw new RequestException(e); } } HttpRequestExecutor(HttpChannelFactory channelFactory, ResponseDeserializer baseResponseDeserializer, ResponseDeserializer customTypeResponseDeserializer); Response execute(Request request); void dispose();  }