This is an automated email from the ASF dual-hosted git repository.

apupier 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 784613d119c Add an assertion predicate after calling as AssertJ method.
784613d119c is described below

commit 784613d119c9ad065f590bd1492b60fab2af5c31
Author: AurĂ©lien Pupier <[email protected]>
AuthorDate: Mon Jun 17 13:30:40 2024 +0200

    Add an assertion predicate after calling as AssertJ method.
    
    Describing, setting error message or adding a comparator in AssertJ must
    be done before calling the assertion, otherwise, settings will not be
    taken into account.
    
    as reported by Sonar:
    
https://sonarcloud.io/project/issues?impactSeverities=MEDIUM&resolved=false&rules=java%3AS5833&types=BUG&id=apache_camel&open=AY09HX_CckbFrvopLnIW
    
    Signed-off-by: AurĂ©lien Pupier <[email protected]>
---
 .../test/java/org/apache/camel/dsl/jbang/it/RunCommandITCase.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/RunCommandITCase.java
 
b/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/RunCommandITCase.java
index 0d45346d17b..2b2cbf24347 100644
--- 
a/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/RunCommandITCase.java
+++ 
b/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/RunCommandITCase.java
@@ -131,10 +131,10 @@ public class RunCommandITCase extends JBangTestSupport {
     public void runDownloadedInDirectoryFromGithubTest() {
         execute("init 
https://github.com/apache/camel-kamelets-examples/tree/main/jbang/dependency-injection
 --directory="
                 + mountPoint());
-        Assertions.assertThat(Paths.get(getDataFolder()).toFile().listFiles())
+        Assertions.as("custom route directory")
+                .assertThat(Paths.get(getDataFolder()).toFile().listFiles())
                 .extracting("name")
-                .containsExactlyInAnyOrder("Echo.java", "Hello.java", 
"README.adoc", "application.properties")
-                .as("custom route directory");
+                .containsExactlyInAnyOrder("Echo.java", "Hello.java", 
"README.adoc", "application.properties");
         executeBackground(String.format("run %s/*", mountPoint()));
         checkLogContains("JackJack!! from Echo");
     }

Reply via email to