MAILET-111 AllTest should use assertj
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/caff5d2d Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/caff5d2d Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/caff5d2d Branch: refs/heads/master Commit: caff5d2d506cba5eedd05cbdf86e9e495fdd3cc5 Parents: ebb4b30 Author: Benoit Tellier <btell...@linagora.com> Authored: Tue Aug 30 11:51:34 2016 +0700 Committer: Benoit Tellier <btell...@linagora.com> Committed: Tue Aug 30 11:51:34 2016 +0700 ---------------------------------------------------------------------- .../james/transport/matchers/AllTest.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/caff5d2d/mailet/standard/src/test/java/org/apache/james/transport/matchers/AllTest.java ---------------------------------------------------------------------- diff --git a/mailet/standard/src/test/java/org/apache/james/transport/matchers/AllTest.java b/mailet/standard/src/test/java/org/apache/james/transport/matchers/AllTest.java index e019357..e59f69f 100644 --- a/mailet/standard/src/test/java/org/apache/james/transport/matchers/AllTest.java +++ b/mailet/standard/src/test/java/org/apache/james/transport/matchers/AllTest.java @@ -20,10 +20,7 @@ package org.apache.james.transport.matchers; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.util.Collection; +import static org.assertj.core.api.Assertions.assertThat; import javax.mail.MessagingException; @@ -39,6 +36,8 @@ import org.junit.Test; public class AllTest { private Matcher matcher; + private MailAddress mailAddress1; + private MailAddress mailAddress2; @Before public void setupMatcher() throws MessagingException { @@ -46,17 +45,18 @@ public class AllTest { FakeMatcherConfig mci = new FakeMatcherConfig("All", new FakeMailContext()); matcher.init(mci); + + mailAddress1 = new MailAddress("m...@apache.org"); + mailAddress2 = new MailAddress("y...@apache.org"); } - // test if all recipients was returned @Test public void testAllRecipientsReturned() throws MessagingException { - FakeMail mockedMail = MailUtil.createMockMail2Recipients(null); - - Collection<MailAddress> matchedRecipients = matcher.match(mockedMail); + FakeMail mockedMail = FakeMail.builder() + .recipients(mailAddress1, mailAddress2) + .build(); - assertNotNull(matchedRecipients); - assertEquals(matchedRecipients.size(), mockedMail.getRecipients().size()); + assertThat(matcher.match(mockedMail)).containsExactly(mailAddress1, mailAddress2); } } --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org