You might have to do a manual assertion after you call
mock.assertIsSatisfied(). For example,

mock.assertIsSatisfied();

Exchange exchange = mock.getExchanges().get(0);
Message in = exchange.getIn();
Map body = in.getBody(Map.class);
assertEquals...


On Fri, Dec 12, 2008 at 11:25 AM, cmoulliard <[email protected]> wrote:

>
> Hi,
>
> I would like to know it is possible to verify the content of Body with
> MockEndpoint class ?
>
> Let's me explain.
>
> Camel extracts from a CSV file its content and generates (using Smooks) a
> Map containing a collection of Java Bean Class. In my test case, I would
> like to test if one of the Java Bean object of my Map contains a certain
> value ?
>
> Here is my code where I block :
>
>        MockEndpoint mock = getMockEndpoint("mock:unmarshal");
>        mock.expectedMessageCount(1);
>        mock.message(0).body().isInstanceOf(Map.class);
>        mock.message(0).bodyAs(Map.class) ??? (how can I extract the object
> referenced in my map as CustomerList and from this list a customer object
> containing 'eleonor' as firstname)
>
> R,
>
>
>
> -----
> Charles Moulliard
> SOA Architect
>
> My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/
> --
> View this message in context:
> http://www.nabble.com/Question-concerning-MockEndpoint-and-Body---tp20977182s22882p20977182.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Jon

http://janstey.blogspot.com/

Reply via email to