@Test public void isAutoSubmittedShouldBeDetectedWhenAutoNotified() throws Exception { FakeMail fakeMail = FakeMail.builder() .name("mail") .sender("any@any.com") .mimeMessage(MimeMessageBuilder.mimeMessageBuilder() .addHeader("Auto-Submitted", "auto-notified")) .build(); assertThat(new AutomaticallySentMailDetectorImpl().isAutoSubmitted(fakeMail)).isTrue(); }
@Override public boolean isAutoSubmitted(Mail mail) throws MessagingException { String[] headers = mail.getMessage().getHeader(AUTO_SUBMITTED_HEADER); if (headers != null) { return Arrays.stream(headers) .anyMatch(this::isAutoSubmitted); } return false; }
AutomaticallySentMailDetectorImpl implements AutomaticallySentMailDetector { @Override public boolean isAutoSubmitted(Mail mail) throws MessagingException { String[] headers = mail.getMessage().getHeader(AUTO_SUBMITTED_HEADER); if (headers != null) { return Arrays.stream(headers) .anyMatch(this::isAutoSubmitted); } return false; } }
AutomaticallySentMailDetectorImpl implements AutomaticallySentMailDetector { @Override public boolean isAutoSubmitted(Mail mail) throws MessagingException { String[] headers = mail.getMessage().getHeader(AUTO_SUBMITTED_HEADER); if (headers != null) { return Arrays.stream(headers) .anyMatch(this::isAutoSubmitted); } return false; }  }
AutomaticallySentMailDetectorImpl implements AutomaticallySentMailDetector { @Override public boolean isAutoSubmitted(Mail mail) throws MessagingException { String[] headers = mail.getMessage().getHeader(AUTO_SUBMITTED_HEADER); if (headers != null) { return Arrays.stream(headers) .anyMatch(this::isAutoSubmitted); } return false; }  @Override boolean isAutomaticallySent(Mail mail); @Override boolean isMailingList(Mail mail); @Override boolean isAutoSubmitted(Mail mail); @Override boolean isMdnSentAutomatically(Mail mail); }
AutomaticallySentMailDetectorImpl implements AutomaticallySentMailDetector { @Override public boolean isAutoSubmitted(Mail mail) throws MessagingException { String[] headers = mail.getMessage().getHeader(AUTO_SUBMITTED_HEADER); if (headers != null) { return Arrays.stream(headers) .anyMatch(this::isAutoSubmitted); } return false; }  @Override boolean isAutomaticallySent(Mail mail); @Override boolean isMailingList(Mail mail); @Override boolean isAutoSubmitted(Mail mail); @Override boolean isMdnSentAutomatically(Mail mail);  }