@Test public void testResetRequestAfterErrorWithNullContent() { final Request<?> testRequest = new DefaultRequest<String>("test"); testRequest.setContent(null); Exception cause = new Exception(); // Should be no-op client.resetRequestAfterError(testRequest, cause); }
@Test(expected = AmazonClientException.class) public void testResetRequestAfterErrorWithNonRepeatableContent() { final Request<?> testRequest = new DefaultRequest<String>("test"); testRequest.setContent(new InputStream() { @Override public boolean markSupported() { return false; } @Override public int read() throws IOException { return 0; } }); Exception cause = new Exception(); // Should be no-op client.resetRequestAfterError(testRequest, cause); }
@Test(expected = AmazonClientException.class) public void testResetRequestAfterErrorWithNonResetableContent() { final Request<?> testRequest = new DefaultRequest<String>("test"); testRequest.setContent(new InputStream() { @Override public void reset() { throw new RuntimeException("CannotReset"); } @Override public int read() throws IOException { return 0; } }); Exception cause = new Exception(); // Should be no-op client.resetRequestAfterError(testRequest, cause); }
SDKGlobalConfiguration.setGlobalTimeOffset(timeOffset); resetRequestAfterError(request, ase); resetRequestAfterError(request, ioe); } catch (final RuntimeException e) { throw handleUnexpectedFailure(e, awsRequestMetrics);
SDKGlobalConfiguration.setGlobalTimeOffset(timeOffset); resetRequestAfterError(request, ase); resetRequestAfterError(request, ioe); } catch (final RuntimeException e) { throw handleUnexpectedFailure(e, awsRequestMetrics);
SDKGlobalConfiguration.setGlobalTimeOffset(timeOffset); resetRequestAfterError(request, ase); resetRequestAfterError(request, ioe); } catch (final RuntimeException e) { throw handleUnexpectedFailure(e, awsRequestMetrics);