// save the expected body of the message to set it later
Object expectedBody = template.requestBody("direct:marshal", inDOM);
MockEndpoint mockJSON = getMockEndpoint("mock:json");
// reset the mock endpoint to get rid of the previous message
mockJSON.reset();
// all three messages should arrive, should be of type byte[] and
// identical to one another
mockJSON.expectedMessageCount(3);
mockJSON.allMessages().body().isInstanceOf(byte[].class);
mockJSON.expectedBodiesReceived(Arrays.asList(expectedBody, expectedBody, expectedBody));