Exchange e = new ExchangeImpl(Pattern.InOnly);
Message msg = e.getIn();
msg.addAttachment("id", new BufferedInputStream(new ByteArrayInputStream(new byte[] { 1, 2, 3, 4 })));
msg.setBody(new DOMSource(parse("<hello/>")));
e.ensureReReadable();
assertNotNull(msg.getBody());
assertTrue(msg.getBody() instanceof StringSource);
assertNotNull(msg.getAttachment("id"));
assertTrue(msg.getAttachment("id") instanceof ByteArrayInputStream);