1
我有一個駱駝航線它看起來是這樣的:測試路線在Apache的駱駝
public class CamelReaderRoute extends RouteBuilder {
@Override
public void configure() throws Exception {
from("quartz://myjob?cron=0+0/5+*+*+*+?")
//....(some more content)
.routeId("MyCamelRoute");
}
基本上石英「觸發」的路線,每五分鐘。當單元測試這條路線時,除非時間正好是00:00或00:05或00:10等,否則它不會發射。等等。
那麼如何更改「from」中使用的端點,以便該路線立即着火? 這是迄今爲止我的測試類:
public class CamelRouteTest extends CamelTestSupport {
@Test
public void shall_run_the_route_or_something() {
context.getRouteDefinition("MyCamelRoute")
.adviceWith(context, new AdviceWithRouteBuilder() {
@Override
public void configure() throws Exception {
//something should be done here?
}
});
我可以看到,在駱駝2.9我可以用我的replaceFromWith配置方法中,但由於依賴和某某,我堅持用駱駝2.8。他們是否有任何形式的替換?從2.9之前?