[ 
https://issues.apache.org/activemq/browse/CAMEL-676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44034#action_44034
 ] 

Claus Ibsen commented on CAMEL-676:
-----------------------------------

Okay got it covered - I think.

In a route like this
{code}
intercept(header("foo").isEqualTo("bar")).to("mock:b").stop();
{code}

All messages that fails the predicate test (foo != bar) is now proceeded by 
default.
This is that if (foo == bar) then its routed to mock and stopped.

This is the most intuitive.

To stop all don't use a predicate.
{code}
intercept().to("mock:b").stop();
{code}

> intercept with predicate doesnt proceed as default
> --------------------------------------------------
>
>                 Key: CAMEL-676
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-676
>             Project: Apache Camel
>          Issue Type: Sub-task
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 1.4.0
>
>
> If the intercept has a predicate it seems as if it doesn't proceed by default 
> or the like.
> {code}
>     public void testInterceptor() throws Exception {
>         MockEndpoint mockTest = getMockEndpoint("mock:test");
>         mockTest.expectedBodiesReceived("Camel in Action");
>         MockEndpoint mockOk = getMockEndpoint("mock:ok");
>         mockOk.expectedBodiesReceived("Camel in Action");
>         template.sendBodyAndHeader("seda:order", "Camel in Action", "user", 
> "test");
>         mockTest.assertIsSatisfied();
>         mockOk.assertIsSatisfied();
>     }
>     protected RouteBuilder createRouteBuilder() throws Exception {
>         return new RouteBuilder() {
>             public void configure() throws Exception {
>                 // TODO: enable this with predicate instead of the one below 
> fails the unit test
>                 //intercept(header("user").isEqualTo("test")).to("mock:test");
>                 // this without predicate success
>                 intercept().to("mock:test");
>                 from("seda:order").to("mock:ok");
>             }
>         };
>     }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to