gnodet-bot commented on code in PR #29945:
URL: https://github.com/apache/camel/pull/29945#discussion_r4574958578
##########
dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/version/VersionSetTest.java:
##########
@@ -60,7 +60,7 @@ void shouldStoreVersionInGlobalConfig() throws Exception {
void shouldStoreVersionRepoAndRuntimeTogether() throws Exception {
UserConfigHelper.createUserConfig("");
- VersionSet command = new VersionSet(new
CamelJBangMain().withPrinter(printer));
+ VersionSet command = command();
command.version = "4.10.0";
command.repo = "https://repo.example.org/maven";
Review Comment:
💡 **Minor coverage gap:** `shouldStoreVersionRepoAndRuntimeTogether` sets
`command.repo` but doesn't assert that the value is forwarded to
`versionCheck`. The `command()` helper stubs `versionCheck` to always return
`true` without inspecting its arguments, so the routing is exercised but never
verified.
Consider capturing the `repos` argument here, similar to
`shouldSetAVersionThatCannotBeCheckedWithAWarning`:
```java
String[] capturedRepos = new String[1];
command.versionCheck = (version, repos) -> {
capturedRepos[0] = repos;
return true;
};
// ... doCall() ...
assertEquals("https://repo.example.org/maven", capturedRepos[0]);
```
--
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]