[
https://issues.apache.org/jira/browse/CAMEL-13141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16879149#comment-16879149
]
Claus Ibsen commented on CAMEL-13141:
-------------------------------------
And one liner
{code}
AdviceWithRouteBuilder.adviceWith(context, "foo", a ->
a.weaveAddLast().to("mock:result"));
{code}
> camel-api - Add API for advising routes
> ---------------------------------------
>
> Key: CAMEL-13141
> URL: https://issues.apache.org/jira/browse/CAMEL-13141
> Project: Camel
> Issue Type: New Feature
> Components: came-core
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 3.0.0, 3.0.0.M4
>
>
> We should likely add a nicer API for testing camel routes with the adviceWith
> functionality. Today you have to use a RouteReifier from camel-core. We
> should make a new API in camel-api and make it with a nicer name so its
> easier to understand and use.
> {code}
> RouteReifier.adviceWith(context.getRouteDefinitions().get(0),
> context, new RouteBuilder() {
> @Override
> public void configure() throws Exception {
> // intercept sending to mock:foo and do something else
> interceptSendToEndpoint("mock:foo")
> .skipSendToOriginalEndpoint()
> .to("log:foo")
> .to("mock:advised");
> }
> });
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)