Reputation: 2634
How can I get the body of MockEndpoint?
@EndpointInject(uri = "mock:direct:end")
protected MockEndpoint endEndpoint;
endEndpoint.setExpectedMessageCount(1);
String test = (String)endEndpoint.getExchanges().get(0).getIn().getBody();
endEndpoint.getExchanges() returns empty list and throws ArrayIndexOutOfBoundsException. However, endEndpoint does get 1 message.
Upvotes: 0
Views: 823
Reputation: 3191
You should get it after you send the message to that endpoint and not before. So, after template.send..
Upvotes: 2