@Test public void serviceShouldThrowWhenMessageCanNotGetContentType() throws Exception { expectedException.expect(MessagingException.class); MimeMessage message = mock(MimeMessage.class); Mail mail = FakeMail.from(message); when(message.isMimeType(anyString())).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);  }