Thanks, here's what I ended up doing.

Changed the bean call to look like this:
<to uri="{{circ.service}}"/>

That value is defined in a properties file - in live use it's
"bean:circService", but under testing it's "mock:circService".

In my test, I added this:

@EndpointInject(uri = "{{circ.service}}")
protected MockEndpoint circServiceMock;

Then in my test case, I added this:

circServiceMock.returnReplyBody(new Expression() {
@Override
public <T> T evaluate(Exchange exchange, Class<T> type) {
 return exchange.getContext().getTypeConverter().convertTo(type,
circResponse);
}
});

The circResponse variable has what I want the mocked service to return.

Larry

Reply via email to