MarsDynamoDBManager { public static void createResourceTable(final AmazonDynamoDB dynamoDB, final String tableName, final ProvisionedThroughput provisionedThroughput) { final CreateTableRequest request = new CreateTableRequest(); request.setAttributeDefinitions(RESOURCE_TABLE_ATTRIBUTE_DEFINITIONS); request.setKeySchema(RESOURCE_TABLE_KEY_SCHEMA); request.setProvisionedThroughput(provisionedThroughput); request.setTableName(tableName); LOGGER.info("Creating resource table: " + request); DynamoDBManager.createTable(dynamoDB, request); LOGGER.info("Resource table successfully created"); } private  MarsDynamoDBManager(); static void createImageTable(final AmazonDynamoDB dynamoDB, final String tableName,
        final ProvisionedThroughput tableProvisionedThroughput,
        final ProvisionedThroughput timeGSIProvisionedThroughput,
        final ProvisionedThroughput voteGSIProvisionedThroughput); static void createResourceTable(final AmazonDynamoDB dynamoDB, final String tableName,
        final ProvisionedThroughput provisionedThroughput); static final Collection<AttributeDefinition> RESOURCE_TABLE_ATTRIBUTE_DEFINITIONS; static final String RESOURCE_TABLE_HASH_KEY; static final String IMAGE_TABLE_HASH_KEY; static final String IMAGE_TABLE_GSI_HASH_KEY; static final String IMAGE_TABLE_TIME_GSI_RANGE_KEY; static final String IMAGE_TABLE_VOTE_GSI_RANGE_KEY; static final String IMAGE_TABLE_URL_ATTRIBUTE; static final String IMAGE_TABLE_THUMBNAIL_ATTRIBUTE; static final String IMAGE_TABLE_TIME_ATTRIBUTE; static final String IMAGE_TABLE_MISSION_ATTRIBUTE; static final String IMAGE_TABLE_INSTRUMENT_ATTRIBUTE; static final Collection<AttributeDefinition> IMAGE_TABLE_ATTRIBUTE_DEFINITIONS; static final Collection<KeySchemaElement> IMAGE_TABLE_KEY_SCHEMA; static final String IMAGE_TABLE_TIME_GSI_NAME; static final Collection<String> IMAGE_TABLE_TIME_GSI_NON_KEY_PROJECTED_ATTRIBUTES; static final Projection IMAGE_TABLE_TIME_GSI_PROJECTION; static final KeySchemaElement IMAGE_TABLE_TIME_GSI_HASH_KSE; static final KeySchemaElement IMAGE_TABLE_TIME_GSI_RANGE_KSE; static final String IMAGE_TABLE_VOTE_GSI_NAME; static final Collection<String> IMAGE_TABLE_VOTE_GSI_NON_KEY_PROJECTED_ATTRIBUTES; static final Projection IMAGE_TABLE_VOTE_GSI_PROJECTION; static final KeySchemaElement IMAGE_TABLE_VOTE_GSI_HASH_KSE; static final KeySchemaElement IMAGE_TABLE_VOTE_GSI_RANGE_KSE; }
@Test public void testCreateResourceTable() { final AmazonDynamoDB dynamoDB = PowerMock.createMock(AmazonDynamoDB.class); PowerMock.mockStatic(DynamoDBManager.class); final CreateTableRequest request = new CreateTableRequest(); request.setAttributeDefinitions(MarsDynamoDBManager.RESOURCE_TABLE_ATTRIBUTE_DEFINITIONS); request.setKeySchema(MarsDynamoDBManager.RESOURCE_TABLE_KEY_SCHEMA); request.setProvisionedThroughput(PROVISIONED_THROUGHPUT); request.setTableName(TABLE_NAME); DynamoDBManager.createTable(dynamoDB, request); PowerMock.expectLastCall().andReturn(null); PowerMock.replayAll(); MarsDynamoDBManager.createResourceTable(dynamoDB, TABLE_NAME, PROVISIONED_THROUGHPUT); PowerMock.verifyAll(); }