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.