On Thu, Feb 7, 2013 at 11:06 AM, fordm <ford.j.mar...@gmail.com> wrote: > I simply use > > context.getRouteDefinition(routeId).adviceWith(context, > new AdviceWithRouteBuilder() { > @Override > public void configure() { > weaveById(endpointId).selectFirst().replace().to(newUri); > } > }); >
Have you tried with weaveById(endpointId).replace().to(newUri); > Debugging the test I can see that the the endpoint IS being mocked: > > AdviceWithTasks INFO AdviceWith (smtpEndpoint) : > [To[smtp://localhost:25]] --> replace [pipeline -> [[To[mock:send]]]] > > But later in the debug output I find that the mock is not being used: > > DefaultComponent DEBUG Creating endpoint > uri=[smtp://localhost:25], path=[localhost:25], parameters=[{}] > BlueprintCamelContext DEBUG smtp://localhost:25 converted to > endpoint: Endpoint[smtp://localhost:25] by component: > org.apache.camel.component.mail.MailComponent@56e2aeb0 > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Mocking-an-endpoint-within-a-try-catch-block-tp5727081p5727089.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen