@Test void shouldThrowWhenConditionIsNegative() { FakeMatcherConfig matcherConfig = FakeMatcherConfig.builder() .matcherName("RemoteDeliveryFailedWithSMTPCode") .condition("-1") .build(); assertThatThrownBy(() -> testee.init(matcherConfig)) .isInstanceOf(MessagingException.class); }
@Override public void init() throws MessagingException { this.errorCode = MailetUtil.getInitParameterAsStrictlyPositiveInteger(getCondition()); Preconditions.checkArgument(errorCode >= 101 && errorCode <= 554, "Invalid SMTP code"); }
RemoteDeliveryFailedWithSMTPCode extends GenericMatcher { @Override public void init() throws MessagingException { this.errorCode = MailetUtil.getInitParameterAsStrictlyPositiveInteger(getCondition()); Preconditions.checkArgument(errorCode >= 101 && errorCode <= 554, "Invalid SMTP code"); } }
RemoteDeliveryFailedWithSMTPCode extends GenericMatcher { @Override public void init() throws MessagingException { this.errorCode = MailetUtil.getInitParameterAsStrictlyPositiveInteger(getCondition()); Preconditions.checkArgument(errorCode >= 101 && errorCode <= 554, "Invalid SMTP code"); }  }
RemoteDeliveryFailedWithSMTPCode extends GenericMatcher { @Override public void init() throws MessagingException { this.errorCode = MailetUtil.getInitParameterAsStrictlyPositiveInteger(getCondition()); Preconditions.checkArgument(errorCode >= 101 && errorCode <= 554, "Invalid SMTP code"); }  @Override void init(); @Override Collection<MailAddress> match(Mail mail); }
RemoteDeliveryFailedWithSMTPCode extends GenericMatcher { @Override public void init() throws MessagingException { this.errorCode = MailetUtil.getInitParameterAsStrictlyPositiveInteger(getCondition()); Preconditions.checkArgument(errorCode >= 101 && errorCode <= 554, "Invalid SMTP code"); }  @Override void init(); @Override Collection<MailAddress> match(Mail mail);  }