camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAMEL-8327) ContextTestSupport does not support weaveByType in test cases
Date Tue, 10 Feb 2015 06:14:35 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-8327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Claus Ibsen updated CAMEL-8327:
-------------------------------
    Fix Version/s: 2.15.0

> ContextTestSupport does not support weaveByType in test cases
> -------------------------------------------------------------
>
>                 Key: CAMEL-8327
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8327
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.13.3
>            Reporter: Jamie goodyear
>             Fix For: 2.13.4, 2.14.2, 2.15.0
>
>
> Update AdviceWithTypeTest test class to contain the below. On Camel-2.13.2 and below
the test case would pass, on 2.13.3 and above the test case fails.
> {code:title=AdviceWithTypeTest.java|borderStyle=solid}
>     public void testUnknownType2() throws Exception {
>        
>         context.getRouteDefinitions().get(0).adviceWith(context, new AdviceWithRouteBuilder()
{
>             @Override
>             public void configure() throws Exception {
>                 weaveByType(ChoiceDefinition.class).replace().to("mock:baz");
>             }
>         });
>        
>         getMockEndpoint("mock:baz").expectedMessageCount(1);
>         template.sendBody("direct:start", "World");
>         assertMockEndpointsSatisfied();
>     }
>  
>  
>     @Override
>     protected RouteBuilder createRouteBuilder() throws Exception {
>         return new RouteBuilder() {
>             @Override
>             public void configure() throws Exception {
>                 // START SNIPPET: e5
>                 from("direct:start")
>                     .transform(simple("Hello ${body}"))
>                     .log("Got ${body}")
>                     .to("mock:result")
>                     .choice()
>                     .when(header("foo").isEqualTo("bar"))
>                        .to("mock:resultA")
>                     .otherwise()
>                        .to("mock:resultB");
>                 // END SNIPPET: e5
>             }
>         };
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message