RoutesDefinition routes = resource.getRoutesResource().getRouteDefinitions();
List<RouteDefinition> list = routes.getRoutes();
Object exchangesCompleted = statistics.getRouteStatistic(camelContext, list.get(0).getId(), "ExchangesCompleted");
assertEquals("JMX value incorrect, should be 0", new Long(0), exchangesCompleted);
NotifyBuilder notify = new NotifyBuilder(camelContext).whenDone(1).create();
ProducerTemplate template = camelContext.createProducerTemplate();
template.sendBody("seda:foo", "test");
notify.matchesMockWaitTime();
exchangesCompleted = statistics.getRouteStatistic(camelContext, list.get(0).getId(), "ExchangesCompleted");
assertEquals("JMX value incorrect, should be 1", new Long(1), exchangesCompleted);
}