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


##########
dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/BeansTabRenderTest.java:
##########
@@ -74,6 +75,32 @@ void renderShowsNoBeans() {
         assertTrue(rendered.contains("No beans"), "Should show 'No beans' when 
no bean data is loaded");
     }
 
+    @Test
+    void theBeansOfTheIntegrationComeFirst() {
+        BeansTab tab = new BeansTab(ctx);
+        tab.allBeans = List.of(bean("global-variable-repository", 
"org.apache.camel.impl.engine.GlobalVariableRepository"),
+                bean("DependencyDownloaderStrategy", 
"org.apache.camel.main.download.DependencyDownloaderStrategy"));
+
+        // none of its own: the table says so, and how to see the ones of Camel
+        String rendered = TuiTestHelper.renderToString(tab, 120, 20);
+        assertTrue(rendered.contains("scope:user"), rendered);
+        assertTrue(rendered.contains("No beans of its own: f shows the 2 of 
Camel"), rendered);
+        assertEquals("user", tab.getTableDataAsJson().getString("scope"));
+        assertEquals(2, tab.getTableDataAsJson().getInteger("allBeans"));
+
+        tab.allBeans = List.of(tab.allBeans.get(0), bean("orderService", 
"com.acme.OrderService"));
+        rendered = TuiTestHelper.renderToString(tab, 120, 20);
+        assertTrue(rendered.contains("orderService"), rendered);
+        assertTrue(!rendered.contains("global-variable-repository"), rendered);

Review Comment:
   💡 **Nit:** `assertTrue(!x)` has a less helpful failure message than 
`assertFalse(x, message)`. On failure, `assertTrue(!...)` just says "expected 
true" with no context — `assertFalse` prints the failed condition.
   
   ```suggestion
           assertFalse(rendered.contains("global-variable-repository"), 
rendered);
   ```



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