K.. let's start with this, which works... how is your route different? https://github.com/christian-posta/camel-sandbox/blob/master/one-off/src/test/java/posta/TestMockExceptions.java
On Fri, May 24, 2013 at 5:45 AM, dancerjohn <[email protected]>wrote: > I am attempting to use a MockEndpoint to drive Exception testing. I have > configured the MockEndpoint as follows: > > mockEndpoint.whenAnyExchangeReceived(new Processor(){ > > public void process(Exchange ago0) throws Exception{ > System.out.println("here"); > throw new RuntimeException("blah"); > } > }); > > When I run my test I see the "here" on the console / log but I don't see > any > error messages related to the Exception. I believe this route is currently > using the DefaultErrorHandler (bit complicated because the test hits > multiple routes in multiple contexts) as I do not have any error handlers > configured. I have some onException logic in place which I am trying to > exercise but those are not being hit either. > > If instead I use adviceWith to throw the same exception at the same point > (intercepting on same URI to which the MockEndpoint is linked) it works as > expected (Exception is thrown and logged by Camel). > > Why is the Exception not being propagated out of MockEndpoint? > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Using-MockEndpoint-to-throw-an-Exception-not-propated-tp5733088.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- *Christian Posta* http://www.christianposta.com/blog twitter: @christianposta
