@Test void testHeaderIsNotMatched() throws MessagingException { setRegex("\\d"); setupAll(); Collection<MailAddress> matchedRecipients = matcher.match(mockedMail); assertNull(matchedRecipients); }
@Override public Collection<MailAddress> match(Mail mail) throws MessagingException { return AttributeUtils .getAttributeValueFromMail(mail, attributeName) .filter(obj -> pattern.matcher(obj.toString()).matches()) .map(any -> mail.getRecipients()) .orElse(null); }
HasMailAttributeWithValueRegex extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) throws MessagingException { return AttributeUtils .getAttributeValueFromMail(mail, attributeName) .filter(obj -> pattern.matcher(obj.toString()).matches()) .map(any -> mail.getRecipients()) .orElse(null); } }
HasMailAttributeWithValueRegex extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) throws MessagingException { return AttributeUtils .getAttributeValueFromMail(mail, attributeName) .filter(obj -> pattern.matcher(obj.toString()).matches()) .map(any -> mail.getRecipients()) .orElse(null); }  }
HasMailAttributeWithValueRegex extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) throws MessagingException { return AttributeUtils .getAttributeValueFromMail(mail, attributeName) .filter(obj -> pattern.matcher(obj.toString()).matches()) .map(any -> mail.getRecipients()) .orElse(null); }  @Override String getMatcherInfo(); @Override void init(MatcherConfig conf); @Override Collection<MailAddress> match(Mail mail); }
HasMailAttributeWithValueRegex extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) throws MessagingException { return AttributeUtils .getAttributeValueFromMail(mail, attributeName) .filter(obj -> pattern.matcher(obj.toString()).matches()) .map(any -> mail.getRecipients()) .orElse(null); }  @Override String getMatcherInfo(); @Override void init(MatcherConfig conf); @Override Collection<MailAddress> match(Mail mail);  }