You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by rc...@apache.org on 2019/12/02 02:26:54 UTC

[james-project] 02/05: [Refactoring] replace FakeMail.builder by MailImpl.builder

This is an automated email from the ASF dual-hosted git repository.

rcordier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 1eeab207b64426c1444c9b928be84fa06055d7b2
Author: Matthieu Baechler <ma...@apache.org>
AuthorDate: Thu Nov 14 21:18:46 2019 +0100

    [Refactoring] replace FakeMail.builder by MailImpl.builder
---
 .../java/org/apache/james/mailetcontainer/impl/matchers/Not.java     | 5 ++---
 .../java/org/apache/james/mailetcontainer/impl/matchers/NotTest.java | 4 ++--
 .../java/org/apache/james/mailetcontainer/impl/matchers/OrTest.java  | 4 ++--
 .../java/org/apache/james/mailetcontainer/impl/matchers/XorTest.java | 4 ++--
 4 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/matchers/Not.java b/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/matchers/Not.java
index 245b23f..88fa65b 100644
--- a/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/matchers/Not.java
+++ b/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/matchers/Not.java
@@ -36,12 +36,11 @@ import com.google.common.collect.Lists;
  * of each child matcher. Of course it is easier to understand if it only
  * includes one matcher in the composition, the normal recommended use. @See
  * CompositeMatcher interface.
+ *
+ * It returns recipients from the negated composition of the child Matcher(s).
  */
 public class Not extends GenericCompositeMatcher {
 
-    /**
-     * @return Collection of Recipients from the Negated composition of the child Matcher(s).
-     */
     @Override
     public Collection<MailAddress> match(Mail mail) throws MessagingException {
         Collection<MailAddress> finalResult = Optional.ofNullable(Lists.newArrayList(mail.getRecipients())).orElse(new ArrayList<>());
diff --git a/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/matchers/NotTest.java b/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/matchers/NotTest.java
index a4ae153..d69bf08 100644
--- a/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/matchers/NotTest.java
+++ b/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/matchers/NotTest.java
@@ -24,9 +24,9 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
 import org.apache.james.core.MailAddress;
+import org.apache.james.server.core.MailImpl;
 import org.apache.mailet.Mail;
 import org.apache.mailet.Matcher;
-import org.apache.mailet.base.test.FakeMail;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -54,7 +54,7 @@ public class NotTest {
         recipient2 = new MailAddress("other@apahe.org");
         recipient3 = new MailAddress("bis@apache.org");
         recipient4 = new MailAddress("yet@apache.org");
-        mail = FakeMail.builder().name("name").recipients(recipient1, recipient2, recipient3, recipient4).build();
+        mail = MailImpl.builder().name("name").addRecipients(recipient1, recipient2, recipient3, recipient4).build();
     }
 
     @Test
diff --git a/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/matchers/OrTest.java b/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/matchers/OrTest.java
index f3722b8..9827fe7 100644
--- a/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/matchers/OrTest.java
+++ b/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/matchers/OrTest.java
@@ -28,9 +28,9 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
 import org.apache.james.core.MailAddress;
+import org.apache.james.server.core.MailImpl;
 import org.apache.mailet.Mail;
 import org.apache.mailet.Matcher;
-import org.apache.mailet.base.test.FakeMail;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -50,7 +50,7 @@ public class OrTest {
 
         testee = new Or();
 
-        mail = FakeMail.builder().name("name").recipients(ANY_AT_JAMES, OTHER_AT_JAMES, ANY_AT_JAMES2, OTHER_AT_JAMES2).build();
+        mail = MailImpl.builder().name("name").addRecipients(ANY_AT_JAMES, OTHER_AT_JAMES, ANY_AT_JAMES2, OTHER_AT_JAMES2).build();
     }
 
     @Test
diff --git a/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/matchers/XorTest.java b/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/matchers/XorTest.java
index 4ca0127..9d5eb26 100644
--- a/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/matchers/XorTest.java
+++ b/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/matchers/XorTest.java
@@ -27,9 +27,9 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
 import org.apache.james.core.MailAddress;
+import org.apache.james.server.core.MailImpl;
 import org.apache.mailet.Mail;
 import org.apache.mailet.Matcher;
-import org.apache.mailet.base.test.FakeMail;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -49,7 +49,7 @@ public class XorTest {
 
         testee = new Xor();
 
-        mail = FakeMail.builder().name("name").recipients(ANY_AT_JAMES, OTHER_AT_JAMES, ANY_AT_JAMES2, OTHER_AT_JAMES2).build();
+        mail = MailImpl.builder().name("name").addRecipients(ANY_AT_JAMES, OTHER_AT_JAMES, ANY_AT_JAMES2, OTHER_AT_JAMES2).build();
     }
 
     @Test


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