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_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
URISyntaxExceptionpublic void readResourceThrowsIOExceptionWhenNoConnection()
                                                   throws IOException,
                                                          URISyntaxException
IOException.IOExceptionURISyntaxExceptionpublic void readResourceReturnsResponseBodyFor200Response()
                                                   throws IOException
IOExceptionpublic void readResourceReturnsAceFor404ErrorResponse()
                                               throws Exception
Exceptionpublic void readResourceReturnsAseFor5xxResponse()
                                          throws IOException
IOExceptionpublic void readResourceNonJsonErrorBody()
                                  throws IOException
IOExceptionpublic void readResourceWithDefaultRetryPolicy_DoesNotRetry_ForIoException()
                                                                    throws IOException
IOExceptionpublic void readResourceWithCustomRetryPolicy_DoesRetry_ForIoException()
                                                                throws IOException
IOExceptionpublic void readResourceWithCustomRetryPolicy_DoesNotRetry_ForNonIoException()
                                                                      throws IOException
IOExceptionpublic void readResource_AddsSDKUserAgent()
                                   throws IOException
IOExceptionpublic void readResourceWithCustomRetryPolicy_AddsSDKUserAgent()
                                                        throws IOException
IOExceptionpublic void readResourceWithCustomRetryPolicyAndHeaders_AddsSDKUserAgent()
                                                                  throws IOException
IOExceptionCopyright © 2023. All rights reserved.