DynamoDBClientFetcherImpl implements DynamoDBClientFetcher { String getAWSRegion(final String settingRegion) { if (StringUtil.isEmpty(settingRegion)) { if (defaultAwsRegion == null) { defaultAwsRegion = EC2MetadataUtils.getEC2InstanceRegion(); } return defaultAwsRegion; } else { return settingRegion; } } DynamoDBClientFetcherImpl();  DynamoDBClientFetcherImpl(String defaultAwsRegion); @Override DynamoDBClientAndCredentials getDynamoDBClient(ZTSClientNotificationSender ztsClientNotificationSender, PrivateKeyStore keyStore);  }
@Test public void testGetAWSRegion() { DynamoDBClientFetcherImpl dynamoDBClientFetcher = new DynamoDBClientFetcherImpl(); assertEquals(dynamoDBClientFetcher.getAWSRegion("us-west-2"), "us-west-2"); dynamoDBClientFetcher = new DynamoDBClientFetcherImpl("us-east-1"); assertEquals(dynamoDBClientFetcher.getAWSRegion("us-west-2"), "us-west-2"); assertEquals(dynamoDBClientFetcher.getAWSRegion(""), "us-east-1"); assertEquals(dynamoDBClientFetcher.getAWSRegion(null), "us-east-1"); dynamoDBClientFetcher = new DynamoDBClientFetcherImpl(); dynamoDBClientFetcher.getAWSRegion(null); }