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

   Hi @Croway, thanks for the direction!
   
   I've added a test in my fork:  
   
https://github.com/apache/camel-spring-boot/compare/main...vilmosnagy:camel-spring-boot:vilmos/testing-wildcard-globs
   
   My understanding is that this bug is only triggered when Camel is run via 
`java -jar`. All tests in my production project pass when run with the Maven 
Surefire Plugin using glob matchers, and the issue only appears when starting 
the application on Kubernetes.
   
   From debugging, it seems that when running with Surefire, 
`file.isDirectory()` returns `true` here:  
   
https://github.com/apache/camel/blob/main/core/camel-support/src/main/java/org/apache/camel/support/scan/DefaultPackageScanResourceResolver.java#L165-L168
  
   which causes a different code path to be executed.
   
   The only way I was able to reproduce the faulty behavior was:
   - adding a new module called `test-resources-in-jar` and placing the route 
there  
   - adding this module as a test-scoped dependency to the `camel-spring-boot` 
module  
   - running the tests via the Maven CLI (in this case, they fail)
   
   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.
   
   If you have a better idea for reproducing this, please let me know. Also, 
`camel-observation-starter` has failing tests on my machine on the `main` 
branch, so I’m not entirely sure all tests ran successfully—but as far as I can 
tell, my change resolves this issue.


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