test(dynamodb): add coverage for numeric ExpressionAttributeNames (#0, #1)#166
test(dynamodb): add coverage for numeric ExpressionAttributeNames (#0, #1)#166rpalcolea wants to merge 2 commits intohectorvent:mainfrom
Conversation
…hectorvent#1) Adds unit and integration tests verifying that numeric placeholder aliases in ExpressionAttributeNames are resolved correctly across: - Query KeyConditionExpression: #0 = :0 AND begins_with(hectorvent#1, :prefix) - TransactWriteItems ConditionExpression: attribute_not_exists(#0) Covers the scenario reported in hectorvent#127 where PynamoDB-style numeric aliases were not being resolved, causing zero query results and spurious TransactionCanceledExceptions. Fixes hectorvent#127
There was a problem hiding this comment.
Pull request overview
Adds DynamoDB test coverage to ensure numeric placeholder aliases (e.g., #0, #1) in ExpressionAttributeNames are correctly resolved in expressions, matching common PynamoDB-generated request patterns and guarding against the regression reported in #127.
Changes:
- Add a unit test covering numeric
ExpressionAttributeNamesresolution inQueryKeyConditionExpression. - Add an integration test covering numeric aliases in
Querywithbegins_with. - Add an integration test covering numeric aliases in
TransactWriteItemsConditionExpression(attribute_not_exists(#0)).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/test/java/io/github/hectorvent/floci/services/dynamodb/DynamoDbServiceTest.java | Adds unit coverage for numeric ExpressionAttributeNames in a Query key condition expression. |
| src/test/java/io/github/hectorvent/floci/services/dynamodb/DynamoDbIntegrationTest.java | Adds integration coverage for numeric aliases in Query and TransactWriteItems requests over the JSON 1.0 wire protocol. |
src/test/java/io/github/hectorvent/floci/services/dynamodb/DynamoDbIntegrationTest.java
Outdated
Show resolved
Hide resolved
src/test/java/io/github/hectorvent/floci/services/dynamodb/DynamoDbIntegrationTest.java
Outdated
Show resolved
Hide resolved
hectorvent
left a comment
There was a problem hiding this comment.
Thanks @rpalcolea,
Please solve copilot review. Test Order duplicate.
|
@rpalcolea is this just to validate the issue is already solved? Could we close #127? |
|
@rpalcolea Are you going to create the service(function) related to those tests? Because the function that corrects the fix has not yet been created; it has not been implemented yet. |
Updated test method order for DynamoDbIntegrationTest. Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Adds unit and integration tests verifying that numeric placeholder aliases in ExpressionAttributeNames are resolved correctly across:
Covers the scenario reported in #127 where PynamoDB-style numeric aliases were not being resolved, causing zero query results and spurious TransactionCanceledExceptions.
Associated to #127
Type of change
fix:)feat:)feat!:orfix!:)Checklist
./mvnw testpasses locally