use of javax.mail.search.RecipientStringTerm in project jodd by oblac.
the class EmailFilterTest method testAnd2.
@Test
public void testAnd2() {
EmailFilter emailFilter = filter().from("from").to("to");
SearchTerm expected = new AndTerm(new FromStringTerm("from"), new RecipientStringTerm(Message.RecipientType.TO, "to"));
assertEquals(expected, emailFilter.searchTerm);
}
use of javax.mail.search.RecipientStringTerm in project jodd by oblac.
the class EmailFilterTest method testAndOrNotAlt.
@Test
public void testAndOrNotAlt() {
EmailFilter emailFilter = filter().or(filter().and(filter().from("from"), filter().to("to")), filter().not(filter().subject("subject")), filter().from("from2"));
SearchTerm expected = new OrTerm(new SearchTerm[] { new AndTerm(new FromStringTerm("from"), new RecipientStringTerm(Message.RecipientType.TO, "to")), new NotTerm(new SubjectTerm("subject")), new FromStringTerm("from2") });
assertEquals(expected, emailFilter.searchTerm);
}
use of javax.mail.search.RecipientStringTerm in project jodd by oblac.
the class EmailFilterTest method testOr2Alt.
@Test
public void testOr2Alt() {
EmailFilter emailFilter = filter().or().from("from").to("to");
SearchTerm expected = new OrTerm(new FromStringTerm("from"), new RecipientStringTerm(Message.RecipientType.TO, "to"));
assertEquals(expected, emailFilter.searchTerm);
}
use of javax.mail.search.RecipientStringTerm in project jodd by oblac.
the class EmailFilter method cc.
/**
* Defines filter for CC field.
*/
public EmailFilter cc(String ccAddress) {
SearchTerm toTerm = new RecipientStringTerm(Message.RecipientType.CC, ccAddress);
concat(toTerm);
return this;
}
use of javax.mail.search.RecipientStringTerm in project jodd by oblac.
the class EmailFilter method bcc.
/**
* Defines filter for BCC field.
*/
public EmailFilter bcc(String bccAddress) {
SearchTerm toTerm = new RecipientStringTerm(Message.RecipientType.BCC, bccAddress);
concat(toTerm);
return this;
}
Aggregations