ForecastDocumentConverter { @Converter public ForecastDocument convertByteArrayToForecastDocument(byte[] jpegDate) { return new ForecastDocument(jpegDate); }  @Converter ForecastDocument convertByteArrayToForecastDocument(byte[] jpegDate);  }
@Test public void convertByteArrayToForecastDocumentTest() throws Exception { final byte[] bytes = ("Test bytes for document conversion").getBytes(); beforeConversion.expectedBodiesReceived(bytes); List<Exchange> exchanges = afterConversion.getExchanges(); producerTemplate.sendBody(bytes); for (Exchange exchange : exchanges) { assertTrue("Did not receive converted object.", (exchange.getIn().getBody() instanceof ForecastDocument)); } beforeConversion.assertIsSatisfied(); ; }