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


##########
dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/ActionsPopupTest.java:
##########
@@ -40,6 +40,8 @@ void 
menuLabelsResolveToActionsIgnoringCaseEllipsisAndShortcutHints() {
         assertEquals(ActionsPopup.Action.RUN_INFRA, 
ActionsPopup.actionForLabel("Run Dev/Infra Service..."));
         assertEquals(ActionsPopup.Action.TAPE_RECORDING, 
ActionsPopup.actionForLabel("Stop Tape Recording"));
         assertEquals(ActionsPopup.Action.SHOW_KEYSTROKES, 
ActionsPopup.actionForLabel("Hide Keystrokes"));
+        assertEquals(ActionsPopup.Action.QUIT, 
ActionsPopup.actionForLabel("Quit"));
+        assertEquals(ActionsPopup.Action.QUIT, 
ActionsPopup.actionForLabel("exit"));

Review Comment:
   **[low] Missing execution test for the `quitAction` Runnable path.**
   
   The two new assertions verify label → `Action.QUIT` resolution (the static 
`actionForLabel` switch), but neither `executeActionByName("quit")` nor the 
`handleMenuKeys` QUIT branch is exercised. The test class is in the same 
package, so wiring a `Runnable` and asserting it fires is straightforward:
   
   ```java
   @Test
   void quitActionIsInvokedByExecuteActionByName() {
       ActionsPopup popup = new ActionsPopup(/* minimal deps */);
       var called = new java.util.concurrent.atomic.AtomicBoolean();
       popup.setQuitAction(() -> called.set(true));
       assertTrue(popup.executeActionByName("quit"), "executeActionByName 
should return true for QUIT");
       assertTrue(called.get(), "quitAction Runnable must be called");
   }
   ```
   
   Without this, a regression that breaks the `quitAction.run()` call would 
pass CI undetected.



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