@Test void serviceShouldThrowWhenUnretrievableContentTypeMessage(TemporaryFolder temporaryFolder) throws MessagingException { Mailet mailet = initMailet(temporaryFolder); MimeMessage message = mock(MimeMessage.class); Mail mail = mock(Mail.class); when(mail.getMessage()) .thenReturn(message); when(message.isMimeType("multipart/*")) .thenThrow(new MessagingException("Test exception")); assertThatThrownBy(() -> mailet.service(mail)) .isInstanceOf(MailetException.class) .hasMessage("Could not retrieve contenttype of MimePart."); }
@Override public void service(Mail mail) throws MailetException { MimeMessage message = getMessageFromMail(mail); if (isMultipart(message)) { processMultipartPartMessage(message, mail); } }
StripAttachment extends GenericMailet { @Override public void service(Mail mail) throws MailetException { MimeMessage message = getMessageFromMail(mail); if (isMultipart(message)) { processMultipartPartMessage(message, mail); } } }
StripAttachment extends GenericMailet { @Override public void service(Mail mail) throws MailetException { MimeMessage message = getMessageFromMail(mail); if (isMultipart(message)) { processMultipartPartMessage(message, mail); } }  }
StripAttachment extends GenericMailet { @Override public void service(Mail mail) throws MailetException { MimeMessage message = getMessageFromMail(mail); if (isMultipart(message)) { processMultipartPartMessage(message, mail); } }  @Override void init(); @Override void service(Mail mail); @Override String getMailetInfo(); }
StripAttachment extends GenericMailet { @Override public void service(Mail mail) throws MailetException { MimeMessage message = getMessageFromMail(mail); if (isMultipart(message)) { processMultipartPartMessage(message, mail); } }  @Override void init(); @Override void service(Mail mail); @Override String getMailetInfo(); static final String PATTERN_PARAMETER_NAME; static final String NOTPATTERN_PARAMETER_NAME; static final String MIMETYPE_PARAMETER_NAME; static final String ATTRIBUTE_PARAMETER_NAME; static final String DIRECTORY_PARAMETER_NAME; static final String REMOVE_ATTACHMENT_PARAMETER_NAME; static final String DECODE_FILENAME_PARAMETER_NAME; static final String REPLACE_FILENAME_PATTERN_PARAMETER_NAME; static final String REMOVE_NONE; static final String REMOVE_ALL; static final String REMOVE_MATCHED; static final AttributeName REMOVED_ATTACHMENTS; static final AttributeName SAVED_ATTACHMENTS; static final boolean DECODE_FILENAME_DEFAULT_VALUE; }