ClientFactoriesManager { public <T> T createClient( String accessKey, String secretKey, String sessionToken, String region, ClientType clientType ) { AbstractClientFactory clientFactory = getClientFactory( clientType ); T amazonClient = (T) clientFactory.createClient( accessKey, secretKey, sessionToken, region ); return amazonClient; } private  ClientFactoriesManager(); static ClientFactoriesManager getInstance(); T createClient( String accessKey, String secretKey, String sessionToken, String region, ClientType clientType );  }
@Test public void createClient_whenClientTypeIsS3() { S3Client s3Client; s3Client = factoriesManager.createClient( "accessKey", "secretKey", "", "US East ( N. Virginia)", ClientType.S3 ); Assert.assertNotNull( s3Client ); }
@Test public void createClient_whenClientTypeIsEmr() { EmrClient emrClient; emrClient = factoriesManager.createClient( "accessKey", "secretKey", "", "US East ( N. Virginia)", ClientType.EMR ); Assert.assertNotNull( emrClient ); }
@Test public void createClient_whenClientTypeIsPricing() { PricingClient pricingClient; pricingClient = factoriesManager.createClient( "accessKey", "secretKey", "", "US East ( N. Virginia)", ClientType.PRICING ); Assert.assertNotNull( pricingClient ); }
@Test public void createClient_whenClientTypeIsAim() { AimClient aimClient; aimClient = factoriesManager.createClient( "accessKey", "secretKey", "", "US East ( N. Virginia)", ClientType.AIM ); Assert.assertNotNull( aimClient ); }