@Test
    @SuppressWarnings("unchecked")
    public void readResourceWithDefaultRetryPolicy_DoesNotRetry_ForIoException() throws IOException {
        when(mockConnection.connectToEndpoint(eq(endpoint), any(Map.class), eq("GET"))).thenThrow(new IOException());

        try {
            new DefaultEC2ResourceFetcher(mockConnection).readResource(endpoint);
            fail("Expected an IOexception");
        } catch (Exception exception) {
            Mockito.verify(mockConnection, Mockito.times(1)).connectToEndpoint(eq(endpoint), any(Map.class), eq("GET"));
        }
    }
When readResource is called with default retry policy and IOException occurs,
the request is not retried.
aws-java-sdk-core/src/test/java/com/amazonaws/internal/EC2ResourceFetcherTest.java