ammachado opened a new pull request, #24188: URL: https://github.com/apache/camel/pull/24188
# Description Adds unit test coverage for the fire-and-forget **action** commands in `camel-jbang-core`, which previously had no tests. This is part of [CAMEL-23688](https://issues.apache.org/jira/browse/CAMEL-23688) (extensive test coverage of the jbang CLI commands, as a safety net ahead of refactoring), following the already-merged work on the `process` package (#23812, #23869). These commands resolve a running Camel integration by name/pid and write an action request file (`<pid>-action.json`) for the integration to pick up. Commands covered: - `start-route` / `stop-route` / `suspend-route` / `resume-route` - `start-group` / `stop-group` - `reload` / `reset-stats` - `enable-processor` / `disable-processor` ### Test infrastructure A new `ActionCommandTestSupport` base mirrors the proven `ProcessCommandTestSupport` pattern (`mockStatic` on `ProcessHandle`, status-file fixtures, recursive cleanup) and adds: - `readActionFile(pid)` to assert the written action payload. - `callWithSingleProcess(command)` which owns the `ProcessHandle` mock setup so each test stays focused on its assertions. ### What each test verifies Tests assert intent, not just exit code: - pid resolution by Camel context name, - the exact written action payload (`action` / `command` / `id`, plus the `group` flag for group actions), - that **no** action file is written when no process matches. # 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. --- _Test-only change (no production code touched). Verified locally: `mvn -pl dsl/camel-jbang/camel-jbang-core test` for the new `commands.action.*Test` classes runs 25 tests, 0 failures; `formatter:format impsort:sort` is clean._ _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]
