private void helperRetryOnlyIdempotent(String method) throws IOException { final IOException error = new IOException("test exception"); HttpRequestFilter throwingFilter = new HttpRequestFilter() { @Override public HttpRequest filter(HttpRequest request) throws HttpException { throw new HttpException(error); } }; HttpCommand command = new HttpCommand(HttpRequest.builder().endpoint("http://localhost").method(method).filter(throwingFilter).build()); IOExceptionRetryHandler ioRetryHandler = EasyMock.createMock(IOExceptionRetryHandler.class); if ("GET".equals(method)) { expect(ioRetryHandler.shouldRetryRequest(command, error)).andReturn(true); expect(ioRetryHandler.shouldRetryRequest(command, error)).andReturn(false); } replay(ioRetryHandler); BaseHttpCommandExecutorService<?> service = mockHttpCommandExecutorService(ioRetryHandler); try { service.invoke(command); fail("Expected to fail due to throwing filter"); } catch (Exception e) {} verify(ioRetryHandler); }
utils.logRequest(headerLog, request, ">>"); nativeRequest = convert(request); response = invoke(nativeRequest);
utils.logRequest(headerLog, request, ">>"); nativeRequest = convert(request); response = invoke(nativeRequest);
utils.logRequest(headerLog, request, ">>"); nativeRequest = convert(request); response = invoke(nativeRequest);
utils.logRequest(headerLog, request, ">>"); nativeRequest = convert(request); response = invoke(nativeRequest);
utils.logRequest(headerLog, request, ">>"); nativeRequest = convert(request); response = invoke(nativeRequest);
utils.logRequest(headerLog, request, ">>"); nativeRequest = convert(request); response = invoke(nativeRequest);