@Test public void shouldRetry_ReturnsFalse_ForNon5xxStatusCode() { assertFalse(retryPolicy.shouldRetry(1, CredentialsEndpointRetryParameters.builder().withStatusCode(404).build())); assertFalse(retryPolicy.shouldRetry(1, CredentialsEndpointRetryParameters.builder().withStatusCode(300).build())); assertFalse(retryPolicy.shouldRetry(1, CredentialsEndpointRetryParameters.builder().withStatusCode(202).build())); }
@Override public boolean shouldRetry(int retriesAttempted, CredentialsEndpointRetryParameters retryParams) { if (retriesAttempted >= MAX_RETRIES) { return false; } Integer statusCode = retryParams.getStatusCode(); if (statusCode != null && statusCode >= 500 && statusCode < 600) { return true; } if (retryParams.getException() != null && retryParams.getException() instanceof IOException) { return true; } return false; }
ContainerCredentialsRetryPolicy implements CredentialsEndpointRetryPolicy { @Override public boolean shouldRetry(int retriesAttempted, CredentialsEndpointRetryParameters retryParams) { if (retriesAttempted >= MAX_RETRIES) { return false; } Integer statusCode = retryParams.getStatusCode(); if (statusCode != null && statusCode >= 500 && statusCode < 600) { return true; } if (retryParams.getException() != null && retryParams.getException() instanceof IOException) { return true; } return false; } }
ContainerCredentialsRetryPolicy implements CredentialsEndpointRetryPolicy { @Override public boolean shouldRetry(int retriesAttempted, CredentialsEndpointRetryParameters retryParams) { if (retriesAttempted >= MAX_RETRIES) { return false; } Integer statusCode = retryParams.getStatusCode(); if (statusCode != null && statusCode >= 500 && statusCode < 600) { return true; } if (retryParams.getException() != null && retryParams.getException() instanceof IOException) { return true; } return false; } private  ContainerCredentialsRetryPolicy(); }
ContainerCredentialsRetryPolicy implements CredentialsEndpointRetryPolicy { @Override public boolean shouldRetry(int retriesAttempted, CredentialsEndpointRetryParameters retryParams) { if (retriesAttempted >= MAX_RETRIES) { return false; } Integer statusCode = retryParams.getStatusCode(); if (statusCode != null && statusCode >= 500 && statusCode < 600) { return true; } if (retryParams.getException() != null && retryParams.getException() instanceof IOException) { return true; } return false; } private  ContainerCredentialsRetryPolicy(); static ContainerCredentialsRetryPolicy getInstance(); @Override boolean shouldRetry(int retriesAttempted, CredentialsEndpointRetryParameters retryParams); }
ContainerCredentialsRetryPolicy implements CredentialsEndpointRetryPolicy { @Override public boolean shouldRetry(int retriesAttempted, CredentialsEndpointRetryParameters retryParams) { if (retriesAttempted >= MAX_RETRIES) { return false; } Integer statusCode = retryParams.getStatusCode(); if (statusCode != null && statusCode >= 500 && statusCode < 600) { return true; } if (retryParams.getException() != null && retryParams.getException() instanceof IOException) { return true; } return false; } private  ContainerCredentialsRetryPolicy(); static ContainerCredentialsRetryPolicy getInstance(); @Override boolean shouldRetry(int retriesAttempted, CredentialsEndpointRetryParameters retryParams);  }