CAMEL-24201: camel-aws2-step-functions - listExecutions sets the state machine ARN#24928
Conversation
…e machine ARN listExecutions built the ListExecutions request with only maxResults and never read CamelAwsStepFunctionsStateMachineArn. The AWS API requires a state machine ARN (or a map run ARN), so in header mode the call was always rejected and the operation was effectively unusable. The state machine ARN is now read from the header following the same optional pattern used by the sibling operations. Extends the existing listExecutions test to supply the header and assert it reaches the request. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
gnodet
left a comment
There was a problem hiding this comment.
Clear and correct fix. The listExecutions non-POJO path was missing the required stateMachineArn parameter, making the operation always fail against AWS. The fix reads it from the existing CamelAwsStepFunctionsStateMachineArn header, consistent with how all sibling operations (deleteStateMachine, updateStateMachine, describeStateMachine, etc.) read the same header.
Code: The 4-line addition follows the exact same pattern used for maxResults directly below it, and for STATE_MACHINE_ARN in the other operations — consistent and idiomatic.
Test: Good approach — capturing the request in the mock with getLastListExecutionsRequest() lets the test assert the ARN was actually wired into the request builder, not just that the call didn't throw.
LGTM ✅
Claude Code on behalf of gnodet — AI-generated review
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 9 tested, 29 compile-only — current: 9 all testedMaveniverse Scalpel detected 38 affected modules (current approach: 9).
|
Description
Fixes CAMEL-24201.
StepFunctions2Producer.listExecutionsbuilt the request with onlymaxResults:The AWS
ListExecutionsAPI requires astateMachineArn(or amapRunArn), so in header (non-POJO) mode the call was always rejected by AWS — the operation was effectively unusable. TheCamelAwsStepFunctionsStateMachineArnheader already exists and is read by the sibling operations (deleteStateMachine,updateStateMachine,describeStateMachine, …), butlistExecutionsnever read it.The ARN is now read from that header using the same optional-header pattern as its siblings.
Tests
Extends the existing
sfnListExecutionsTestto set the state-machine-ARN header and assert (via the client mock, which now records the request) that it reaches theListExecutionsRequest. All 17 tests inStepFunctions2ProducerTestpass.Backport
Same code on
camel-4.18.xandcamel-4.14.x; will be backported after merge (fixVersions 4.22.0 / 4.18.4 / 4.14.9).Claude Code on behalf of oscerd