@Test public void matchShouldReturnEmptyCollectionWhenAuthUserAttributeIsAbsent() throws Exception { FakeMail fakeMail = FakeMail.builder() .name("mail") .recipients(MailAddressFixture.ANY_AT_JAMES) .build(); Collection<MailAddress> results = testee.match(fakeMail); assertThat(results).isEmpty(); }
@Override public Collection<MailAddress> match(Mail mail) { return AttributeUtils .getAttributeValueFromMail(mail, Mail.SENT_BY_MAILET_ATTRIBUTE.getName()) .map(any -> mail.getRecipients()) .orElse(ImmutableList.of()); }
SentByMailet extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) { return AttributeUtils .getAttributeValueFromMail(mail, Mail.SENT_BY_MAILET_ATTRIBUTE.getName()) .map(any -> mail.getRecipients()) .orElse(ImmutableList.of()); } }
SentByMailet extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) { return AttributeUtils .getAttributeValueFromMail(mail, Mail.SENT_BY_MAILET_ATTRIBUTE.getName()) .map(any -> mail.getRecipients()) .orElse(ImmutableList.of()); }  }
SentByMailet extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) { return AttributeUtils .getAttributeValueFromMail(mail, Mail.SENT_BY_MAILET_ATTRIBUTE.getName()) .map(any -> mail.getRecipients()) .orElse(ImmutableList.of()); }  @Override Collection<MailAddress> match(Mail mail); }
SentByMailet extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) { return AttributeUtils .getAttributeValueFromMail(mail, Mail.SENT_BY_MAILET_ATTRIBUTE.getName()) .map(any -> mail.getRecipients()) .orElse(ImmutableList.of()); }  @Override Collection<MailAddress> match(Mail mail);  }