gnodet-bot commented on code in PR #26551:
URL: https://github.com/apache/camel/pull/26551#discussion_r4038034413


##########
dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/plugin/PluginAddTest.java:
##########
@@ -49,6 +50,18 @@ public void shouldAddDefaultPlugin() throws Exception {
                 PluginHelper.getOrCreatePluginConfig().toJson());
     }
 
+    @Test
+    public void shouldResolveKitDependencyFromKnownPlugins() throws Exception {
+        PluginAdd command = new PluginAdd(new 
CamelJBangMain().withPrinter(printer));
+        command.name = "kit";
+        command.version = "0.4.0";
+        command.doCall();
+
+        JsonObject plugins = 
PluginHelper.getOrCreatePluginConfig().getMap("plugins");
+        JsonObject plugin = plugins.getMap("kit");
+        
Assertions.assertEquals("io.github.luigidemasi:camel-jbang-plugin-kit:0.4.0", 
plugin.getString("dependency"));
+    }

Review Comment:
   🔹 **Nit:** Every sibling test in this class that adds a plugin asserts 
`printer.getOutput()` (e.g. `"Plugin kubernetes added"`, `"Plugin foo-plugin 
added"`). This test skips that check. Add it for consistency — it also guards 
against silent command-path failures where `doCall()` returns without printing 
anything.
   
   ```suggestion
       @Test
       public void shouldResolveKitDependencyFromKnownPlugins() throws 
Exception {
           PluginAdd command = new PluginAdd(new 
CamelJBangMain().withPrinter(printer));
           command.name = "kit";
           command.version = "0.4.0";
           command.doCall();
   
           Assertions.assertEquals("Plugin kit added", printer.getOutput());
   
           JsonObject plugins = 
PluginHelper.getOrCreatePluginConfig().getMap("plugins");
           JsonObject plugin = plugins.getMap("kit");
           
Assertions.assertEquals("io.github.luigidemasi:camel-jbang-plugin-kit:0.4.0", 
plugin.getString("dependency"));
       }
   ```



-- 
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]

Reply via email to