Based on what I've read on Camel and route testing with mock endpoints, I would have to define the routes twice for my scenario. Once for testing and again for deployment.
I'm using Java DSL to code my routes. Is there a way to code the routes once and, somehow, configure parameters representing endpoints to point to different endpoints? Eg, doing testing, I would use mock:start and mock:results..however, when deployed, would use jbi endpoints. This change would be similar to having a property file.
An example route I'm using is:
from("jbi:endpoint:http://my.entry/http/listener")
.to("direct:content-based-routing");
from("direct:content-based-routing")
.choice()
.when().method("myBean","isTrue")
.to("direct:positive-input")
.otherwise()
.to("direct:negative-input")
.end();
from("direct:positive-input")
.to("jbi:endpoint:http://my.exit/PositiveService/Plus?mep=in-out");
from("direct:negative-input")
.to("jbi:endpoint:http://my.exit/NegativeService/Negative?mep=in-out");
You can try to use the interceptor of Camel 2.0 to configure the route once for testing and development.
And you can find some tests example in the Camel In Action