james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [10/11] james-project git commit: MAILET-121 Clarify that SenderIsRegex should not match sub parts
Date Fri, 02 Sep 2016 06:23:35 GMT
MAILET-121 Clarify that SenderIsRegex should not match sub parts


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/6866fadd
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/6866fadd
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/6866fadd

Branch: refs/heads/master
Commit: 6866fadd39650624cb11af62c0d1d6cc5f661b0a
Parents: 9736dfc
Author: Benoit Tellier <btellier@linagora.com>
Authored: Wed Aug 31 15:18:23 2016 +0700
Committer: Benoit Tellier <btellier@linagora.com>
Committed: Fri Sep 2 13:22:36 2016 +0700

----------------------------------------------------------------------
 .../james/transport/matchers/SenderIsRegexTest.java     | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/6866fadd/mailet/standard/src/test/java/org/apache/james/transport/matchers/SenderIsRegexTest.java
----------------------------------------------------------------------
diff --git a/mailet/standard/src/test/java/org/apache/james/transport/matchers/SenderIsRegexTest.java
b/mailet/standard/src/test/java/org/apache/james/transport/matchers/SenderIsRegexTest.java
index 6345f33..aeddff2 100644
--- a/mailet/standard/src/test/java/org/apache/james/transport/matchers/SenderIsRegexTest.java
+++ b/mailet/standard/src/test/java/org/apache/james/transport/matchers/SenderIsRegexTest.java
@@ -61,6 +61,18 @@ public class SenderIsRegexTest {
     }
 
     @Test
+    public void shouldNotMatchSubParts() throws Exception {
+        matcher.init(new FakeMatcherConfig("SenderIsRegex=test", FakeMailContext.defaultContext()));
+
+        FakeMail fakeMail = FakeMail.builder()
+            .sender(new MailAddress(SENDER_NAME))
+            .recipient(recipient)
+            .build();
+
+        assertThat(matcher.match(fakeMail)).isNull();
+    }
+
+    @Test
     public void shouldNotMatchWhenNullSender() throws Exception {
         matcher.init(new FakeMatcherConfig("SenderIsRegex=.*@.*", FakeMailContext.defaultContext()));
 


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message