Exchange exchange = createExchangeWithBody(context, "body");
Exchange exchange2 = createExchangeWithBody(context, "body2");
Processor processor = new UnmarshalProcessor(new MyDataFormat(exchange2));
try {
processor.process(exchange);
fail("Should have thrown exception");
} catch (RuntimeCamelException e) {
assertEquals("The returned exchange " + exchange2 + " is not the same as " + exchange + " provided to the DataFormat", e.getMessage());
}
}