camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John <>
Subject interceptSendToEndpoint with dynamic endpoint
Date Sun, 12 Dec 2010 06:07:52 GMT


I am using camel 2.2, though I did give this a shot with 2.5

I have a route that has an http endpoint that is configured at startup. In
my route builder I have something like:

String wsUrl = "http://host/ws";


While trying to create a unit test for this route, I am adding an
interceptSendToEndpoint to direct any requests to the wsUrl endpoint to a
mock endpoint.

I am unable to get the interceptor to work as long as I have a variable in
the original route endpoint. If I replace .to(wsUrl) with
.to("http://host/ws") everything works fine in my test. The documentation
mentions that interceptSendToEndpoint should be fine with a dynamic URI.

Is there a way to use the interceptor in my test without a hard coded string
in the route endpoint?



View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message