CAMEL-23688: camel-jbang - add unit tests for action reader CLI commands#24189
Open
ammachado wants to merge 1 commit into
Open
CAMEL-23688: camel-jbang - add unit tests for action reader CLI commands#24189ammachado wants to merge 1 commit into
ammachado wants to merge 1 commit into
Conversation
Adds unit tests for the request/response "reader" action commands, building on the action-writer tests from the previous batch. A new ActionCommandTestSupport.callWithResponse helper spins a background responder thread that, once the command has written its action request, simulates the running Camel writing the output file (driven by Awaitility, no Thread.sleep). Covers: gc, route-dump, bean, thread-dump, top-processors (source) and route-controller. Each test asserts both the action-request payload the command writes and the rendered console output, plus a no-match path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up to #24188 (action-writer command tests, merged), continuing the CAMEL-23688 effort to build a regression safety net around the
camel-jbangCLIactioncommands before refactoring.This batch covers the request/response "reader" commands: those that write an action request to
<pid>-action.json, then poll<pid>-output.jsonfor 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) for the command to write its action request, then writes the simulated output file.Commands covered (one
*Testeach, all incommands/action/):CamelGCActiongcCamelRouteDumpActionroute-dumpCamelBeanDumpbeanCamelThreadDumpthread-dumpCamelSourceToptop-processorsRouteControllerActionroute-controllerEach 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
ProcessHandlemock, 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.
Target
mainbranch)Tracking
Apache Camel coding standards and style
mvn clean install -DskipTestslocally from root folder and I have committed all auto-generated changes.Claude Code on behalf of Adriano Machado