Reputation: 1291
public class MyRouteTest extends CamelSpringTestSupport {
@Override
protected AbstractApplicationContext createApplicationContext() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.scan("com.mypackage.routes");
ctx.refresh();
return ctx;
}
@Test
public void testRouteRunning() throws Exception {
assertTrue(context().getRouteStatus("direct:start").isStarted());
}
}
getRouteStatus is returning null I am following this to write my test cases
Any pointers on how to fix this will be very helpful.
Upvotes: 0
Views: 631
Reputation: 55750
You need to use the id of the route, not the url, eg "direct:start" is the url of the route, the route has an id as well. If you do not specify an id, then an id is auto assigned such as route1
, route2
etc.
Use .routeId("myNameHere")
to specify the id of a route.
Upvotes: 1