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 <[email protected]> Authored: Wed Aug 31 15:18:23 2016 +0700 Committer: Benoit Tellier <[email protected]> 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: [email protected] For additional commands, e-mail: [email protected]
