@Test void initShouldThrowOnEmptyCondition() { assertThatThrownBy(() -> matcher.init(FakeMatcherConfig.builder() .matcherName("UserIs") .build())) .isInstanceOf(MessagingException.class); }
@Override public void init() throws MessagingException { if (Strings.isNullOrEmpty(getCondition())) { throw new MessagingException("UserIs should have a condition composed of a list of local parts of mail addresses"); } users = ImmutableSet.copyOf(Splitter.on(", ").split(getCondition())); if (users.isEmpty()) { throw new MessagingException("UserIs should have at least a user specified"); } }
UserIs extends GenericRecipientMatcher { @Override public void init() throws MessagingException { if (Strings.isNullOrEmpty(getCondition())) { throw new MessagingException("UserIs should have a condition composed of a list of local parts of mail addresses"); } users = ImmutableSet.copyOf(Splitter.on(", ").split(getCondition())); if (users.isEmpty()) { throw new MessagingException("UserIs should have at least a user specified"); } } }
UserIs extends GenericRecipientMatcher { @Override public void init() throws MessagingException { if (Strings.isNullOrEmpty(getCondition())) { throw new MessagingException("UserIs should have a condition composed of a list of local parts of mail addresses"); } users = ImmutableSet.copyOf(Splitter.on(", ").split(getCondition())); if (users.isEmpty()) { throw new MessagingException("UserIs should have at least a user specified"); } }  }
UserIs extends GenericRecipientMatcher { @Override public void init() throws MessagingException { if (Strings.isNullOrEmpty(getCondition())) { throw new MessagingException("UserIs should have a condition composed of a list of local parts of mail addresses"); } users = ImmutableSet.copyOf(Splitter.on(", ").split(getCondition())); if (users.isEmpty()) { throw new MessagingException("UserIs should have at least a user specified"); } }  @Override void init(); @Override boolean matchRecipient(MailAddress recipient); }
UserIs extends GenericRecipientMatcher { @Override public void init() throws MessagingException { if (Strings.isNullOrEmpty(getCondition())) { throw new MessagingException("UserIs should have a condition composed of a list of local parts of mail addresses"); } users = ImmutableSet.copyOf(Splitter.on(", ").split(getCondition())); if (users.isEmpty()) { throw new MessagingException("UserIs should have at least a user specified"); } }  @Override void init(); @Override boolean matchRecipient(MailAddress recipient);  }