Hi

Yeah as James writes the expects *must* be set before you do start
send exchanges into Camel.

The send method is probably in a sync route so the exchange has
finished routing when you in the next codeline set the expected body.


On Wed, Jan 14, 2009 at 4:48 PM, James Strachan
<james.strac...@gmail.com> wrote:
> 2009/1/14 cmoulliard <cmoulli...@gmail.com>:
>>
>> The error is solved.
>>
>> Question :
>>
>> Why the template.sendBody(Object) must be placed in the code after the
>> MockEndpoint.expectedBodiesReceived() and not the inverse ?
>>
>> this code works :
>>
>>        resultEndpoint.expectedBodiesReceived(result);
>>        template.sendBody(generateModel());
>>
>> Not this one
>>
>>        template.sendBody(generateModel()
>>        resultEndpoint.expectedBodiesReceived(result);
>
> Up to now we've been assuming you setup the expectations before
> running your route. It could be MockEndpoint needs further patches to
> ensure it can cope with expectations being added after messages arrive
> on it
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://fusesource.com/
>



-- 

/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/

Reply via email to