This is an automated email from the ASF dual-hosted git repository.

oscerd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git


The following commit(s) were added to refs/heads/main by this push:
     new c40db7211 Fix #2872: make the aws-ddb-sink delete-item test verify the 
delete (#3063)
c40db7211 is described below

commit c40db72115a641e5a028e28ea061d15130b31cc4
Author: Andrea Cosentino <[email protected]>
AuthorDate: Mon Sep 28 09:20:30 2026 +0200

    Fix #2872: make the aws-ddb-sink delete-item test verify the delete (#3063)
    
    The delete-item test passed without ever performing a DeleteItem.
    
    Citrus passes each system property to Camel JBang as -Dkey="value"
    (JBangSupport formats it that way), so a value containing bare double
    quotes collides with that wrapper and arrives unquoted. This test was
    the only one under aws/ddb/ that wrote its JSON body with bare quotes;
    put-item and update-item both escape them as \". As a result Camel
    received
    
        aws.ddb.json.data = {id: 2171}
    
    which is not JSON, and the route died inside the Kamelet:
    
        Failed delivery ... at aws-ddb-sink-1[transformDataType1]
        CamelExecutionException: Failed to get mandatory Json node from message 
body
        Caused by: JsonParseException: Unexpected character ('i' (code 105)):
          was expecting double-quote to start field name
    
    No DynamoDB call was ever made, so the seeded item survived -- and the
    final assertion expected exactly that, reusing the pre-delete
    expectation. The test was green because the delete was broken, and it
    would have turned red the day the delete started working.
    
    Escape the quotes like the sibling tests do, and assert the table is
    empty afterwards, so the test is green because the item is gone.
    
    Neither the Kamelet nor Floci was at fault: aws-ddb-sink performs a real
    DeleteItem against both Floci and LocalStack when the body reaches it
    intact.
    
    Signed-off-by: Andrea Cosentino <[email protected]>
    Co-authored-by: Claude Opus 5 <[email protected]>
---
 .../test/resources/aws/ddb/aws-ddb-sink-delete-item.citrus.it.yaml    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/tests/camel-kamelets-itest/src/test/resources/aws/ddb/aws-ddb-sink-delete-item.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/aws/ddb/aws-ddb-sink-delete-item.citrus.it.yaml
index a0c397a91..df07e45d3 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/aws/ddb/aws-ddb-sink-delete-item.citrus.it.yaml
+++ 
b/tests/camel-kamelets-itest/src/test/resources/aws/ddb/aws-ddb-sink-delete-item.citrus.it.yaml
@@ -66,7 +66,7 @@ actions:
           value: "Back to the future"
         - name: "aws.ddb.json.data"
           value: >-
-            {"id": ${aws.ddb.item.id}}
+            { \"id\": ${aws.ddb.item.id} }
   - groovy:
       script:
         file: "aws/ddb/putItem.groovy"
@@ -101,7 +101,7 @@ actions:
   - createVariables:
       variables:
         - name: "aws.ddb.items"
-          value: "[[id:AttributeValue(N=${aws.ddb.item.id}), 
title:AttributeValue(S=${aws.ddb.item.title}), 
year:AttributeValue(N=${aws.ddb.item.year})]]"
+          value: "[]"
   - repeatOnError:
       until: "i > ${maxRetryAttempts}"
       actions:

Reply via email to