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 159d919209a8 chore: camel-smb - fix 
SmbConsumerStartingDirectoryMustExistIT for route-start exception wrapping 
(#25903)
159d919209a8 is described below

commit 159d919209a8648df9a3f5d9b0634606af84b224
Author: Claus Ibsen <[email protected]>
AuthorDate: Sun Aug 30 15:56:37 2026 +0200

    chore: camel-smb - fix SmbConsumerStartingDirectoryMustExistIT for 
route-start exception wrapping (#25903)
    
    CAMEL-24404 (#25554) made InternalRouteStartupManager always wrap consumer
    startup failures in FailedToStartRouteException. This test still caught the
    raw GenericFileOperationFailedException around context.start(), so it no
    longer matched and the test failed on every CI run since that change merged.
    
    Assert on FailedToStartRouteException with the original exception as cause,
    matching how the other consumer-startup tests were updated for CAMEL-24404.
    
    Co-Authored-By: Claude Sonnet 5 <[email protected]>
---
 components/camel-smb/pom.xml                              |  5 +++++
 .../smb/SmbConsumerStartingDirectoryMustExistIT.java      | 15 +++++++--------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/components/camel-smb/pom.xml b/components/camel-smb/pom.xml
index 430b2083260d..5642dcd6931e 100644
--- a/components/camel-smb/pom.xml
+++ b/components/camel-smb/pom.xml
@@ -72,6 +72,11 @@
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
 </project>
diff --git 
a/components/camel-smb/src/test/java/org/apache/camel/component/smb/SmbConsumerStartingDirectoryMustExistIT.java
 
b/components/camel-smb/src/test/java/org/apache/camel/component/smb/SmbConsumerStartingDirectoryMustExistIT.java
index eebf62bc49f2..7a630d2a81e9 100644
--- 
a/components/camel-smb/src/test/java/org/apache/camel/component/smb/SmbConsumerStartingDirectoryMustExistIT.java
+++ 
b/components/camel-smb/src/test/java/org/apache/camel/component/smb/SmbConsumerStartingDirectoryMustExistIT.java
@@ -16,11 +16,12 @@
  */
 package org.apache.camel.component.smb;
 
+import org.apache.camel.FailedToStartRouteException;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.file.GenericFileOperationFailedException;
-import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
 public class SmbConsumerStartingDirectoryMustExistIT extends 
SmbServerTestSupport {
 
     @Override
@@ -42,12 +43,10 @@ public class SmbConsumerStartingDirectoryMustExistIT 
extends SmbServerTestSuppor
                 from(getSbmUrl()).to("mock:result");
             }
         });
-        try {
-            context.start();
-            Assertions.fail();
-        } catch (GenericFileOperationFailedException e) {
-            Assertions.assertEquals("Starting directory does not exist: 
doesnotexist", e.getMessage());
-        }
+
+        assertThatThrownBy(context::start)
+                .isInstanceOf(FailedToStartRouteException.class)
+                .cause().hasMessage("Starting directory does not exist: 
doesnotexist");
     }
 
 }

Reply via email to