I am writing a test for Camel using Spring boot. Below is configuration on the test class
@RunWith(CamelSpringBootRunner.class)
@SpringBootApplication
@ComponentScan(basePackages = ["example.test"])
@UseAdviceWith
@BootstrapWith(SpringBootTestContextBootstrapper)
@DirtiesContext
class RouteTest {
private static final Logger LOGGER = LoggerFactory.getLogger(RouteTest.class)
@Autowired ModelCamelContext camelContext
@Test
void "flow"() {
camelContext.getRouteDefinition(route.routeId).adviceWith(camelContext, new AdviceWithRouteBuilder() {
@Override
void configure() throws Exception {
}
}
LOGGER.info("IN TEST: ******* Camel Status: "+camelContext.getStatus())
}
I expect camel should not be started. But when I run the test it is already started.
I noticed that CamelSpringBootRunner does start camel context in CamelSpringBootExecutionListener.
How do I force not to start the camel context.