james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matth...@apache.org
Subject [5/5] james-project git commit: Merge remote-tracking branch 'benoit/MAILET-111'
Date Tue, 30 Aug 2016 14:56:57 GMT
Merge remote-tracking branch 'benoit/MAILET-111'


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

Branch: refs/heads/master
Commit: 094d62776011a276c4b287cc5714f9a597ff7879
Parents: 3f528b8 caff5d2
Author: Matthieu Baechler <matthieu.baechler@linagora.com>
Authored: Tue Aug 30 16:55:52 2016 +0200
Committer: Matthieu Baechler <matthieu.baechler@linagora.com>
Committed: Tue Aug 30 16:55:52 2016 +0200

----------------------------------------------------------------------
 .../org/apache/mailet/base/test/FakeMail.java   | 16 +++++++++++++---
 .../james/transport/matchers/AllTest.java       | 20 ++++++++++----------
 2 files changed, 23 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/094d6277/mailet/standard/src/test/java/org/apache/james/transport/matchers/AllTest.java
----------------------------------------------------------------------
diff --cc mailet/standard/src/test/java/org/apache/james/transport/matchers/AllTest.java
index 98552b2,e59f69f..ecf4b61
--- 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
@@@ -44,19 -43,20 +43,20 @@@ public class AllTest 
      public void setupMatcher() throws MessagingException {
          matcher = new All();
          FakeMatcherConfig mci = new FakeMatcherConfig("All",
 -                new FakeMailContext());
 +                FakeMailContext.defaultContext());
          matcher.init(mci);
+ 
+         mailAddress1 = new MailAddress("me@apache.org");
+         mailAddress2 = new MailAddress("you@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-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message