resultEndpoint.expectedMessageCount(4);
resultEndpoint.expectedHeaderReceived("foo", "bar");
MockEndpoint failedEndpoint = getMockEndpoint("mock:failed");
failedEndpoint.expectedMessageCount(1);
failedEndpoint.expectedHeaderReceived("foo", "bar");
Exchange result = template.request("direct:exception", new Processor() {
public void process(Exchange exchange) {
Message in = exchange.getIn();
in.setBody("James,Guillaume,Hiram,Rob,Exception");