This is an automated email from the ASF dual-hosted git repository.
fmariani pushed a commit to branch camel-4.14.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-4.14.x by this push:
new 635ce9278387 chore: use regex patterns in VersionListTest assertions
635ce9278387 is described below
commit 635ce9278387d442dc5e744351f2d9e6eac9d334
Author: Croway <[email protected]>
AuthorDate: Fri Apr 3 14:56:08 2026 +0200
chore: use regex patterns in VersionListTest assertions
The hardcoded spacing in contains() breaks when new releases
change column widths. Use containsPattern() with \s+ instead.
---
.../camel/dsl/jbang/core/commands/version/VersionListTest.java | 9 +++++----
1 file changed, 5 insertions(+), 4 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 db31bd9de628..52f93785b29c 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
@@ -37,9 +37,10 @@ class VersionListTest extends CamelCommandBaseTest {
List<String> lines = printer.getLines();
// 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");
+ String output = lines.stream().collect(Collectors.joining("\n"));
+ Assertions.assertThat(output)
+ .containsPattern("4\\.14\\.1\\s+3\\.5\\.6\\s+17,21\\s+LTS")
+ .containsPattern("4\\.15\\.0\\s+3\\.5\\.6\\s+17,21");
}
@Test
@@ -52,7 +53,7 @@ class VersionListTest extends CamelCommandBaseTest {
List<String> lines = printer.getLines();
Assertions.assertThat(lines.stream().collect(Collectors.joining("\n")))
- .contains("4.14.0 3.27.0 17,21 LTS");
+ .containsPattern("4\\.14\\.0\\s+3\\.27\\.0\\s+17,21\\s+LTS");
}
}