camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Wulff <>
Subject Sprint Unit test fails when OnCompletion configured
Date Fri, 27 Oct 2017 14:12:04 GMT
Hi all

I've got a very simple route which reads from a file, does some processing and then sends
it by mail. I've also created a unit test based on CamelSpringTestSupport where I mock the
smtp endpoint and update the consuming endpoint:

         protected void doPostSetup() throws Exception {

               context.getRouteDefinition(ROUTE_ID).adviceWith(context, new AdviceWithRouteBuilder()
                    public void configure() throws Exception {
                        weaveAddLast().log(LoggingLevel.DEBUG, "End: ${body}");


    public String isMockEndpointsAndSkip() {
        return "smtp*";

This is the route:

            <to uri="jms:topic:MON?disableReplyTo=true" />

        <route id="email-deliver">
            <from uri="file://{{src.folder}}?include=.*.xml" />
                <jaxb contextPath=""/>
            <process ref="dummy" />
            <to uri="smtp://{{smtp.hostname}}?contentType=text/html" />

When I run the maven project without <onCompletion> it works but if I activate <onCompletion>
it fails with the following error:

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.577 sec <<< FAILURE!
- in
testSendingMail(  Time elapsed: 4.514 sec  <<< ERROR!
java.lang.IllegalArgumentException: There are no outputs which matches: * in the route: Route(email-deliver)[[From[direct:teststart]]
-> [onCompletion[[To[jms:topic:MON?disableReplyTo=true]]], Unmarshal[org.apache.camel.model.dataformat.JaxbDataFormat@7ea08277],
process[ref:dummy], To[smtp://{{smtp.hostname}}?contentType=text/html]]]
        at org.apache.camel.builder.AdviceWithTasks$3.task(
        at org.apache.camel.model.RouteDefinition.adviceWith(

Results :

Tests in error:
  CamelRouteTest>CamelTestSupport.setUp:240->doPostSetup:37 ยป IllegalArgument Th...

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0

I've searched in the internet for this error "There are no outputs which matches: *" but haven't
found anything which explains why I've discovered this behaviour.

What do I have to change to fix the unit test.

Thanks for your feedback


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message