use of software.amazon.awssdk.services.dynamodb.model.ReturnItemCollectionMetrics in project aws-sdk-java-v2 by aws.
the class AsyncDeleteItemWithResponseIntegrationTest method delete_returnItemCollectionMetrics_set_itemCollectionMetricsNotNull.
@Test
public void delete_returnItemCollectionMetrics_set_itemCollectionMetricsNotNull() {
Key key = Key.builder().partitionValue(1).sortValue(10).build();
DeleteItemEnhancedResponse<Record> response = mappedTable.deleteItemWithResponse(r -> r.key(key).returnItemCollectionMetrics(ReturnItemCollectionMetrics.SIZE)).join();
assertThat(response.itemCollectionMetrics()).isNotNull();
}
use of software.amazon.awssdk.services.dynamodb.model.ReturnItemCollectionMetrics in project aws-sdk-java-v2 by aws.
the class UpdateItemEnhancedRequestTest method toBuilder.
@Test
public void toBuilder() {
FakeItem fakeItem = createUniqueFakeItem();
Expression conditionExpression = Expression.builder().expression("#key = :value OR #key1 = :value1").putExpressionName("#key", "attribute").putExpressionName("#key1", "attribute3").putExpressionValue(":value", stringValue("wrong")).putExpressionValue(":value1", stringValue("three")).build();
ReturnConsumedCapacity returnConsumedCapacity = ReturnConsumedCapacity.TOTAL;
ReturnItemCollectionMetrics returnItemCollectionMetrics = ReturnItemCollectionMetrics.SIZE;
UpdateItemEnhancedRequest<FakeItem> builtObject = UpdateItemEnhancedRequest.builder(FakeItem.class).item(fakeItem).ignoreNulls(true).conditionExpression(conditionExpression).returnConsumedCapacity(returnConsumedCapacity).returnItemCollectionMetrics(returnItemCollectionMetrics).build();
UpdateItemEnhancedRequest<FakeItem> copiedObject = builtObject.toBuilder().build();
assertThat(copiedObject, is(builtObject));
}
use of software.amazon.awssdk.services.dynamodb.model.ReturnItemCollectionMetrics in project aws-sdk-java-v2 by aws.
the class PutItemEnhancedRequestTest method builder_maximal.
@Test
public void builder_maximal() {
FakeItem fakeItem = createUniqueFakeItem();
Expression conditionExpression = Expression.builder().expression("#key = :value OR #key1 = :value1").putExpressionName("#key", "attribute").putExpressionName("#key1", "attribute3").putExpressionValue(":value", stringValue("wrong")).putExpressionValue(":value1", stringValue("three")).build();
ReturnValue returnValues = ReturnValue.ALL_OLD;
ReturnConsumedCapacity returnConsumedCapacity = ReturnConsumedCapacity.INDEXES;
ReturnItemCollectionMetrics returnItemCollectionMetrics = ReturnItemCollectionMetrics.SIZE;
PutItemEnhancedRequest<FakeItem> builtObject = PutItemEnhancedRequest.builder(FakeItem.class).item(fakeItem).conditionExpression(conditionExpression).returnValues(returnValues).returnConsumedCapacity(returnConsumedCapacity).returnItemCollectionMetrics(returnItemCollectionMetrics).build();
assertThat(builtObject.item(), is(fakeItem));
assertThat(builtObject.conditionExpression(), is(conditionExpression));
assertThat(builtObject.returnValues(), is(returnValues));
assertThat(builtObject.returnValuesAsString(), is(returnValues.toString()));
assertThat(builtObject.returnConsumedCapacity(), is(returnConsumedCapacity));
assertThat(builtObject.returnConsumedCapacityAsString(), is(returnConsumedCapacity.toString()));
assertThat(builtObject.returnItemCollectionMetrics(), is(returnItemCollectionMetrics));
assertThat(builtObject.returnItemCollectionMetricsAsString(), is(returnItemCollectionMetrics.toString()));
}
use of software.amazon.awssdk.services.dynamodb.model.ReturnItemCollectionMetrics in project aws-sdk-java-v2 by aws.
the class DeleteItemEnhancedRequestTest method builder_maximal.
@Test
public void builder_maximal() {
Key key = Key.builder().partitionValue("key").build();
Expression conditionExpression = Expression.builder().expression("#key = :value OR #key1 = :value1").putExpressionName("#key", "attribute").putExpressionName("#key1", "attribute3").putExpressionValue(":value", stringValue("wrong")).putExpressionValue(":value1", stringValue("three")).build();
ReturnConsumedCapacity returnConsumedCapacity = ReturnConsumedCapacity.TOTAL;
ReturnItemCollectionMetrics returnItemCollectionMetrics = ReturnItemCollectionMetrics.SIZE;
DeleteItemEnhancedRequest builtObject = DeleteItemEnhancedRequest.builder().key(key).conditionExpression(conditionExpression).returnConsumedCapacity(returnConsumedCapacity).returnItemCollectionMetrics(returnItemCollectionMetrics).build();
assertThat(builtObject.key(), is(key));
assertThat(builtObject.conditionExpression(), is(conditionExpression));
assertThat(builtObject.returnConsumedCapacity(), is(returnConsumedCapacity));
assertThat(builtObject.returnConsumedCapacityAsString(), is(returnConsumedCapacity.toString()));
assertThat(builtObject.returnItemCollectionMetrics(), is(returnItemCollectionMetrics));
assertThat(builtObject.returnItemCollectionMetricsAsString(), is(returnItemCollectionMetrics.toString()));
}
use of software.amazon.awssdk.services.dynamodb.model.ReturnItemCollectionMetrics in project aws-sdk-java-v2 by aws.
the class DeleteItemEnhancedRequestTest method equals_returnItemCollectionMetricsNotEqual.
@Test
public void equals_returnItemCollectionMetricsNotEqual() {
ReturnItemCollectionMetrics returnItemCollectionMetrics1 = ReturnItemCollectionMetrics.SIZE;
ReturnItemCollectionMetrics returnItemCollectionMetrics2 = ReturnItemCollectionMetrics.NONE;
DeleteItemEnhancedRequest builtObject1 = DeleteItemEnhancedRequest.builder().returnItemCollectionMetrics(returnItemCollectionMetrics1).build();
DeleteItemEnhancedRequest builtObject2 = DeleteItemEnhancedRequest.builder().returnItemCollectionMetrics(returnItemCollectionMetrics2).build();
assertThat(builtObject1, not(equalTo(builtObject2)));
}
Aggregations