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:

from(SEDA_TEST).
setHeader("CamelHttpMethod", constant("POST")).
to("https4://localhost:8090/services/MYSERVICE?q=ssl").
to("seda:mock");
                                
from("seda:mock").
streamCaching().
convertBodyTo(String.class, "UTF-8").
to(MOCK_ENDPOINT);

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
file.

So why do I get a empty message back from
"to("https4://localhost:8090/services/MYSERVICE?q=ssl")."?

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: 
http://camel.465427.n5.nabble.com/Testing-MockEndpoint-has-sometimes-a-Message-and-sometimes-not-tp5157327p5157327.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to