@Test public void noSqlTables() { when(awsClient.createDynamoDbClient(any(AwsCredentialView.class), anyString())).thenReturn(amazonDynamoDB); when(amazonDynamoDB.listTables(any(ListTablesRequest.class))).thenReturn( new ListTablesResult().withTableNames("a", "b").withLastEvaluatedTableName("b"), new ListTablesResult().withTableNames("c", "d") ); CloudNoSqlTables cloudNoSqlTables = underTest.noSqlTables(new CloudCredential(), region("region"), null); assertThat(cloudNoSqlTables.getCloudNoSqlTables()).hasSameElementsAs(List.of( new CloudNoSqlTable("a"), new CloudNoSqlTable("b"), new CloudNoSqlTable("c"), new CloudNoSqlTable("d"))); }
@Override public CloudNoSqlTables noSqlTables(CloudCredential cloudCredential, Region region, Map<String, String> filters) { List<CloudNoSqlTable> noSqlTables = new ArrayList<>(); AmazonDynamoDB dynamoDbClient = getAmazonDynamoDB(cloudCredential, region); ListTablesRequest listTablesRequest = new ListTablesRequest(); ListTablesResult listTablesResult = null; boolean first = true; while (first || !isNullOrEmpty(listTablesResult.getLastEvaluatedTableName())) { first = false; listTablesRequest.setExclusiveStartTableName(listTablesResult == null ? null : listTablesResult.getLastEvaluatedTableName()); listTablesResult = dynamoDbClient.listTables(listTablesRequest); List<String> partialTableNames = listTablesResult.getTableNames(); List<CloudNoSqlTable> partialResult = partialTableNames.stream().map(CloudNoSqlTable::new).collect(Collectors.toList()); noSqlTables.addAll(partialResult); } return new CloudNoSqlTables(noSqlTables); }
AwsPlatformResources implements PlatformResources { @Override public CloudNoSqlTables noSqlTables(CloudCredential cloudCredential, Region region, Map<String, String> filters) { List<CloudNoSqlTable> noSqlTables = new ArrayList<>(); AmazonDynamoDB dynamoDbClient = getAmazonDynamoDB(cloudCredential, region); ListTablesRequest listTablesRequest = new ListTablesRequest(); ListTablesResult listTablesResult = null; boolean first = true; while (first || !isNullOrEmpty(listTablesResult.getLastEvaluatedTableName())) { first = false; listTablesRequest.setExclusiveStartTableName(listTablesResult == null ? null : listTablesResult.getLastEvaluatedTableName()); listTablesResult = dynamoDbClient.listTables(listTablesRequest); List<String> partialTableNames = listTablesResult.getTableNames(); List<CloudNoSqlTable> partialResult = partialTableNames.stream().map(CloudNoSqlTable::new).collect(Collectors.toList()); noSqlTables.addAll(partialResult); } return new CloudNoSqlTables(noSqlTables); } }
AwsPlatformResources implements PlatformResources { @Override public CloudNoSqlTables noSqlTables(CloudCredential cloudCredential, Region region, Map<String, String> filters) { List<CloudNoSqlTable> noSqlTables = new ArrayList<>(); AmazonDynamoDB dynamoDbClient = getAmazonDynamoDB(cloudCredential, region); ListTablesRequest listTablesRequest = new ListTablesRequest(); ListTablesResult listTablesResult = null; boolean first = true; while (first || !isNullOrEmpty(listTablesResult.getLastEvaluatedTableName())) { first = false; listTablesRequest.setExclusiveStartTableName(listTablesResult == null ? null : listTablesResult.getLastEvaluatedTableName()); listTablesResult = dynamoDbClient.listTables(listTablesRequest); List<String> partialTableNames = listTablesResult.getTableNames(); List<CloudNoSqlTable> partialResult = partialTableNames.stream().map(CloudNoSqlTable::new).collect(Collectors.toList()); noSqlTables.addAll(partialResult); } return new CloudNoSqlTables(noSqlTables); }  }
AwsPlatformResources implements PlatformResources { @Override public CloudNoSqlTables noSqlTables(CloudCredential cloudCredential, Region region, Map<String, String> filters) { List<CloudNoSqlTable> noSqlTables = new ArrayList<>(); AmazonDynamoDB dynamoDbClient = getAmazonDynamoDB(cloudCredential, region); ListTablesRequest listTablesRequest = new ListTablesRequest(); ListTablesResult listTablesResult = null; boolean first = true; while (first || !isNullOrEmpty(listTablesResult.getLastEvaluatedTableName())) { first = false; listTablesRequest.setExclusiveStartTableName(listTablesResult == null ? null : listTablesResult.getLastEvaluatedTableName()); listTablesResult = dynamoDbClient.listTables(listTablesRequest); List<String> partialTableNames = listTablesResult.getTableNames(); List<CloudNoSqlTable> partialResult = partialTableNames.stream().map(CloudNoSqlTable::new).collect(Collectors.toList()); noSqlTables.addAll(partialResult); } return new CloudNoSqlTables(noSqlTables); }  @PostConstruct void init(); String resourceDefinition(String resource); @Override CloudNetworks networks(CloudCredential cloudCredential, Region region, Map<String, String> filters); @Override CloudSshKeys sshKeys(CloudCredential cloudCredential, Region region, Map<String, String> filters); @Override CloudSecurityGroups securityGroups(CloudCredential cloudCredential, Region region, Map<String, String> filters); @Override @Cacheable(cacheNames = "cloudResourceRegionCache", key = "{ #cloudCredential?.id, #availabilityZonesNeeded }") CloudRegions regions(CloudCredential cloudCredential, Region region, Map<String, String> filters, boolean availabilityZonesNeeded); void addDisplayName(Map<Region, String> displayNames, com.amazonaws.services.ec2.model.Region awsRegion); void addCoordinate(Map<Region, Coordinate> coordinates, com.amazonaws.services.ec2.model.Region awsRegion); @Override @Cacheable(cacheNames = "cloudResourceVmTypeCache", key = "#cloudCredential?.id + #region.getRegionName()") CloudVmTypes virtualMachines(CloudCredential cloudCredential, Region region, Map<String, String> filters); @Override @Cacheable(cacheNames = "cloudResourceVmTypeCache", key = "#cloudCredential?.id + #region.getRegionName() + 'distrox'") CloudVmTypes virtualMachinesForDistroX(CloudCredential cloudCredential, Region region, Map<String, String> filters); @Override CloudGateWays gateways(CloudCredential cloudCredential, Region region, Map<String, String> filters); @Override CloudIpPools publicIpPool(CloudCredential cloudCredential, Region region, Map<String, String> filters); @Override CloudAccessConfigs accessConfigs(CloudCredential cloudCredential, Region region, Map<String, String> filters); @Override CloudEncryptionKeys encryptionKeys(CloudCredential cloudCredential, Region region, Map<String, String> filters); @Override CloudNoSqlTables noSqlTables(CloudCredential cloudCredential, Region region, Map<String, String> filters); @Override CloudResourceGroups resourceGroups(CloudCredential cloudCredential, Region region, Map<String, String> filters); }
AwsPlatformResources implements PlatformResources { @Override public CloudNoSqlTables noSqlTables(CloudCredential cloudCredential, Region region, Map<String, String> filters) { List<CloudNoSqlTable> noSqlTables = new ArrayList<>(); AmazonDynamoDB dynamoDbClient = getAmazonDynamoDB(cloudCredential, region); ListTablesRequest listTablesRequest = new ListTablesRequest(); ListTablesResult listTablesResult = null; boolean first = true; while (first || !isNullOrEmpty(listTablesResult.getLastEvaluatedTableName())) { first = false; listTablesRequest.setExclusiveStartTableName(listTablesResult == null ? null : listTablesResult.getLastEvaluatedTableName()); listTablesResult = dynamoDbClient.listTables(listTablesRequest); List<String> partialTableNames = listTablesResult.getTableNames(); List<CloudNoSqlTable> partialResult = partialTableNames.stream().map(CloudNoSqlTable::new).collect(Collectors.toList()); noSqlTables.addAll(partialResult); } return new CloudNoSqlTables(noSqlTables); }  @PostConstruct void init(); String resourceDefinition(String resource); @Override CloudNetworks networks(CloudCredential cloudCredential, Region region, Map<String, String> filters); @Override CloudSshKeys sshKeys(CloudCredential cloudCredential, Region region, Map<String, String> filters); @Override CloudSecurityGroups securityGroups(CloudCredential cloudCredential, Region region, Map<String, String> filters); @Override @Cacheable(cacheNames = "cloudResourceRegionCache", key = "{ #cloudCredential?.id, #availabilityZonesNeeded }") CloudRegions regions(CloudCredential cloudCredential, Region region, Map<String, String> filters, boolean availabilityZonesNeeded); void addDisplayName(Map<Region, String> displayNames, com.amazonaws.services.ec2.model.Region awsRegion); void addCoordinate(Map<Region, Coordinate> coordinates, com.amazonaws.services.ec2.model.Region awsRegion); @Override @Cacheable(cacheNames = "cloudResourceVmTypeCache", key = "#cloudCredential?.id + #region.getRegionName()") CloudVmTypes virtualMachines(CloudCredential cloudCredential, Region region, Map<String, String> filters); @Override @Cacheable(cacheNames = "cloudResourceVmTypeCache", key = "#cloudCredential?.id + #region.getRegionName() + 'distrox'") CloudVmTypes virtualMachinesForDistroX(CloudCredential cloudCredential, Region region, Map<String, String> filters); @Override CloudGateWays gateways(CloudCredential cloudCredential, Region region, Map<String, String> filters); @Override CloudIpPools publicIpPool(CloudCredential cloudCredential, Region region, Map<String, String> filters); @Override CloudAccessConfigs accessConfigs(CloudCredential cloudCredential, Region region, Map<String, String> filters); @Override CloudEncryptionKeys encryptionKeys(CloudCredential cloudCredential, Region region, Map<String, String> filters); @Override CloudNoSqlTables noSqlTables(CloudCredential cloudCredential, Region region, Map<String, String> filters); @Override CloudResourceGroups resourceGroups(CloudCredential cloudCredential, Region region, Map<String, String> filters);  }