// should be closed
try {
template.sendBodyAndHeader("direct:start", "H", "id", 2);
fail("Should throw an exception");
} catch (CamelExecutionException e) {
ClosedCorrelationKeyException cause = assertIsInstanceOf(ClosedCorrelationKeyException.class, e.getCause());
assertEquals("2", cause.getCorrelationKey());
assertEquals("The correlation key [2] has been closed. Exchange[Message: H]", cause.getMessage());
}
// should be closed
try {
template.sendBodyAndHeader("direct:start", "I", "id", 3);
fail("Should throw an exception");
} catch (CamelExecutionException e) {
ClosedCorrelationKeyException cause = assertIsInstanceOf(ClosedCorrelationKeyException.class, e.getCause());
assertEquals("3", cause.getCorrelationKey());
assertEquals("The correlation key [3] has been closed. Exchange[Message: I]", cause.getMessage());
}
assertMockEndpointsSatisfied();
}