@Test public void serviceShouldThrowWhenCanNotGetMessageFromMail() throws Exception { expectedException.expect(MessagingException.class); Mail mail = mock(Mail.class); when(mail.getMessage()) .thenThrow(new MessagingException()); mailet.service(mail); }
@Override public void service(Mail mail) throws MessagingException { MimeMessage mimeMessage = mail.getMessage(); if (mimeMessage.isMimeType(TEXT_CALENDAR_TYPE)) { processTextBodyAsAttachment(mimeMessage); } }
TextCalendarBodyToAttachment extends GenericMailet { @Override public void service(Mail mail) throws MessagingException { MimeMessage mimeMessage = mail.getMessage(); if (mimeMessage.isMimeType(TEXT_CALENDAR_TYPE)) { processTextBodyAsAttachment(mimeMessage); } } }
TextCalendarBodyToAttachment extends GenericMailet { @Override public void service(Mail mail) throws MessagingException { MimeMessage mimeMessage = mail.getMessage(); if (mimeMessage.isMimeType(TEXT_CALENDAR_TYPE)) { processTextBodyAsAttachment(mimeMessage); } }  }
TextCalendarBodyToAttachment extends GenericMailet { @Override public void service(Mail mail) throws MessagingException { MimeMessage mimeMessage = mail.getMessage(); if (mimeMessage.isMimeType(TEXT_CALENDAR_TYPE)) { processTextBodyAsAttachment(mimeMessage); } }  @Override String getMailetInfo(); @Override void service(Mail mail); }
TextCalendarBodyToAttachment extends GenericMailet { @Override public void service(Mail mail) throws MessagingException { MimeMessage mimeMessage = mail.getMessage(); if (mimeMessage.isMimeType(TEXT_CALENDAR_TYPE)) { processTextBodyAsAttachment(mimeMessage); } }  @Override String getMailetInfo(); @Override void service(Mail mail);  }