* successful and that the correct number of {@link EmailFragment}s is created.
*/
@Test
public void testProcessingOfEmailAttachments() {
final JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
mailSender.setPort(this.wiserPort);
final MimeMessage message = mailSender.createMimeMessage();
final String pictureName = "picture.png";
final ByteArrayResource byteArrayResource = getFileData(pictureName);
try {
final MimeMessageHelper helper = new MimeMessageHelper(message, true);
helper.setFrom("testfrom@springintegration.org");
helper.setTo("testto@springintegration.org");
helper.setSubject("Parsing of Attachments");
helper.setText("Spring Integration Rocks!");
helper.addAttachment(pictureName, byteArrayResource, "image/png");
}
catch (MessagingException e) {
throw new MailParseException(e);
}
mailSender.send(message);
final List<WiserMessage> wiserMessages = wiser.getMessages();
Assert.assertTrue(wiserMessages.size() == 1);