@Test public void readResourceWithCustomRetryPolicy_DoesRetry_ForIoException() throws IOException { Mockito.when(mockConnection.connectToEndpoint(eq(endpoint), any(Map.class), eq("GET"))).thenThrow(new IOException()); try { new DefaultEC2ResourceFetcher(mockConnection).readResource(endpoint, customRetryPolicy); fail("Expected an IOexception"); } catch (Exception exception) { Mockito.verify(mockConnection, Mockito.times(CustomRetryPolicy.MAX_RETRIES + 1)).connectToEndpoint(eq(endpoint), any(Map.class), eq("GET")); } }
public abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers);
EC2ResourceFetcher { public abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); }
EC2ResourceFetcher { public abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); EC2ResourceFetcher(); @SdkTestInternalApi  EC2ResourceFetcher(ConnectionUtils connectionUtils); }
EC2ResourceFetcher { public abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); EC2ResourceFetcher(); @SdkTestInternalApi  EC2ResourceFetcher(ConnectionUtils connectionUtils); static EC2ResourceFetcher defaultResourceFetcher(); abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); final String readResource(URI endpoint); final String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy); }
EC2ResourceFetcher { public abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); EC2ResourceFetcher(); @SdkTestInternalApi  EC2ResourceFetcher(ConnectionUtils connectionUtils); static EC2ResourceFetcher defaultResourceFetcher(); abstract String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy, Map<String, String> headers); final String readResource(URI endpoint); final String readResource(URI endpoint, CredentialsEndpointRetryPolicy retryPolicy);  }