public class EC2ResourceFetcherTest extends Object
Modifier and Type | Field and Description |
---|---|
static WireMockRule |
mockServer |
Constructor and Description |
---|
EC2ResourceFetcherTest() |
Modifier and Type | Method and Description |
---|---|
void |
readResource_2xx_inputStreamClosed() |
void |
readResource_4xx_inputStreamClosed() |
void |
readResource_AddsSDKUserAgent()
When readResource is called,
the SDK User-Agent should be added.
|
void |
readResourceNonJsonErrorBody()
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 |
readResourceReturnsAceFor404ErrorResponse()
When server returns with 404 status code,
the test should throw AmazonClientException.
|
void |
readResourceReturnsAseFor5xxResponse()
When server returns a status code other than 200 and 404,
the test should throw AmazonServiceException.
|
void |
readResourceReturnsResponseBodyFor200Response()
When server returns with status code 200,
the test successfully returns the body from the response.
|
void |
readResourceThrowsIOExceptionWhenNoConnection()
When a connection to end host cannot be opened, throws
IOException . |
void |
readResourceWithCustomRetryPolicy_AddsSDKUserAgent()
When readResource is called with custom retry policy,
the SDK User-Agent should be added.
|
void |
readResourceWithCustomRetryPolicy_DoesNotRetry_ForNonIoException()
When readResource is called with custom retry policy
and the exception is not an IOException,
then the request is not retried.
|
void |
readResourceWithCustomRetryPolicy_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 |
readResourceWithCustomRetryPolicyAndHeaders_AddsSDKUserAgent()
When readResource is called with custom retry policy
and additional headers, the SDK User-Agent should be
added.
|
void |
readResourceWithDefaultRetryPolicy_DoesNotRetry_ForIoException()
When readResource is called with default retry policy and IOException occurs,
the request is not retried.
|
static void |
setup() |
public static void setup() throws URISyntaxException
URISyntaxException
public void readResourceThrowsIOExceptionWhenNoConnection() throws IOException, URISyntaxException
IOException
.IOException
URISyntaxException
public void readResourceReturnsResponseBodyFor200Response() throws IOException
IOException
public void readResourceReturnsAceFor404ErrorResponse() throws Exception
Exception
public void readResourceReturnsAseFor5xxResponse() throws IOException
IOException
public void readResourceNonJsonErrorBody() throws IOException
IOException
public void readResourceWithDefaultRetryPolicy_DoesNotRetry_ForIoException() throws IOException
IOException
public void readResourceWithCustomRetryPolicy_DoesRetry_ForIoException() throws IOException
IOException
public void readResourceWithCustomRetryPolicy_DoesNotRetry_ForNonIoException() throws IOException
IOException
public void readResource_AddsSDKUserAgent() throws IOException
IOException
public void readResourceWithCustomRetryPolicy_AddsSDKUserAgent() throws IOException
IOException
public void readResourceWithCustomRetryPolicyAndHeaders_AddsSDKUserAgent() throws IOException
IOException
public void readResource_2xx_inputStreamClosed() throws IOException
IOException
public void readResource_4xx_inputStreamClosed() throws IOException
IOException
Copyright © 2024. All rights reserved.