@Test public void shouldNotMatchWhenSubjectDoesntEqualsConfiguredValue() throws MessagingException { FakeMail mail = FakeMail.builder() .name("mail") .mimeMessage(MailUtil.createMimeMessageWithSubject("foobar")) .recipients(roger) .build(); FakeMatcherConfig mailetConfig = FakeMatcherConfig.builder() .matcherName("SubjectIs") .condition("foo") .build(); matcher.init(mailetConfig); assertThat(matcher.match(mail)).isNull(); }
@Override public Collection<MailAddress> match(Mail mail) throws javax.mail.MessagingException { MimeMessage mm = mail.getMessage(); String subject = mm.getSubject(); if (subject != null && subject.equals(getCondition())) { return mail.getRecipients(); } return null; }
SubjectIs extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) throws javax.mail.MessagingException { MimeMessage mm = mail.getMessage(); String subject = mm.getSubject(); if (subject != null && subject.equals(getCondition())) { return mail.getRecipients(); } return null; } }
SubjectIs extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) throws javax.mail.MessagingException { MimeMessage mm = mail.getMessage(); String subject = mm.getSubject(); if (subject != null && subject.equals(getCondition())) { return mail.getRecipients(); } return null; }  }
SubjectIs extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) throws javax.mail.MessagingException { MimeMessage mm = mail.getMessage(); String subject = mm.getSubject(); if (subject != null && subject.equals(getCondition())) { return mail.getRecipients(); } return null; }  @Override Collection<MailAddress> match(Mail mail); }
SubjectIs extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) throws javax.mail.MessagingException { MimeMessage mm = mail.getMessage(); String subject = mm.getSubject(); if (subject != null && subject.equals(getCondition())) { return mail.getRecipients(); } return null; }  @Override Collection<MailAddress> match(Mail mail);  }