camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fordm <>
Subject Mocking an endpoint within a try-catch block
Date Thu, 07 Feb 2013 09:40:51 GMT

Using Camel 2.10, I'm writing a test for the following camel route,
contained in a blueprint:

<route id="myRoute">
  <from uri="direct:sendEmail"/>
    <log message="The message contains ${body}"/>
    <to id="smtpEndpoint" uri="smtp://localhost:25" />
      <log message="Exception caught when processing email request" />
      <log message="Email Response processed ${body}" />

If the smtpEndpoint is outside the doTry then I can happily mock the
endpoint using adviceWith (and weaveById).

However, if the smtpEndpoint is inside the doTry mocking the endpoint with
adviceWith fails (the test tries to connect to a SMTP server on

Is there something I'm missing or is it just not possible to mock endpoints
within a doTry (which I find hard to believe).


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

View raw message