Frank Wippermüller created CAMEL-16082:
------------------------------------------

             Summary: Single choice() without otherwise() always executed
                 Key: CAMEL-16082
                 URL: https://issues.apache.org/jira/browse/CAMEL-16082
             Project: Camel
          Issue Type: Bug
          Components: came-core
    Affects Versions: 3.7.1, 3.7.0
            Reporter: Frank Wippermüller
         Attachments: SimpleChoiceTest.java

When building a route including a choice with a single {{when()}} and without 
an {{otherwise()}}, the first {{SimpleExpression}}-{{when()}} is always 
satisfied:

{code:java}
from("direct:start")
    .choice()
        .when().simple(expression)
                       // always routed to
                       .to(whenTarget)
    .end()
    .to(end)
{code}

An empty {{otherwise()}} restores choice logic:

{code:java}
from("direct:start")
        .choice()
                .when().simple(expression).to(whenTarget)
        .otherwise()
    .end()
        .to(end)
{code}

I included a simple Test-Case that *fails with Camel 3.7.x* and *passes with 
Camel 3.6.x*.





--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to