james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rouaz...@apache.org
Subject [03/16] james-project git commit: JAMES-2134 Builder for Original-Recipient field
Date Thu, 05 Apr 2018 12:51:53 GMT
JAMES-2134 Builder for Original-Recipient field


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

Branch: refs/heads/master
Commit: c470ef0b825df35f68017924c9e4fb81d01b627e
Parents: db60b10
Author: Raphael Ouazana <raphael.ouazana@linagora.com>
Authored: Wed Apr 4 10:22:29 2018 +0200
Committer: Raphael Ouazana <raphael.ouazana@linagora.com>
Committed: Thu Apr 5 14:48:41 2018 +0200

----------------------------------------------------------------------
 .../java/org/apache/james/mdn/MDNReport.java    |  2 +-
 .../james/mdn/fields/OriginalRecipient.java     | 39 ++++++++++++++----
 .../james/mdn/MDNReportFormattingTest.java      | 42 ++++++++++----------
 .../org/apache/james/mdn/MDNReportTest.java     |  6 +--
 .../james/mdn/fields/OriginalRecipientTest.java | 25 +++++++-----
 5 files changed, 70 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/c470ef0b/mdn/src/main/java/org/apache/james/mdn/MDNReport.java
----------------------------------------------------------------------
diff --git a/mdn/src/main/java/org/apache/james/mdn/MDNReport.java b/mdn/src/main/java/org/apache/james/mdn/MDNReport.java
index 317d3c5..b8ea4c7 100644
--- a/mdn/src/main/java/org/apache/james/mdn/MDNReport.java
+++ b/mdn/src/main/java/org/apache/james/mdn/MDNReport.java
@@ -65,7 +65,7 @@ public class MDNReport {
         public Builder originalRecipientField(String originalRecipient) {
             this.originalRecipientField = Optional.ofNullable(originalRecipient)
                 .map(Text::fromRawText)
-                .map(OriginalRecipient::new);
+                .map(text -> OriginalRecipient.builder().originalRecipient(text).build());
             return this;
         }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/c470ef0b/mdn/src/main/java/org/apache/james/mdn/fields/OriginalRecipient.java
----------------------------------------------------------------------
diff --git a/mdn/src/main/java/org/apache/james/mdn/fields/OriginalRecipient.java b/mdn/src/main/java/org/apache/james/mdn/fields/OriginalRecipient.java
index c12a87f..5349706 100644
--- a/mdn/src/main/java/org/apache/james/mdn/fields/OriginalRecipient.java
+++ b/mdn/src/main/java/org/apache/james/mdn/fields/OriginalRecipient.java
@@ -20,6 +20,7 @@
 package org.apache.james.mdn.fields;
 
 import java.util.Objects;
+import java.util.Optional;
 
 import com.google.common.base.Preconditions;
 
@@ -35,21 +36,43 @@ public class OriginalRecipient implements Field {
         return new OriginalRecipient(AddressType.UNKNOWN, address);
     }
 
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    public static class Builder {
+        private Optional<AddressType> addressType;
+        private Text originalRecipient;
+
+        private Builder() {
+            addressType = Optional.empty();
+        }
+
+        public Builder addressType(AddressType addressType) {
+            this.addressType = Optional.of(addressType);
+            return this;
+        }
+
+        public Builder originalRecipient(Text originalRecipient) {
+            this.originalRecipient = originalRecipient;
+            return this;
+        }
+
+        public OriginalRecipient build() {
+            Preconditions.checkNotNull(originalRecipient);
+
+            return new OriginalRecipient(addressType.orElse(AddressType.RFC_822), originalRecipient);
+        }
+    }
+
     private final Text originalRecipient;
     private final AddressType addressType;
 
-    public OriginalRecipient(AddressType addressType, Text originalRecipient) {
-        Preconditions.checkNotNull(addressType);
-        Preconditions.checkNotNull(originalRecipient);
-
+    private OriginalRecipient(AddressType addressType, Text originalRecipient) {
         this.addressType = addressType;
         this.originalRecipient = originalRecipient;
     }
 
-    public OriginalRecipient(Text originalRecipient) {
-        this(AddressType.RFC_822, originalRecipient);
-    }
-
     public Text getOriginalRecipient() {
         return originalRecipient;
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/c470ef0b/mdn/src/test/java/org/apache/james/mdn/MDNReportFormattingTest.java
----------------------------------------------------------------------
diff --git a/mdn/src/test/java/org/apache/james/mdn/MDNReportFormattingTest.java b/mdn/src/test/java/org/apache/james/mdn/MDNReportFormattingTest.java
index 011108b..9ab758a 100644
--- a/mdn/src/test/java/org/apache/james/mdn/MDNReportFormattingTest.java
+++ b/mdn/src/test/java/org/apache/james/mdn/MDNReportFormattingTest.java
@@ -52,7 +52,7 @@ public class MDNReportFormattingTest {
         String report = MDNReport.builder()
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .finalRecipientField(new FinalRecipient(Text.fromRawText("final_recipient")))
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
             .build()
@@ -79,7 +79,7 @@ public class MDNReportFormattingTest {
         String report = MDNReport.builder()
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .finalRecipientField(new FinalRecipient(Text.fromRawText("final_recipient")))
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
             .build()
@@ -106,7 +106,7 @@ public class MDNReportFormattingTest {
         String report = MDNReport.builder()
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .finalRecipientField(new FinalRecipient(Text.fromRawText("final_recipient")))
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
             .build()
@@ -133,7 +133,7 @@ public class MDNReportFormattingTest {
         String report = MDNReport.builder()
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .finalRecipientField(new FinalRecipient(Text.fromRawText("final_recipient")))
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
             .build()
@@ -160,7 +160,7 @@ public class MDNReportFormattingTest {
         String report = MDNReport.builder()
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .finalRecipientField(new FinalRecipient(Text.fromRawText("final_recipient")))
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
             .build()
@@ -187,7 +187,7 @@ public class MDNReportFormattingTest {
         String report = MDNReport.builder()
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .finalRecipientField(new FinalRecipient(Text.fromRawText("final_recipient")))
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
             .build()
@@ -213,7 +213,7 @@ public class MDNReportFormattingTest {
         String report = MDNReport.builder()
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .finalRecipientField(new FinalRecipient(Text.fromRawText("final_recipient")))
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
             .build()
@@ -239,7 +239,7 @@ public class MDNReportFormattingTest {
         String report = MDNReport.builder()
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .finalRecipientField(new FinalRecipient(Text.fromRawText("final_recipient")))
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
             .build()
@@ -264,7 +264,7 @@ public class MDNReportFormattingTest {
         String report = MDNReport.builder()
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .finalRecipientField(new FinalRecipient(Text.fromRawText("final_recipient")))
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
             .build()
@@ -291,7 +291,7 @@ public class MDNReportFormattingTest {
         String report = MDNReport.builder()
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").build())
             .finalRecipientField(new FinalRecipient(Text.fromRawText("final_recipient")))
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
             .build()
@@ -343,7 +343,7 @@ public class MDNReportFormattingTest {
         String report = MDNReport.builder()
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .finalRecipientField(new FinalRecipient(Text.fromRawText("final_recipient")))
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .dispositionField(disposition)
             .build()
             .formattedValue();
@@ -369,7 +369,7 @@ public class MDNReportFormattingTest {
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .gatewayField(Gateway.builder().name(Text.fromRawText("host.com")).build())
             .finalRecipientField(new FinalRecipient(Text.fromRawText("final_recipient")))
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
             .build()
@@ -398,7 +398,7 @@ public class MDNReportFormattingTest {
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .gatewayField(Gateway.builder().nameType(new AddressType("postal")).name(Text.fromRawText("5
rue Charles mercier")).build())
             .finalRecipientField(new FinalRecipient(Text.fromRawText("final_recipient")))
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
             .build()
@@ -426,7 +426,7 @@ public class MDNReportFormattingTest {
         String report = MDNReport.builder()
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .finalRecipientField(new FinalRecipient(Text.fromRawText("final_recipient")))
-            .originalRecipientField(new OriginalRecipient(new AddressType("roomNumber"),
Text.fromRawText("385")))
+            .originalRecipientField(OriginalRecipient.builder().addressType(new AddressType("roomNumber")).originalRecipient(Text.fromRawText("385")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
             .build()
@@ -454,7 +454,7 @@ public class MDNReportFormattingTest {
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .gatewayField(Gateway.builder().nameType(new AddressType("postal")).name(Text.fromRawText("8
rue Charles mercier\n 36555 Saint Coincoin\n France")).build())
             .finalRecipientField(new FinalRecipient(new AddressType("postal"), Text.fromRawText("5
rue Mercier\n 36555 Saint Coincoin\n France")))
-            .originalRecipientField(new OriginalRecipient(new AddressType("postal"), Text.fromRawText("3
rue Mercier\n 36555 Saint Coincoin\n France")))
+            .originalRecipientField(OriginalRecipient.builder().addressType(new AddressType("postal")).originalRecipient(Text.fromRawText("3
rue Mercier\n 36555 Saint Coincoin\n France")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
             .build()
@@ -515,7 +515,7 @@ public class MDNReportFormattingTest {
         String report = MDNReport.builder()
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .finalRecipientField(new FinalRecipient(new AddressType("roomNumber"), Text.fromRawText("781")))
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
             .build()
@@ -542,7 +542,7 @@ public class MDNReportFormattingTest {
         String report = MDNReport.builder()
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .finalRecipientField(new FinalRecipient(Text.fromRawText("final_recipient")))
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
             .addErrorField(new Error(Text.fromRawText("An error message")))
@@ -571,7 +571,7 @@ public class MDNReportFormattingTest {
         String report = MDNReport.builder()
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .finalRecipientField(new FinalRecipient(Text.fromRawText("final_recipient")))
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
             .addErrorFields(
@@ -603,7 +603,7 @@ public class MDNReportFormattingTest {
         String report = MDNReport.builder()
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .finalRecipientField(new FinalRecipient(Text.fromRawText("final_recipient")))
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
             .addErrorField(new Error(Text.fromRawText("An error message\non several lines")))
@@ -633,7 +633,7 @@ public class MDNReportFormattingTest {
         String report = MDNReport.builder()
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .finalRecipientField(new FinalRecipient(Text.fromRawText("final_recipient")))
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
          .withExtensionField(new ExtensionField("X-OPENPAAS-IP", "177.177.177.77"))
@@ -663,7 +663,7 @@ public class MDNReportFormattingTest {
         String report = MDNReport.builder()
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .finalRecipientField(new FinalRecipient(Text.fromRawText("final_recipient")))
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
             .withExtensionFields(

http://git-wip-us.apache.org/repos/asf/james-project/blob/c470ef0b/mdn/src/test/java/org/apache/james/mdn/MDNReportTest.java
----------------------------------------------------------------------
diff --git a/mdn/src/test/java/org/apache/james/mdn/MDNReportTest.java b/mdn/src/test/java/org/apache/james/mdn/MDNReportTest.java
index b378522..7effd8d 100644
--- a/mdn/src/test/java/org/apache/james/mdn/MDNReportTest.java
+++ b/mdn/src/test/java/org/apache/james/mdn/MDNReportTest.java
@@ -63,7 +63,7 @@ public class MDNReportTest {
         MDNReport.builder()
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
             .finalRecipientField(new FinalRecipient(Text.fromRawText("final_recipient")))
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .build();
     }
 
@@ -81,7 +81,7 @@ public class MDNReportTest {
 
         MDNReport.builder()
             .reportingUserAgentField(ReportingUserAgent.builder().userAgentName("UA_name").userAgentProduct("UA_product").build())
-            .originalRecipientField(new OriginalRecipient(Text.fromRawText("originalRecipient")))
+            .originalRecipientField(OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build())
             .originalMessageIdField(new OriginalMessageId("original_message_id"))
             .dispositionField(disposition)
             .build();
@@ -119,7 +119,7 @@ public class MDNReportTest {
         ExtensionField extensionField2 = new ExtensionField("name2", "value2");
         Gateway gateway = Gateway.builder().name(Text.fromRawText("address")).build();
         OriginalMessageId originalMessageIdField = new OriginalMessageId("msgId");
-        OriginalRecipient originalRecipientField = new OriginalRecipient(Text.fromRawText("address"));
+        OriginalRecipient originalRecipientField = OriginalRecipient.builder().originalRecipient(Text.fromRawText("originalRecipient")).build();
         ReportingUserAgent reportingUserAgentField = ReportingUserAgent.builder().userAgentName("name").build();
         Error errorField1 = new Error(Text.fromRawText("error 1"));
         Error errorField2 = new Error(Text.fromRawText("error 2"));

http://git-wip-us.apache.org/repos/asf/james-project/blob/c470ef0b/mdn/src/test/java/org/apache/james/mdn/fields/OriginalRecipientTest.java
----------------------------------------------------------------------
diff --git a/mdn/src/test/java/org/apache/james/mdn/fields/OriginalRecipientTest.java b/mdn/src/test/java/org/apache/james/mdn/fields/OriginalRecipientTest.java
index 5f9e4a6..fcc6756 100644
--- a/mdn/src/test/java/org/apache/james/mdn/fields/OriginalRecipientTest.java
+++ b/mdn/src/test/java/org/apache/james/mdn/fields/OriginalRecipientTest.java
@@ -44,49 +44,52 @@ public class OriginalRecipientTest {
     public void shouldThrowOnNullAddress() {
         expectedException.expect(NullPointerException.class);
 
-        Text originalRecipient = null;
-        new OriginalRecipient(originalRecipient);
+        OriginalRecipient.builder().originalRecipient(null).build();
     }
 
     @Test
     public void shouldThrowOnNullAddressWhenCustomType() {
         expectedException.expect(NullPointerException.class);
 
-        Text originalRecipient = null;
-        new OriginalRecipient(new AddressType("customType"), originalRecipient);
+        OriginalRecipient.builder()
+            .addressType(new AddressType("customType"))
+            .originalRecipient(null)
+            .build();
     }
 
     @Test
     public void shouldThrowOnNullAddressType() {
         expectedException.expect(NullPointerException.class);
 
-        AddressType addressType = null;
-        new OriginalRecipient(addressType, ADDRESS);
+        OriginalRecipient.builder()
+            .addressType(null)
+            .originalRecipient(ADDRESS)
+            .build();
     }
 
     @Test
     public void addressTypeShouldDefaultToRfc822() {
-        assertThat(new OriginalRecipient(ADDRESS))
-            .isEqualTo(new OriginalRecipient(AddressType.RFC_822, ADDRESS));
+        assertThat(OriginalRecipient.builder().originalRecipient(ADDRESS).build())
+            .isEqualTo(OriginalRecipient.builder().addressType(AddressType.RFC_822).originalRecipient(ADDRESS).build());
     }
 
     @Test
     public void formattedValueShouldDisplayAddress() {
-        assertThat(new OriginalRecipient(ADDRESS)
+        assertThat(OriginalRecipient.builder().originalRecipient(ADDRESS).build()
             .formattedValue())
             .isEqualTo("Original-Recipient: rfc822; address");
     }
 
     @Test
     public void formattedValueShouldDisplayCustomType() {
-        assertThat(new OriginalRecipient(new AddressType("custom"), ADDRESS)
+        assertThat(OriginalRecipient.builder().addressType(new AddressType("custom")).originalRecipient(ADDRESS).build()
             .formattedValue())
             .isEqualTo("Original-Recipient: custom; address");
     }
 
     @Test
     public void formattedValueShouldDisplayMultilineAddress() {
-        assertThat(new OriginalRecipient(Text.fromRawText("multiline\naddress"))
+        assertThat(OriginalRecipient.builder().originalRecipient(Text.fromRawText("multiline\naddress")).build()
             .formattedValue())
             .isEqualTo("Original-Recipient: rfc822; multiline\r\n" +
                 " address");


---------------------------------------------------------------------
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