JAMES-2015 use MailAddressFixture instead of random mail
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/5a781fb1 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/5a781fb1 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/5a781fb1 Branch: refs/heads/master Commit: 5a781fb1a72e97234159a1831f57c60a6f561c74 Parents: 02ae885 Author: Luc DUZAN <[email protected]> Authored: Tue May 9 16:07:36 2017 +0200 Committer: benwa <[email protected]> Committed: Wed May 17 15:12:55 2017 +0700 ---------------------------------------------------------------------- .../james/transport/matchers/SMTPAuthSuccessfulTest.java | 7 ++++--- .../org/apache/james/transport/matchers/SentByMailetTest.java | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/5a781fb1/mailet/standard/src/test/java/org/apache/james/transport/matchers/SMTPAuthSuccessfulTest.java ---------------------------------------------------------------------- diff --git a/mailet/standard/src/test/java/org/apache/james/transport/matchers/SMTPAuthSuccessfulTest.java b/mailet/standard/src/test/java/org/apache/james/transport/matchers/SMTPAuthSuccessfulTest.java index dc9cdd3..238374e 100644 --- a/mailet/standard/src/test/java/org/apache/james/transport/matchers/SMTPAuthSuccessfulTest.java +++ b/mailet/standard/src/test/java/org/apache/james/transport/matchers/SMTPAuthSuccessfulTest.java @@ -25,6 +25,7 @@ import java.util.Collection; import org.apache.mailet.Mail; import org.apache.mailet.MailAddress; +import org.apache.mailet.base.MailAddressFixture; import org.apache.mailet.base.test.FakeMail; import org.apache.mailet.base.test.FakeMailContext; import org.apache.mailet.base.test.FakeMatcherConfig; @@ -45,10 +46,10 @@ public class SMTPAuthSuccessfulTest { @Test public void matchShouldReturnRecipientsWhenAuthUserAttributeIsPresent() throws Exception{ - MailAddress recipient = new MailAddress("[email protected]"); + MailAddress recipient = MailAddressFixture.OTHER_AT_JAMES; FakeMail fakeMail = FakeMail.builder() .recipient(recipient) - .attribute(Mail.SMTP_AUTH_USER_ATTRIBUTE_NAME, "cuong") + .attribute(Mail.SMTP_AUTH_USER_ATTRIBUTE_NAME, "other") .build(); Collection<MailAddress> results = testee.match(fakeMail); @@ -59,7 +60,7 @@ public class SMTPAuthSuccessfulTest { @Test public void matchShouldNotReturnRecipientsWhenAuthUserAttributeIsAbsent() throws Exception{ FakeMail fakeMail = FakeMail.builder() - .recipients(new MailAddress("[email protected]")) + .recipients(MailAddressFixture.OTHER_AT_JAMES) .build(); Collection<MailAddress> results = testee.match(fakeMail); http://git-wip-us.apache.org/repos/asf/james-project/blob/5a781fb1/mailet/standard/src/test/java/org/apache/james/transport/matchers/SentByMailetTest.java ---------------------------------------------------------------------- diff --git a/mailet/standard/src/test/java/org/apache/james/transport/matchers/SentByMailetTest.java b/mailet/standard/src/test/java/org/apache/james/transport/matchers/SentByMailetTest.java index 4f36a98..06ac680 100644 --- a/mailet/standard/src/test/java/org/apache/james/transport/matchers/SentByMailetTest.java +++ b/mailet/standard/src/test/java/org/apache/james/transport/matchers/SentByMailetTest.java @@ -25,6 +25,7 @@ import java.util.Collection; import org.apache.mailet.Mail; import org.apache.mailet.MailAddress; +import org.apache.mailet.base.MailAddressFixture; import org.apache.mailet.base.test.FakeMail; import org.apache.mailet.base.test.FakeMailContext; import org.apache.mailet.base.test.FakeMatcherConfig; @@ -45,7 +46,7 @@ public class SentByMailetTest { @Test public void matchShouldReturnRecipientsWhenAuthUserAttributeIsPresent() throws Exception{ - MailAddress recipient = new MailAddress("[email protected]"); + MailAddress recipient = MailAddressFixture.ANY_AT_JAMES; FakeMail fakeMail = FakeMail.builder() .recipient(recipient) .attribute(Mail.SENT_BY_MAILET, "true") @@ -59,7 +60,7 @@ public class SentByMailetTest { @Test public void matchShouldReturnEmptyCollectionWhenAuthUserAttributeIsAbsent() throws Exception{ FakeMail fakeMail = FakeMail.builder() - .recipients(new MailAddress("[email protected]")) + .recipients(MailAddressFixture.ANY_AT_JAMES) .build(); Collection<MailAddress> results = testee.match(fakeMail); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
