@Test public void matchShouldReturnRecipientsWhenAuthUserAttributeIsPresent() throws Exception { MailAddress recipient = MailAddressFixture.OTHER_AT_JAMES; FakeMail fakeMail = FakeMail.builder() .name("mail") .recipient(recipient) .attribute(new Attribute(Mail.SMTP_AUTH_USER, AttributeValue.of("other"))) .build(); Collection<MailAddress> results = testee.match(fakeMail); assertThat(results).containsOnly(recipient); }
@Override public Collection<MailAddress> match(Mail mail) { return mail .getAttribute(Mail.SMTP_AUTH_USER) .map(ignored -> mail.getRecipients()) .orElse(ImmutableList.of()); }
SMTPAuthSuccessful extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) { return mail .getAttribute(Mail.SMTP_AUTH_USER) .map(ignored -> mail.getRecipients()) .orElse(ImmutableList.of()); } }
SMTPAuthSuccessful extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) { return mail .getAttribute(Mail.SMTP_AUTH_USER) .map(ignored -> mail.getRecipients()) .orElse(ImmutableList.of()); }  }
SMTPAuthSuccessful extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) { return mail .getAttribute(Mail.SMTP_AUTH_USER) .map(ignored -> mail.getRecipients()) .orElse(ImmutableList.of()); }  @Override Collection<MailAddress> match(Mail mail); }
SMTPAuthSuccessful extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) { return mail .getAttribute(Mail.SMTP_AUTH_USER) .map(ignored -> mail.getRecipients()) .orElse(ImmutableList.of()); }  @Override Collection<MailAddress> match(Mail mail);  }