@Test
public void testGetAmazonSNSClientCacheHitMiss()
{

    // Create an AWS parameters DTO that contains proxy information.
    AwsParamsDto awsParamsDto =
        new AwsParamsDto(NO_AWS_ACCESS_KEY, NO_AWS_SECRET_KEY, NO_SESSION_TOKEN, HTTP_PROXY_HOST, HTTP_PROXY_PORT, AWS_REGION_NAME_US_EAST_1);
    // Get an Amazon SNS client.
    AmazonSNS amazonSNS = awsClientFactory.getAmazonSNSClient(awsParamsDto);
    // Confirm a cache hit.
    assertEquals(amazonSNS, awsClientFactory.getAmazonSNSClient(
        new AwsParamsDto(NO_AWS_ACCESS_KEY, NO_AWS_SECRET_KEY, NO_SESSION_TOKEN, HTTP_PROXY_HOST, HTTP_PROXY_PORT, AWS_REGION_NAME_US_EAST_1)));
    // Confirm a cache miss due to http proxy information.
    assertNotEquals(amazonSNS, awsClientFactory.getAmazonSNSClient(
        new AwsParamsDto(NO_AWS_ACCESS_KEY, NO_AWS_SECRET_KEY, NO_SESSION_TOKEN, HTTP_PROXY_HOST_2, HTTP_PROXY_PORT_2, AWS_REGION_NAME_US_EAST_1)));
    // Clear the cache.
    cacheManager.getCache(DaoSpringModuleConfig.HERD_CACHE_NAME).clear();
    // Confirm a cache miss due to cleared cache.
    assertNotEquals(amazonSNS, awsClientFactory.getAmazonSNSClient(awsParamsDto));
}