davsclaus opened a new pull request, #28793: URL: https://github.com/apache/camel/pull/28793
[CAMEL-23810](https://issues.apache.org/jira/browse/CAMEL-23810): a step before the port from picocli to aesh. Only tests and poms change. **What:** the tests set the options of a command with `CommandLineTestHelper.parse(command, args...)` instead of picocli's `CommandLine.populateCommand` and `new CommandLine(x).parseArgs(...)`. That is 175 calls in 70 test files: 59 in camel-jbang-core, 12 in four plugins. At the switch only the helper changes, not the tests. A command line that is not valid gives a `CliException` with the usage exit code (2), not a picocli exception. **How the plugins get the helper:** camel-jbang-core publishes a tests jar with only `CommandLineTestHelper` in it (an `includes` on the `test-jar` execution). camel-jbang-plugin-generate, -kubernetes, -tui and -validate depend on it in test scope. No module shared test classes before. **Left on picocli on purpose:** 32 test files still import picocli. They test picocli's own model, or production code that is picocli today, so they change with the switch itself: - `CliParseGoldenTest`, `BooleanOptionsTest`, `SortOptionsTest`, `GroupedCommandHelpRendererTest` and the plugins' boolean-option tests walk the picocli command model. - Test commands with their own `@CommandLine.Command`/`@Option` (`UserConfigDefaultsTest`, `ExitCodeContractTest`, `PluginHelperTest`, ...). - `VersionListReleasesTest` turns on picocli's `setOverwrittenOptionsAllowed`. - TUI tests that expect the `ParameterException` thrown by `CamelMonitor` and `MonitorStartup`, and the plugin SPI `postAddCommands(CommandLine, ...)`. **Tests:** - All camel-jbang-core tests pass (2448 + 290). - `DoctorRepositoryTest` fails only when the build runs with `-Dmaven.repo.local` (a scratch repo); without it, it passes, the same as on `main`. - The changed tests of the four plugins pass against the new core tests jar: generate 5, kubernetes 35 + the export tests on the base support class 93, tui 11, validate 22. One test added in #28792 (`DependencyUpdateTest`) still uses `populateCommand`. Whichever PR merges second converts it. _Claude Code on behalf of davsclaus (Claus Ibsen)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0128ThHB3iQdrvSRLVBGRrdP -- 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]
