ammachado opened a new pull request, #24189: URL: https://github.com/apache/camel/pull/24189
# Description Follow-up to #24188 (action-writer command tests, merged), continuing the [CAMEL-23688](https://issues.apache.org/jira/browse/CAMEL-23688) effort to build a regression safety net around the `camel-jbang` CLI `action` commands before refactoring. This batch covers the **request/response "reader" commands**: those that write an action request to `<pid>-action.json`, then poll `<pid>-output.json` for the running Camel's response and render it to the console. **New test infrastructure** (`ActionCommandTestSupport`): - `callWithResponse(command, response)` runs a reader command end to end. It starts a background "responder" thread that waits (via Awaitility, no `Thread.sleep`) for the command to write its action request, then writes the simulated output file. Waiting for the action file is what makes it deterministic: the reader commands delete any stale output file *before* writing the action request, so the simulated response can only land after that delete. **Commands covered** (one `*Test` each, all in `commands/action/`): | Command | Action verb | Kind | |---------|-------------|------| | `CamelGCAction` | `gc` | fire-and-forget writer | | `CamelRouteDumpAction` | `route-dump` | reader | | `CamelBeanDump` | `bean` | reader | | `CamelThreadDump` | `thread-dump` | reader | | `CamelSourceTop` | `top-processors` | reader | | `RouteControllerAction` | `route-controller` | reader | Each test asserts both the action-request payload the command writes **and** the rendered console output from a simulated response, plus a no-match path (no running process resolved). Process discovery is mocked with a static `ProcessHandle` mock, matching the existing tests in this package. This is a **test-only** change: no production code is touched and there is no user-visible behavior change, so no upgrade-guide entry is required. # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [x] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes. --- _Claude Code on behalf of Adriano Machado_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
