AsyncSqsClientFactory { public AsyncSqsClient create(@NonNull final AsyncSqsClientConfiguration configuration) { return createClient(configuration); }  AsyncSqsClient create(@NonNull final AsyncSqsClientConfiguration configuration);  }
@Test public void testLocal() throws Exception { AsyncSqsClient localQueue = factory.create(LOCAL_CONFIG); assertTrue(localQueue instanceof MockAsyncSqsClient); }
@Test public void testAsync() throws Exception { AsyncSqsClient asyncClient = factory.create(ASYNC_CONFIG); assertTrue(asyncClient instanceof AsyncSqsClientImpl); SqsAsyncClient sqs = ((AsyncSqsClientImpl) asyncClient).getClient(); assertNotNull(sqs); }
@Test public void testAsyncWithOverrideConfig() throws Exception { AsyncSqsClientConfiguration config = new AsyncSqsClientConfiguration(AsyncSqsClientConfiguration.Type.PRODUCTION); RetryPolicyConfiguration retryPolicyConfiguration = new RetryPolicyConfiguration(); retryPolicyConfiguration.setCondition(RetryPolicyConfiguration.Condition.DEFAULT); retryPolicyConfiguration.setBackOff(RetryPolicyConfiguration.BackOff.EQUAL_JITTER); OverrideConfiguration overrideConfiguration = new OverrideConfiguration(); overrideConfiguration.setApiCallAttemptTimeout(300); overrideConfiguration.setApiCallTimeout(25 * 1000); overrideConfiguration.setRetryPolicyConfiguration(retryPolicyConfiguration); config.setOverrideConfiguration(overrideConfiguration); AsyncSqsClient asyncClient = factory.create(config); assertTrue(asyncClient instanceof AsyncSqsClientImpl); SqsAsyncClient sqs = ((AsyncSqsClientImpl) asyncClient).getClient(); assertNotNull(sqs); }