public class EC2CredentialsUtilsTest extends Object
Modifier and Type | Field and Description |
---|---|
static WireMockRule |
mockServer |
Constructor and Description |
---|
EC2CredentialsUtilsTest() |
Modifier and Type | Method and Description |
---|---|
void |
readResouceNonJsonErrorBody()
When server returns a status code other than 200 and 404
and error body message is not in Json format,
the test throws AmazonServiceException.
|
void |
readResouceReturnsAceFor404ErrorResponse()
When server returns with 404 status code,
the test should throw AmazonClientException.
|
void |
readResouceReturnsAseFor5xxResponse()
When server returns a status code other than 200 and 404,
the test should throw AmazonServiceException.
|
void |
readResouceReturnsResponseBodyFor200Response()
When server returns with status code 200,
the test successfully returns the body from the response.
|
void |
readResouceWithCustomRetryPolicy_DoesNotRetry_ForNonIoException()
When readResource is called with custom retry policy
and the exception is not an IOException,
then the request is not retried.
|
void |
readResouceWithCustomRetryPolicy_DoesRetry_ForIoException()
When readResource is called with custom retry policy and IOException occurs,
the request is retried and the number of retries is equal to the value
returned by getMaxRetries method of the custom retry policy.
|
void |
readResouceWithDefaultRetryPolicy_DoesNotRetry_ForIoException()
When readResource is called with default retry policy and IOException occurs,
the request is not retried.
|
void |
readResourceThrowsIOExceptionWhenNoConnection()
When a connection to end host cannot be opened, throws
IOException . |
static void |
setup() |
public static void setup() throws URISyntaxException
URISyntaxException
public void readResourceThrowsIOExceptionWhenNoConnection() throws IOException, URISyntaxException
IOException
.IOException
URISyntaxException
public void readResouceReturnsResponseBodyFor200Response() throws IOException
IOException
public void readResouceReturnsAceFor404ErrorResponse() throws Exception
Exception
public void readResouceReturnsAseFor5xxResponse() throws IOException
IOException
public void readResouceNonJsonErrorBody() throws IOException
IOException
public void readResouceWithDefaultRetryPolicy_DoesNotRetry_ForIoException() throws IOException
IOException
public void readResouceWithCustomRetryPolicy_DoesRetry_ForIoException() throws IOException
IOException
public void readResouceWithCustomRetryPolicy_DoesNotRetry_ForNonIoException() throws IOException
IOException
Copyright © 2018. All rights reserved.