davsclaus opened a new pull request, #25903:
URL: https://github.com/apache/camel/pull/25903

   ## Summary
   
   `SmbConsumerStartingDirectoryMustExistIT.testStartingDirectoryMustExist` has 
been failing on `main` since CAMEL-24404 (#25554) merged. That change made 
`InternalRouteStartupManager.doStartOrResumeRouteConsumers()` always wrap 
consumer startup failures in `FailedToStartRouteException`.
   
   This test still did:
   
   ```java
   try {
       context.start();
       Assertions.fail();
   } catch (GenericFileOperationFailedException e) {
       ...
   }
   ```
   
   Since `context.start()` now throws `FailedToStartRouteException` (wrapping 
the original `GenericFileOperationFailedException` as its cause), the `catch` 
clause no longer matched, so the exception propagated uncaught and the test 
failed with an error on every run — spotted as a CI failure on an unrelated PR 
(#25892).
   
   `#25554` already updated 7 other modules for this same wrapping change 
(`DefaultSupervisingRouteControllerTest`, `MainSupervisingRouteControllerTest`, 
`AiToolEndpointLifecycleTest`, etc.) but missed this SMB test since it lives 
outside that PR's scope.
   
   ## Fix
   
   Rewritten with AssertJ's `assertThatThrownBy`, asserting 
`FailedToStartRouteException` as the outer type and checking the original 
message via `.cause()`, matching the pattern used for the other tests updated 
by CAMEL-24404. `assertj-core` was added as a test dependency to 
`camel-smb/pom.xml` (version centrally managed in the parent POM) since it 
wasn't previously present in this module.
   
   I checked the rest of `camel-smb`'s tests for the same `try { 
context.start(); fail(); } catch (...)` pattern — this was the only one 
affected.
   
   ## Test plan
   
   - [x] `mvn -o compile test-compile` in `components/camel-smb` — compiles 
clean
   - [x] `mvn -o verify -Dit.test=SmbConsumerStartingDirectoryMustExistIT` — 
passes
   - [x] `mvn formatter:format impsort:sort` — no changes needed
   
   _Claude Code on behalf of davsclaus_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to