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


The following commit(s) were added to refs/heads/main by this push:
     new c5a1a277c928 Make VersionTest assertion relaiable (#20781)
c5a1a277c928 is described below

commit c5a1a277c92860cf7851ded2a14f6e7d325e02d1
Author: Federico Mariani <[email protected]>
AuthorDate: Mon Jan 12 17:14:40 2026 +0100

    Make VersionTest assertion relaiable (#20781)
---
 .../jbang/core/commands/version/VersionListTest.java   | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/version/VersionListTest.java
 
b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/version/VersionListTest.java
index 851f5970144c..2a7677843775 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/version/VersionListTest.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/version/VersionListTest.java
@@ -36,10 +36,12 @@ class VersionListTest extends CamelCommandBaseTestSupport {
         versionList.doCall();
 
         List<String> lines = printer.getLines();
+        // normalize multiple spaces to single space to avoid failures due to 
column width changes
+        String output = 
normalizeSpaces(lines.stream().collect(Collectors.joining("\n")));
         // there was a change where the information is stored in 4.15, thus 
the test on 4.14.1 and 4.15.0
-        Assertions.assertThat(lines.stream().collect(Collectors.joining("\n")))
-                .contains("4.14.1         3.5.6     17,21   LTS")
-                .contains("4.15.0         3.5.6     17,21");
+        Assertions.assertThat(output)
+                .contains("4.14.1 3.5.6 17,21 LTS")
+                .contains("4.15.0 3.5.6 17,21");
     }
 
     @Test
@@ -51,8 +53,14 @@ class VersionListTest extends CamelCommandBaseTestSupport {
         versionList.doCall();
 
         List<String> lines = printer.getLines();
-        Assertions.assertThat(lines.stream().collect(Collectors.joining("\n")))
-                .contains("4.14.0       3.27.0    17,21   LTS");
+        // normalize multiple spaces to single space to avoid failures due to 
column width changes
+        String output = 
normalizeSpaces(lines.stream().collect(Collectors.joining("\n")));
+        Assertions.assertThat(output)
+                .contains("4.14.0 3.27.0 17,21 LTS");
+    }
+
+    private static String normalizeSpaces(String input) {
+        return input.replaceAll("\\s+", " ");
     }
 
 }

Reply via email to