@Test void shouldOnlyMatchCorrespondingAddress() throws Exception { matcher.init(FakeMatcherConfig.builder() .matcherName("RecipientIs") .condition(ANY_AT_JAMES.toString()) .build()); FakeMail fakeMail = FakeMail.builder() .name("mail") .recipients(ANY_AT_JAMES, OTHER_AT_JAMES) .build(); assertThat(matcher.match(fakeMail)).containsOnly(ANY_AT_JAMES); }
@Override public void init() throws javax.mail.MessagingException { if (Strings.isNullOrEmpty(getCondition())) { throw new MessagingException("RecipientIs should have a condition composed of a list of mail addresses"); } recipients = MailAddressCollectionReader.read(getCondition()); if (recipients.isEmpty()) { throw new MessagingException("RecipientIs should have at least one address passed as a condition"); } }
RecipientIs extends GenericRecipientMatcher { @Override public void init() throws javax.mail.MessagingException { if (Strings.isNullOrEmpty(getCondition())) { throw new MessagingException("RecipientIs should have a condition composed of a list of mail addresses"); } recipients = MailAddressCollectionReader.read(getCondition()); if (recipients.isEmpty()) { throw new MessagingException("RecipientIs should have at least one address passed as a condition"); } } }
RecipientIs extends GenericRecipientMatcher { @Override public void init() throws javax.mail.MessagingException { if (Strings.isNullOrEmpty(getCondition())) { throw new MessagingException("RecipientIs should have a condition composed of a list of mail addresses"); } recipients = MailAddressCollectionReader.read(getCondition()); if (recipients.isEmpty()) { throw new MessagingException("RecipientIs should have at least one address passed as a condition"); } }  }
RecipientIs extends GenericRecipientMatcher { @Override public void init() throws javax.mail.MessagingException { if (Strings.isNullOrEmpty(getCondition())) { throw new MessagingException("RecipientIs should have a condition composed of a list of mail addresses"); } recipients = MailAddressCollectionReader.read(getCondition()); if (recipients.isEmpty()) { throw new MessagingException("RecipientIs should have at least one address passed as a condition"); } }  @Override void init(); @Override boolean matchRecipient(MailAddress recipient); }
RecipientIs extends GenericRecipientMatcher { @Override public void init() throws javax.mail.MessagingException { if (Strings.isNullOrEmpty(getCondition())) { throw new MessagingException("RecipientIs should have a condition composed of a list of mail addresses"); } recipients = MailAddressCollectionReader.read(getCondition()); if (recipients.isEmpty()) { throw new MessagingException("RecipientIs should have at least one address passed as a condition"); } }  @Override void init(); @Override boolean matchRecipient(MailAddress recipient);  }