You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by James Green <ja...@gmail.com> on 2015/03/02 11:27:48 UTC

Test body mutation

I need to check that an object is mutated by a route properly.

The testing.html page does not show this - only that the message passed
through routes as expected. I'm downloading the camel sources now - is
there a good test class that demonstrates this?

Thanks,

James

Re: Test body mutation

Posted by Andrew Block <an...@gmail.com>.
James,

You can use the Mock component [1] to validate the functionality of your route including the content of the message body. In your unit test, you can also utilize AdviceWith [2] to modify your route to inject the Mock component to keep your Production routes clear of test components 

[1] - http://camel.apache.org/mock.html
[2] - http://camel.apache.org/advicewith.html

- Andy
-- 
Andrew Block
M: (716) 870-2408

On March 2, 2015 at 4:36:03 AM, James Green (james.mk.green@gmail.com) wrote:

Or am I being silly - is it really as simple as asserting that the endpoint  
got the message,then doing simple JUnit assertions on the body sent in to  
check it is now as expected?  

(Brain somewhat stuck in asynchronous routes at the moment.)  

On 2 March 2015 at 10:27, James Green <ja...@gmail.com> wrote:  

> I need to check that an object is mutated by a route properly.  
>  
> The testing.html page does not show this - only that the message passed  
> through routes as expected. I'm downloading the camel sources now - is  
> there a good test class that demonstrates this?  
>  
> Thanks,  
>  
> James  
>  
>  

Re: Test body mutation

Posted by James Green <ja...@gmail.com>.
Or am I being silly - is it really as simple as asserting that the endpoint
got the message,then doing simple JUnit assertions on the body sent in to
check it is now as expected?

(Brain somewhat stuck in asynchronous routes at the moment.)

On 2 March 2015 at 10:27, James Green <ja...@gmail.com> wrote:

> I need to check that an object is mutated by a route properly.
>
> The testing.html page does not show this - only that the message passed
> through routes as expected. I'm downloading the camel sources now - is
> there a good test class that demonstrates this?
>
> Thanks,
>
> James
>
>