[
https://issues.apache.org/jira/browse/CAMEL-8327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-8327.
--------------------------------
Resolution: Fixed
Thanks for reporting. As a workaround you can use any of the other weaveBy to
match the choice, such as by id = choice1
> 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, 2.14.1
> Reporter: Jamie goodyear
> Assignee: Claus Ibsen
> Priority: Minor
> 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)