Skip to content

Commit 7220c9e

Browse files
committed
DynamoDb enhanced client: support UpdateExpressions in single-request update
1 parent 79cfa56 commit 7220c9e

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/update/UpdateExpressionTest.java

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,44 @@ void merge_expression_with_all_action_types() {
171171
assertThat(result.addActions()).containsExactly(addAction, extraAddAction);
172172
}
173173

174+
@Test
175+
void isEmpty_emptyExpression_returnsTrue() {
176+
UpdateExpression updateExpression = UpdateExpression.builder().build();
177+
assertThat(updateExpression.isEmpty()).isTrue();
178+
}
179+
180+
@Test
181+
void isEmpty_withRemoveAction_returnsFalse() {
182+
UpdateExpression updateExpression = UpdateExpression.builder()
183+
.addAction(removeAction)
184+
.build();
185+
assertThat(updateExpression.isEmpty()).isFalse();
186+
}
187+
188+
@Test
189+
void isEmpty_withSetAction_returnsFalse() {
190+
UpdateExpression updateExpression = UpdateExpression.builder()
191+
.addAction(setAction)
192+
.build();
193+
assertThat(updateExpression.isEmpty()).isFalse();
194+
}
195+
196+
@Test
197+
void isEmpty_withDeleteAction_returnsFalse() {
198+
UpdateExpression updateExpression = UpdateExpression.builder()
199+
.addAction(deleteAction)
200+
.build();
201+
assertThat(updateExpression.isEmpty()).isFalse();
202+
}
203+
204+
@Test
205+
void isEmpty_withAddAction_returnsFalse() {
206+
UpdateExpression updateExpression = UpdateExpression.builder()
207+
.addAction(addAction)
208+
.build();
209+
assertThat(updateExpression.isEmpty()).isFalse();
210+
}
211+
174212
private static final class UnknownUpdateAction implements UpdateAction {
175213

176214
}

0 commit comments

Comments
 (0)