mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(dynamodb): reject an unknown ReturnConsumedCapacity on Scan (#5669)
* fix(dynamodb): reject an unknown ReturnConsumedCapacity on Scan * refactor(dynamodb): share the ReturnConsumedCapacity enum message for Query and Scan
This commit is contained in:
1 parent
b395560fe2
commit
f3e1cb6006
2 files changed
+36
-5
No files matched your search
+19
@@ -1233,6 +1233,25 @@ class NativeDynamoDbJsonHandlerTest {
|
||||
+ "Member must have value greater than or equal to 1", ex.getMessage());
|
||||
}
|
||||
|
||||
@Test
|
||||
void scanRejectsAnUnknownReturnConsumedCapacityBeforeTheTableLookup() {
|
||||
AwsException ex = expectValidationException("Scan", json("""
|
||||
{"TableName": "Missing", "ReturnConsumedCapacity": "BOGUS", "Select": "BOGUS"}
|
||||
"""));
|
||||
assertEquals("1 validation error detected: Value 'BOGUS' at 'returnConsumedCapacity' "
|
||||
+ "failed to satisfy constraint: Member must satisfy enum value set: [INDEXES, TOTAL, NONE]",
|
||||
ex.getMessage());
|
||||
}
|
||||
|
||||
@Test
|
||||
void scanReportsTheLimitBeforeReturnConsumedCapacity() {
|
||||
AwsException ex = expectValidationException("Scan", json("""
|
||||
{"TableName": "Users", "Limit": 0, "ReturnConsumedCapacity": "BOGUS"}
|
||||
"""));
|
||||
assertEquals("1 validation error detected: Value at 'Limit' failed to satisfy constraint: "
|
||||
+ "Member must have value greater than or equal to 1", ex.getMessage());
|
||||
}
|
||||
|
||||
@Test
|
||||
void scanAcceptsSegmentsAtTheBounds() throws Exception {
|
||||
createUsersTable("eu-west-1");
|
||||
|
||||
Reference in new issue
Block a user