camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Feldmann <>
Subject Testing: MockEndpoint has sometimes a Message and sometimes not
Date Thu, 19 Jan 2012 10:38:00 GMT
Hallo everbody,

currently I am using JUnit-tests for testing purposes.

In my project I have a route with a software-proxy (Jetty) and then some
webservices. That part is working very well. The software-proxy/webservices
respond with the according messages, when I use SOAP-UI.

Now I tried to construct a test-route in a JUnit-test.

It looks like that:

setHeader("CamelHttpMethod", constant("POST")).
convertBodyTo(String.class, "UTF-8").

I have constructed several tests where I send a message with:

template.sendBody(SEDA_TEST, testFileAsString);

And then I check the MOCK_ENDPOINT via "expectedMessagesMatches", if my
expected response is available.

This works fine with some tests. But some tests fail very often, because the
response is empty. The problem confuses me even more, because the
"production-route" logs every time a message with the correct response as a

So why do I get a empty message back from

I also have to mention, that sometimes there is message and sometimes the
message is empty.

What do you think?

Thanks for any suggestions!

Best regards,

Andreas Feldmann

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message