camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wjmcdonald <>
Subject withAdvice mocks all routes, not just first route
Date Thu, 02 Aug 2012 22:44:22 GMT
I was trying to mock the endpoint that all my test routes funnel into
("outPoint") by using adviceWith.  

The documentation  (at the bottom)
has this example:

It uses the first object (Route) in the RouteDefinitions collection because
it calls get(0).

I then tried to use this to mock my outPoint:

In the CamelInAction book, regarding adviceWith, it says "If you have
multiple routes, you’ll need to select the correct route to be used."  

In the example, it appears that only the first route will have the endpoint
'outURI' mocked.  But in the attached code, it shows that the test has
mocked both routes even though I only referred to the first one (ie. get(0)
above).  Ironically, this is what I wanted, but it doesn't seem to align
with the book's comment.  

Can you explain this discrepancy? 

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

View raw message