@Test
    @SuppressWarnings("unchecked")
    public void readResourceWithCustomRetryPolicy_DoesNotRetry_ForNonIoException() throws IOException {
        generateStub(500, "Non Json error body");

        try {
            ec2ResourceFetcher.readResource(endpoint, customRetryPolicy, new HashMap<String, String>());
            fail("Expected an AmazonServiceException");
        } catch (AmazonServiceException ase) {
            assertEquals(500, ase.getStatusCode());
        }
    }
When readResource is called with custom retry policy
and the exception is not an IOException,
then the request is not retried.
aws-java-sdk-core/src/test/java/com/amazonaws/internal/EC2ResourceFetcherTest.java