You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by wjmcdonald <wi...@transcentra.com> on 2012/08/03 00:44:22 UTC

withAdvice mocks all routes, not just first route

I was trying to mock the endpoint that all my test routes funnel into
("outPoint") by using adviceWith.  

The  http://camel.apache.org/advicewith.html 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?

http://camel.465427.n5.nabble.com/file/n5716723/RouteAdviceTest.java
RouteAdviceTest.java 



--
View this message in context: http://camel.465427.n5.nabble.com/withAdvice-mocks-all-routes-not-just-first-route-tp5716723.html
Sent from the Camel - Users mailing list archive at Nabble.com.