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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.