use of software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithNumericSort in project aws-sdk-java-v2 by aws.
the class CreateTableOperationTest method generateRequest_withNumericKey.
@Test
public void generateRequest_withNumericKey() {
CreateTableOperation<FakeItemWithNumericSort> operation = CreateTableOperation.create(CreateTableEnhancedRequest.builder().build());
CreateTableRequest request = operation.generateRequest(FakeItemWithNumericSort.getTableSchema(), PRIMARY_CONTEXT, null);
assertThat(request.tableName(), is(TABLE_NAME));
assertThat(request.keySchema(), containsInAnyOrder(KeySchemaElement.builder().attributeName("id").keyType(HASH).build(), KeySchemaElement.builder().attributeName("sort").keyType(RANGE).build()));
assertThat(request.globalSecondaryIndexes(), is(DefaultSdkAutoConstructList.getInstance()));
assertThat(request.localSecondaryIndexes(), is(DefaultSdkAutoConstructList.getInstance()));
assertThat(request.attributeDefinitions(), containsInAnyOrder(AttributeDefinition.builder().attributeName("id").attributeType(ScalarAttributeType.S).build(), AttributeDefinition.builder().attributeName("sort").attributeType(ScalarAttributeType.N).build()));
}
use of software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithNumericSort in project aws-sdk-java-v2 by aws.
the class QueryOperationConditionalTest method beginsWith_numericRange_throwsIllegalArgumentException.
@Test(expected = IllegalArgumentException.class)
public void beginsWith_numericRange_throwsIllegalArgumentException() {
FakeItemWithNumericSort fakeItemWithNumericSort = FakeItemWithNumericSort.createUniqueFakeItemWithSort();
QueryConditional.sortBeginsWith(getKey(fakeItemWithNumericSort)).expression(FakeItemWithNumericSort.getTableSchema(), TableMetadata.primaryIndexName());
}
Aggregations