Search in sources :

Example 1 with FakeItemWithBinaryKey

use of software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithBinaryKey in project aws-sdk-java-v2 by aws.

the class CreateTableOperationTest method generateRequest_withBinaryKey.

@Test
public void generateRequest_withBinaryKey() {
    CreateTableOperation<FakeItemWithBinaryKey> operation = CreateTableOperation.create(CreateTableEnhancedRequest.builder().build());
    CreateTableRequest request = operation.generateRequest(FakeItemWithBinaryKey.getTableSchema(), PRIMARY_CONTEXT, null);
    assertThat(request.tableName(), is(TABLE_NAME));
    assertThat(request.keySchema(), containsInAnyOrder(KeySchemaElement.builder().attributeName("id").keyType(HASH).build()));
    assertThat(request.globalSecondaryIndexes(), is(empty()));
    assertThat(request.localSecondaryIndexes(), is(empty()));
    assertThat(request.attributeDefinitions(), containsInAnyOrder(AttributeDefinition.builder().attributeName("id").attributeType(ScalarAttributeType.B).build()));
}
Also used : FakeItemWithBinaryKey(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithBinaryKey) CreateTableRequest(software.amazon.awssdk.services.dynamodb.model.CreateTableRequest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 FakeItemWithBinaryKey (software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithBinaryKey)1 CreateTableRequest (software.amazon.awssdk.services.dynamodb.model.CreateTableRequest)1