Discussion:
@UseAdviceWith and CamelSpringRunner - Injected context is already started
Ralf Steppacher
2018-11-16 14:20:08 UTC
Permalink
Hello all,

I am trying to advice a route in a test using CamelSpringRunner and @UseAdviceWith using Camel 2.21.0. To get me started I basically  copied the contents of 

components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/mockendpoints/AdviceWithTest.java (master branch)

and re-fitted it for Spring instead of Spring Boot and some weaving that applies to my route. The test fails at the very first assertion `assertFalse(camelContext.getStatus().isStarted());` before the weaving takes place. -> The injected context is already started. When I remove the assertion for the context status the rest of the test seems to work though.

I found https://issues.apache.org/jira/browse/CAMEL-11955, which describes the same problem for SpringBoot. But in that case it was not possible to advice the routes. is there an issue with the Spring runner and @UseAdviceWith as well?


Thanks and regards,
Ralf

Loading...