> I'd like to mock a message to control its internals variables.
> Do you think it's not a good idea ?
>
> I taught it could be pretty useful to be able to check the content of a
> message.

You can do it anyway with Message interface and DefaultMessage [1]
class. You can retrieve headers and body. You can also set these
variables with setters, so there is no need to mock the message for
that purpose :) .

> As I understand, it could give some random results due to hidden Camel
> process ?

At least verification of interactions (which is the key feature of
Mockito) will not work as you may expect.

I'm Mockito freak myself, but believe me that capturing exchanges with
Mock component is more than enough to create comprehensive suit of
test for Camel routes :) .

Best regards.

[1] 
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/impl/DefaultMessage.html

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com

Reply via email to