use of com.jcabi.dynamo.mock.MadeTable in project jcabi-dynamo by jcabi.
the class RegionMock method get.
/**
* Get region with a table.
* @param table Table name
* @return Region
* @throws Exception If fails
*/
public Region get(final String table) throws Exception {
final Region region = new Region.Simple(new Credentials.Direct(Credentials.TEST, this.prt));
final MadeTable mocker = new MadeTable(region, new CreateTableRequest().withTableName(table).withProvisionedThroughput(new ProvisionedThroughput().withReadCapacityUnits(1L).withWriteCapacityUnits(1L)).withAttributeDefinitions(new AttributeDefinition().withAttributeName(this.ahash).withAttributeType(ScalarAttributeType.S), new AttributeDefinition().withAttributeName(this.arange).withAttributeType(ScalarAttributeType.N)).withKeySchema(new KeySchemaElement().withAttributeName(this.ahash).withKeyType(KeyType.HASH), new KeySchemaElement().withAttributeName(this.arange).withKeyType(KeyType.RANGE)));
mocker.create();
mocker.createIfAbsent();
return new ReRegion(region);
}
Aggregations