// create the exchange with the mail message that is multipart with a file and a Hello World text/plain message.
Exchange exchange = endpoint.createExchange();
Message in = exchange.getIn();
in.setBody(htmlBody);
in.setHeader(MAIL_ALTERNATIVE_BODY, alternativeBody);
in.addAttachment("cid:myCoolLogo.jpeg", new DataHandler(new FileDataSource("src/test/data/logo.jpeg")));
// create a producer that can produce the exchange (= send the mail)
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(1);
mock.message(0).header(MailConstants.MAIL_ALTERNATIVE_BODY).isNull();