This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit bb11eb4e1cf0d125f50915a1dc103be215bf8550 Author: Claus Ibsen <[email protected]> AuthorDate: Tue Jul 28 09:44:36 2026 +0200 camel-tui: Remove fragile tab shortcut and count tests The hardcoded shortcut sequence and tab count tests break every time a tab is added or renamed. Since duplicate shortcut keys are allowed by design, these tests provide little value. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../jbang/core/commands/tui/TabRegistryTest.java | 30 ---------------------- 1 file changed, 30 deletions(-) diff --git a/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/TabRegistryTest.java b/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/TabRegistryTest.java index ff21cdec6050..4594d1495664 100644 --- a/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/TabRegistryTest.java +++ b/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/TabRegistryTest.java @@ -80,11 +80,6 @@ class TabRegistryTest { }); } - @Test - void moreTabsHasTwentySevenEntries() { - assertEquals(31, registry.moreTabs().size()); - } - @Test void everyMoreTabLabelHasMnemonicMarker() { for (TabRegistry.MoreTab mt : registry.moreTabs()) { @@ -102,31 +97,6 @@ class TabRegistryTest { } } - @Test - void moreTabShortcutsMatchHistoricalSequence() { - // Independent oracle (not a re-derivation of shortcut()): these are the exact letters the hand-maintained - // MORE_SHORTCUTS array carried before the MoreTab refactor. A label edit that repoints a key must fail here. - List<Character> shortcuts = registry.moreTabs().stream().map(TabRegistry.MoreTab::shortcut).toList(); - assertEquals( - List.of('B', 'C', 'H', 'I', 'P', 'R', 'C', 'H', 'M', 'N', 'E', 'T', 'O', 'J', 'K', 'Q', 'Q', 'C', 'M', 'M', - 'M', 'P', 'S', 'T', 'B', 'C', 'C', 'V', 'M', 'Y', 'F'), - shortcuts, "More tab shortcut letters must match the historical sequence"); - } - - @Test - void moreTabShortcutsHaveReasonableGroupSizes() { - // Duplicate mnemonics are allowed; the popup cycles through them on repeated key press. - // Natural first-letter mnemonics create groups of up to 5 (e.g. C, M) which is acceptable. - List<Character> shortcuts = registry.moreTabs().stream().map(TabRegistry.MoreTab::shortcut).toList(); - java.util.Map<Character, Long> counts = shortcuts.stream() - .collect(java.util.stream.Collectors.groupingBy(c -> c, java.util.stream.Collectors.counting())); - for (var entry : counts.entrySet()) { - assertTrue(entry.getValue() <= 5, - "More tab shortcut '" + entry.getKey() + "' appears " + entry.getValue() - + " times (max 5): " + shortcuts); - } - } - @Test void moreTabRejectsLabelWithoutUsableMnemonicMarker() { // The record's compact constructor enforces the '&'-before-a-letter invariant that shortcut() relies on,
