I try to make a junit test for apache camel route. Something like this :
@RunWith(CamelSpringJUnit4ClassRunner.class)
@ContextConfiguration(
loader = Cam
You can replace quartz2 component in your test with direct using AdviceWithRouteBuilder#replaceFromWith.
@Test
public void test() throws Exception{
//mock input route (replace quartz with direct)
context.getRouteDefinitions().get(0).adviceWith(context, new AdviceWithRouteBuilder() {
@Override
public void configure() throws Exception {
replaceFromWith("direct:triggerQuartz");
}
});
//trigger endpoint
sendBody("direct:triggerQuartz", null);
//do some assertions
}