// test if no recipient get returned cause it not match @Test public void testRemoteAddrInNetworkNotMatch() throws MessagingException { setRemoteAddr("192.168.1.1"); setupAll(); Collection<MailAddress> matchedRecipients = matcher.match(mockedMail); assertNull(matchedRecipients); }
// test if the recipients get returned as matched @Test public void testRemoteAddrInNetworkMatched() throws MessagingException { setRemoteAddr("192.168.200.1"); setupAll(); Collection<MailAddress> matchedRecipients = matcher.match(mockedMail); assertNotNull(matchedRecipients); assertEquals(matchedRecipients.size(), mockedMail.getRecipients().size()); }