Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ actions:
- createVariables:
variables:
- name: "aws.ddb.items"
value: "[[title:AttributeValue(S=${aws.ddb.item.title}), year:AttributeValue(N=${aws.ddb.item.year}), id:AttributeValue(N=${aws.ddb.item.id})]]"
value: "[[id:AttributeValue(N=${aws.ddb.item.id}), title:AttributeValue(S=${aws.ddb.item.title}), year:AttributeValue(N=${aws.ddb.item.year})]]"
- repeatOnError:
until: "i > ${maxRetryAttempts}"
actions:
Expand Down Expand Up @@ -101,7 +101,7 @@ actions:
- createVariables:
variables:
- name: "aws.ddb.items"
value: "[[title:AttributeValue(S=${aws.ddb.item.title}), year:AttributeValue(N=${aws.ddb.item.year}), id:AttributeValue(N=${aws.ddb.item.id})]]"
value: "[[id:AttributeValue(N=${aws.ddb.item.id}), title:AttributeValue(S=${aws.ddb.item.title}), year:AttributeValue(N=${aws.ddb.item.year})]]"
- repeatOnError:
until: "i > ${maxRetryAttempts}"
actions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ actions:
- createVariables:
variables:
- name: "aws.ddb.item"
value: "[title:AttributeValue(S=${aws.ddb.item.title}), year:AttributeValue(N=${aws.ddb.item.year}), id:AttributeValue(N=${aws.ddb.item.id})]"
value: "[id:AttributeValue(N=${aws.ddb.item.id}), title:AttributeValue(S=${aws.ddb.item.title}), year:AttributeValue(N=${aws.ddb.item.year})]"
- repeatOnError:
until: "i > ${maxRetryAttempts}"
actions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
steps:
- setBody:
constant: "{{aws.ddb.json.data}}"
- log:
message: "${body}"
showHeaders: true
- log: "${body}"
- to:
uri: "kamelet:aws-ddb-sink"
parameters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ actions:
- createVariables:
variables:
- name: "aws.ddb.item"
value: "[title:AttributeValue(S=${aws.ddb.item.title}), year:AttributeValue(N=${aws.ddb.item.year}), id:AttributeValue(N=${aws.ddb.item.id})]"
value: "[id:AttributeValue(N=${aws.ddb.item.id}), title:AttributeValue(S=${aws.ddb.item.title}), year:AttributeValue(N=${aws.ddb.item.year})]"
- repeatOnError:
until: "i > ${maxRetryAttempts}"
actions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ import software.amazon.awssdk.services.dynamodb.model.AttributeValue
var amazonDDBClient = context.getReferenceResolver().resolve("amazonDDBClient")

try {
assert '${aws.ddb.item}' == amazonDDBClient.getItem(b -> b.tableName('${aws.ddb.tableName}')
.key(Collections.singletonMap("id", AttributeValue.builder().n('${aws.ddb.item.id}').build())))?.item()?.toString()
def item = amazonDDBClient.getItem(b -> b.tableName('${aws.ddb.tableName}')
.key(Collections.singletonMap("id", AttributeValue.builder().n('${aws.ddb.item.id}').build())))?.item()

assert new TreeMap(item).toString() == '${aws.ddb.item}'
} catch (AssertionError e) {
throw new CitrusRuntimeException("AWS DDB item verification failed", e)
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import org.citrusframework.exceptions.CitrusRuntimeException
var amazonDDBClient = context.getReferenceResolver().resolve("amazonDDBClient")

try {
assert '${aws.ddb.items}' == amazonDDBClient.scan(b -> b.tableName('${aws.ddb.tableName}'))?.items()?.toListString()
def items = amazonDDBClient.scan(b -> b.tableName('${aws.ddb.tableName}'))?.items()
def sorted = items.collect { new TreeMap(it) }
assert '${aws.ddb.items}' == sorted.toString()
} catch (AssertionError e) {
throw new CitrusRuntimeException("AWS DDB item verification failed", e)
}
Loading