Camel Test throwing UnsupportedOperation when route have a ChoiceDefinition in Fuse

Solution Verified - Updated -

Issue

  • While running a camel route test we get an UnsupportedOperationException, if we use the method weaveAddLast from the class AdviceWithRouteBuilder and my route has a ChoiceDefinition.
  • We have the this code as below,
 context.getRouteDefinition("choiceTestRoute").adviceWith(context, new AdviceWithRouteBuilder() {

            @Override
            public void configure() throws Exception {

                weaveAddLast().to("mock:endpoint");

            }
        });

        MockEndpoint mockEndpoint = getMockEndpoint("mock:endpoint");
        mockEndpoint.expectedMessageCount(1);

        context.start();

        producerTemplate.sendBody("direct:start", Integer.valueOf(1));

        assertMockEndpointsSatisfied();

Environment

  • Red Hat JBoss Fuse
    • 6.x
  • Apache Camel

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content