use of software.amazon.awssdk.services.dynamodb.model.ReturnValuesOnConditionCheckFailure in project aws-sdk-java-v2 by aws.
the class TransactPutItemEnhancedRequestTest 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();
ReturnValuesOnConditionCheckFailure returnValues = ReturnValuesOnConditionCheckFailure.ALL_OLD;
TransactPutItemEnhancedRequest<FakeItem> builtObject = TransactPutItemEnhancedRequest.builder(FakeItem.class).item(fakeItem).conditionExpression(conditionExpression).returnValuesOnConditionCheckFailure(returnValues).build();
assertThat(builtObject.item(), is(fakeItem));
assertThat(builtObject.conditionExpression(), is(conditionExpression));
assertThat(builtObject.returnValuesOnConditionCheckFailure(), is(returnValues));
}
use of software.amazon.awssdk.services.dynamodb.model.ReturnValuesOnConditionCheckFailure in project aws-sdk-java-v2 by aws.
the class TransactPutItemEnhancedRequestTest method equals_returnValuesOnConditionCheckFailureNotEqual.
@Test
public void equals_returnValuesOnConditionCheckFailureNotEqual() {
ReturnValuesOnConditionCheckFailure returnValues1 = ReturnValuesOnConditionCheckFailure.ALL_OLD;
ReturnValuesOnConditionCheckFailure returnValues2 = ReturnValuesOnConditionCheckFailure.NONE;
TransactPutItemEnhancedRequest<FakeItem> builtObject1 = TransactPutItemEnhancedRequest.builder(FakeItem.class).returnValuesOnConditionCheckFailure(returnValues1).build();
TransactPutItemEnhancedRequest<FakeItem> builtObject2 = TransactPutItemEnhancedRequest.builder(FakeItem.class).returnValuesOnConditionCheckFailure(returnValues2).build();
assertThat(builtObject1, not(equalTo(builtObject2)));
}
use of software.amazon.awssdk.services.dynamodb.model.ReturnValuesOnConditionCheckFailure in project aws-sdk-java-v2 by aws.
the class TransactPutItemEnhancedRequestTest method builder_returnValuesOnConditionCheckFailureNull_noNpe.
@Test
public void builder_returnValuesOnConditionCheckFailureNull_noNpe() {
ReturnValuesOnConditionCheckFailure returnValues = null;
TransactPutItemEnhancedRequest<FakeItem> builtObject = TransactPutItemEnhancedRequest.builder(FakeItem.class).returnValuesOnConditionCheckFailure(returnValues).build();
assertThat(builtObject.returnValuesOnConditionCheckFailure(), is(nullValue()));
assertThat(builtObject.returnValuesOnConditionCheckFailureAsString(), is(nullValue()));
}
use of software.amazon.awssdk.services.dynamodb.model.ReturnValuesOnConditionCheckFailure in project aws-sdk-java-v2 by aws.
the class TransactUpdateItemEnhancedRequestTest method equals_maximal.
@Test
public void equals_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();
ReturnValuesOnConditionCheckFailure returnValues = ReturnValuesOnConditionCheckFailure.ALL_OLD;
TransactUpdateItemEnhancedRequest<FakeItem> builtObject = TransactUpdateItemEnhancedRequest.builder(FakeItem.class).item(fakeItem).ignoreNulls(true).conditionExpression(conditionExpression).returnValuesOnConditionCheckFailure(returnValues).build();
TransactUpdateItemEnhancedRequest<FakeItem> copiedObject = builtObject.toBuilder().build();
assertThat(builtObject, equalTo(copiedObject));
}
use of software.amazon.awssdk.services.dynamodb.model.ReturnValuesOnConditionCheckFailure in project aws-sdk-java-v2 by aws.
the class TransactUpdateItemEnhancedRequestTest 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();
ReturnValuesOnConditionCheckFailure returnValues = ReturnValuesOnConditionCheckFailure.ALL_OLD;
TransactUpdateItemEnhancedRequest<FakeItem> builtObject = TransactUpdateItemEnhancedRequest.builder(FakeItem.class).item(fakeItem).ignoreNulls(true).conditionExpression(conditionExpression).returnValuesOnConditionCheckFailure(returnValues).build();
TransactUpdateItemEnhancedRequest<FakeItem> copiedObject = builtObject.toBuilder().build();
assertThat(copiedObject, is(builtObject));
}
Aggregations