vilmosnagy commented on PR #22788:
URL: https://github.com/apache/camel/pull/22788#issuecomment-4356957714

   I hope this is the test you were thinking of: 
https://github.com/apache/camel-spring-boot/pull/1773
   
   At first, I tried to write a test similar to the existing ones in the 
`camel-itest-spring-boot` module. As far as I understand, they don’t use the 
`@SpringBootTest` annotation (or other Spring Boot testing features). Instead, 
they generate a temporary Maven project and bootstrap a Spring Boot application 
from the built artifacts of that project.
   
   I wasn’t able to write a similar test for loading XML routes from another 
module, because the `test-resources-in-jar` JAR would not be accessible from 
the generated Maven project in that setup.
   
   In the end, I moved my previous attempt to the `tests` module and added 
test-scoped dependencies to the `camel-itest-spring-boot` module. This allows 
running tests annotated with `@SpringBootTest`.
   
   I’m not fully happy with this solution, but I don’t see a better alternative 
at the moment. This still applies from my previous comment:
   
   > Interestingly, my JetBrains IDE seems to use a different classloading 
approach and still loads these resources directly from the filesystem rather 
than from the JAR, so the issue does not appear there.


-- 
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