Skip to content

chore(test): make DDB Scan/Query IT assertions order-independent#23242

Merged
Croway merged 1 commit into
apache:mainfrom
Croway:fix/ddb-scan-ordering-tests
May 15, 2026
Merged

chore(test): make DDB Scan/Query IT assertions order-independent#23242
Croway merged 1 commit into
apache:mainfrom
Croway:fix/ddb-scan-ordering-tests

Conversation

@Croway
Copy link
Copy Markdown
Contributor

@Croway Croway commented May 15, 2026

Summary

  • DynamoDB Scan does not guarantee item ordering, but AWS2QueryRuleIT and AWS2ScanRuleIT were asserting specific values at items.get(0), relying on LocalStack's internal storage order
  • Replaced positional assertions with order-independent checks: value sets via Collectors.toSet() and structural iteration over all items
  • Also removed dead code (unused keyConditions and coll variables) from the affected test methods

Test plan

  • All 27 camel-aws2-ddb integration tests pass with LocalStack
  • All 27 camel-aws2-ddb integration tests pass with Floci (an alternative AWS emulator that returns Scan items in a different order)

DynamoDB Scan does not guarantee item ordering. The tests were relying
on a specific item order that happened to match LocalStack's internal
storage layout, making them fail against other DynamoDB-compatible
backends. Assert on value sets and structural properties instead.
@github-actions
Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions
Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-aws/camel-aws2-ddb
All tested modules (8 modules)
  • Camel :: AWS2 DDB
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Launcher :: Container
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

@Croway Croway merged commit 67af4d5 into apache:main May 15, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant