@Test public void testWhiteListed() throws Exception { DNSRBLHandler rbl = createHandler(); setRemoteIp("127.0.0.2"); setupMockedSMTPSession(new MailAddress("any@domain")); rbl.setWhitelist(new String[] { "bl.spamcop.net." }); rbl.setGetDetail(true); rbl.doRcpt(mockedSMTPSession, null, new MailAddress("test@localhost")); assertThat(mockedSMTPSession.getAttachment(RBL_DETAIL_MAIL_ATTRIBUTE_NAME, Connection)).isNull(); assertThat(mockedSMTPSession.getAttachment(RBL_BLOCKLISTED_MAIL_ATTRIBUTE_NAME, Connection)).withFailMessage("Not blocked").isNull(); }
@Test public void testWhiteListed() throws Exception { DNSRBLHandler rbl = createHandler(); setRemoteIp("127.0.0.2"); setupMockedSMTPSession(new MailAddress("any@domain")); rbl.setWhitelist(new String[] { "bl.spamcop.net." }); rbl.setGetDetail(true); rbl.doRcpt(mockedSMTPSession, MaybeSender.nullSender(), new MailAddress("test@localhost")); assertThat(mockedSMTPSession.getAttachment(RBL_DETAIL_MAIL_ATTRIBUTE_NAME, Connection)).isNull(); assertThat(mockedSMTPSession.getAttachment(RBL_BLOCKLISTED_MAIL_ATTRIBUTE_NAME, Connection)).withFailMessage("Not blocked").isNull(); }