1 19 20 21 package org.apache.james.transport.matchers; 22 23 import java.util.Collection ; 24 25 import javax.mail.MessagingException ; 26 27 import org.apache.mailet.GenericMatcher; 28 29 public class SMTPAuthUserIsTest extends AbstractHasMailAttributeTest { 30 31 private final String SMTP_AUTH_USER_ATTRIBUTE_NAME = "org.apache.james.SMTPAuthUser"; 32 33 protected String getHasMailAttribute() { 34 return "test@james.apache.org"; 35 } 36 37 protected GenericMatcher createMatcher() { 38 return new SMTPAuthUserIs(); 39 } 40 41 protected String getConfigOption() { 42 return "SMTPAuthUserIs="; 43 } 44 45 protected void init() { 46 super.init(); 47 setMailAttributeName(SMTP_AUTH_USER_ATTRIBUTE_NAME); 48 setMailAttributeValue("test@james.apache.org"); 49 } 50 51 52 public void testAttributeIsNotMatched() throws MessagingException { 54 setupAll(); 55 setMailAttributeValue("notmatched@james.apache.org"); 56 57 Collection matchedRecipients = matcher.match(mockedMail); 58 59 assertNull(matchedRecipients); 60 } 61 62 } 63 | Popular Tags |