@Test void shouldNotMatchWhenAttributeIsTrue() throws Exception { Mail mail = createMail(); mail.setAttribute(new Attribute(IS_DELIVERY_PERMANENT_ERROR, AttributeValue.of(true))); Collection<MailAddress> actual = testee.match(mail); assertThat(actual).isEmpty(); }
@Override public Collection<MailAddress> match(Mail mail) { return AttributeUtils.getValueAndCastFromMail(mail, IS_DELIVERY_PERMANENT_ERROR, Boolean.class) .filter(Predicate.isEqual(false)) .map(any -> mail.getRecipients()) .orElse(ImmutableList.of()); }
IsRemoteDeliveryTemporaryError extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) { return AttributeUtils.getValueAndCastFromMail(mail, IS_DELIVERY_PERMANENT_ERROR, Boolean.class) .filter(Predicate.isEqual(false)) .map(any -> mail.getRecipients()) .orElse(ImmutableList.of()); } }
IsRemoteDeliveryTemporaryError extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) { return AttributeUtils.getValueAndCastFromMail(mail, IS_DELIVERY_PERMANENT_ERROR, Boolean.class) .filter(Predicate.isEqual(false)) .map(any -> mail.getRecipients()) .orElse(ImmutableList.of()); }  }
IsRemoteDeliveryTemporaryError extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) { return AttributeUtils.getValueAndCastFromMail(mail, IS_DELIVERY_PERMANENT_ERROR, Boolean.class) .filter(Predicate.isEqual(false)) .map(any -> mail.getRecipients()) .orElse(ImmutableList.of()); }  @Override Collection<MailAddress> match(Mail mail); }
IsRemoteDeliveryTemporaryError extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) { return AttributeUtils.getValueAndCastFromMail(mail, IS_DELIVERY_PERMANENT_ERROR, Boolean.class) .filter(Predicate.isEqual(false)) .map(any -> mail.getRecipients()) .orElse(ImmutableList.of()); }  @Override Collection<MailAddress> match(Mail mail);  }