james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [james-project] 02/23: JAMES-2865 Remove response accept / reject
Date Fri, 06 Sep 2019 02:01:53 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit b4caba8a651da3cae327c5af972bc026774fc5e1
Author: Benoit Tellier <btellier@linagora.com>
AuthorDate: Tue Sep 3 16:32:49 2019 +0700

    JAMES-2865 Remove response accept / reject
---
 .../james/mock/smtp/server/MockMessageHandler.java |  6 +--
 .../james/mock/smtp/server/model/Response.java     | 25 ++----------
 .../org/apache/james/mock/smtp/server/Fixture.java | 16 ++++----
 .../james/mock/smtp/server/MockSMTPServerTest.java | 44 +++++++++++-----------
 .../james/mock/smtp/server/model/ResponseTest.java | 28 ++++----------
 5 files changed, 43 insertions(+), 76 deletions(-)

diff --git a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockMessageHandler.java
b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockMessageHandler.java
index 668d37f..ff2558e 100644
--- a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockMessageHandler.java
+++ b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockMessageHandler.java
@@ -27,7 +27,6 @@ import java.util.Optional;
 import javax.mail.internet.AddressException;
 
 import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.NotImplementedException;
 import org.apache.james.core.MailAddress;
 import org.apache.james.mock.smtp.server.model.Mail;
 import org.apache.james.mock.smtp.server.model.MockSMTPBehavior;
@@ -56,10 +55,7 @@ public class MockMessageHandler implements MessageHandler {
         @Override
         public void behave(T input) throws RejectException {
             Response response = behavior.getResponse();
-            if (response.isServerRejected()) {
-                throw new RejectException(response.getCode().getRawCode(), response.getMessage());
-            }
-            throw new NotImplementedException("Not rejecting commands in mock behaviours
is not supported yet");
+            throw new RejectException(response.getCode().getRawCode(), response.getMessage());
         }
     }
 
diff --git a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/model/Response.java
b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/model/Response.java
index 341c496..bde5f18 100644
--- a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/model/Response.java
+++ b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/model/Response.java
@@ -75,39 +75,23 @@ public class Response {
         }
     }
 
-    public static Response serverReject(SMTPStatusCode code, String message) {
-        return new Response(code, message, true);
-    }
-
-    public static Response serverAccept(SMTPStatusCode code, String message) {
-        return new Response(code, message, false);
-    }
-
     private final SMTPStatusCode code;
     private final String message;
-    private final boolean serverRejected;
 
     @JsonCreator
-    private Response(@JsonProperty("code") SMTPStatusCode code,
-                     @JsonProperty("message") String message,
-                     @JsonProperty("rejected") boolean serverRejected) {
+    public Response(@JsonProperty("code") SMTPStatusCode code,
+                    @JsonProperty("message") String message) {
         Preconditions.checkNotNull(message);
         Preconditions.checkNotNull(code);
 
         this.code = code;
         this.message = message;
-        this.serverRejected = serverRejected;
     }
 
     public String asReplyString() {
         return code.getRawCode() + " " + message;
     }
 
-    @JsonProperty("rejected")
-    public boolean isServerRejected() {
-        return serverRejected;
-    }
-
     public SMTPStatusCode getCode() {
         return code;
     }
@@ -121,8 +105,7 @@ public class Response {
         if (o instanceof Response) {
             Response response = (Response) o;
 
-            return Objects.equals(this.serverRejected, response.serverRejected)
-                && Objects.equals(this.code, response.code)
+            return Objects.equals(this.code, response.code)
                 && Objects.equals(this.message, response.message);
         }
         return false;
@@ -130,6 +113,6 @@ public class Response {
 
     @Override
     public final int hashCode() {
-        return Objects.hash(code, message, serverRejected);
+        return Objects.hash(code, message);
     }
 }
diff --git a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/Fixture.java
b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/Fixture.java
index 65b6c22..2961401 100644
--- a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/Fixture.java
+++ b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/Fixture.java
@@ -43,22 +43,22 @@ public interface Fixture {
         .registerModule(new GuavaModule())
         .registerModule(MailAddressModule.MODULE);
 
-    Response RESPONSE = Response.serverAccept(Response.SMTPStatusCode.of(250), "message");
+    Response RESPONSE = new Response(Response.SMTPStatusCode.of(250), "message");
 
     String JSON_BEHAVIOR_COMPULSORY_FIELDS = "{" +
         "  \"condition\": {\"operator\":\"matchAll\"}," +
-        "  \"response\": {\"code\":250, \"message\":\"OK\", \"rejected\":false}," +
+        "  \"response\": {\"code\":250, \"message\":\"OK\"}," +
         "  \"command\": \"EHLO\"" +
         "}";
 
     MockSMTPBehavior BEHAVIOR_COMPULSORY_FIELDS = new MockSMTPBehavior(
         SMTPCommand.EHLO,
         Condition.MATCH_ALL,
-        Response.serverAccept(Response.SMTPStatusCode.ACTION_COMPLETE_250, "OK"),
+        new Response(Response.SMTPStatusCode.ACTION_COMPLETE_250, "OK"),
         MockSMTPBehavior.NumberOfAnswersPolicy.anytime());
 
     String JSON_BEHAVIOR_ALL_FIELDS = "{" +
-        "  \"response\": {\"code\":250, \"message\":\"OK\", \"rejected\":false}," +
+        "  \"response\": {\"code\":250, \"message\":\"OK\"}," +
         "  \"condition\": {\"operator\":\"contains\", \"matchingValue\":\"matchme\"}," +
         "  \"command\": \"EHLO\"," +
         "  \"numberOfAnswer\": 7" +
@@ -67,23 +67,23 @@ public interface Fixture {
     MockSMTPBehavior BEHAVIOR_ALL_FIELDS = new MockSMTPBehavior(
         SMTPCommand.EHLO,
         new Condition.OperatorCondition(Operator.CONTAINS, "matchme"),
-        Response.serverAccept(Response.SMTPStatusCode.of(250), "OK"),
+        new Response(Response.SMTPStatusCode.of(250), "OK"),
         MockSMTPBehavior.NumberOfAnswersPolicy.times(7));
 
     MockSMTPBehavior BEHAVIOR_MATCHING_EVERYTIME = new MockSMTPBehavior(
         SMTPCommand.MAIL_FROM,
         Condition.MATCH_ALL,
-        Response.serverReject(Response.SMTPStatusCode.COMMAND_NOT_IMPLEMENTED_502, "match
all messages"),
+        new Response(Response.SMTPStatusCode.COMMAND_NOT_IMPLEMENTED_502, "match all messages"),
         MockSMTPBehavior.NumberOfAnswersPolicy.anytime());
     MockSMTPBehavior BEHAVIOR_MATCHING_2_TIMES = new MockSMTPBehavior(
         SMTPCommand.MAIL_FROM,
         Condition.MATCH_ALL,
-        Response.serverReject(Response.SMTPStatusCode.COMMAND_NOT_IMPLEMENTED_502, "match
all messages"),
+        new Response(Response.SMTPStatusCode.COMMAND_NOT_IMPLEMENTED_502, "match all messages"),
         MockSMTPBehavior.NumberOfAnswersPolicy.times(2));
     MockSMTPBehavior BEHAVIOR_MATCHING_3_TIMES = new MockSMTPBehavior(
         SMTPCommand.MAIL_FROM,
         Condition.MATCH_ALL,
-        Response.serverReject(Response.SMTPStatusCode.COMMAND_NOT_IMPLEMENTED_502, "match
all messages"),
+        new Response(Response.SMTPStatusCode.COMMAND_NOT_IMPLEMENTED_502, "match all messages"),
         MockSMTPBehavior.NumberOfAnswersPolicy.times(3));
 
     String JSON_BEHAVIORS = "[" + JSON_BEHAVIOR_ALL_FIELDS + ", "
diff --git a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/MockSMTPServerTest.java
b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/MockSMTPServerTest.java
index 47a7c04..bd7f361 100644
--- a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/MockSMTPServerTest.java
+++ b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/MockSMTPServerTest.java
@@ -141,7 +141,7 @@ class MockSMTPServerTest {
             behaviorRepository.setBehaviors(new MockSMTPBehavior(
                 MAIL_FROM,
                 Condition.MATCH_ALL,
-                Response.serverReject(SERVICE_NOT_AVAILABLE_421, "mock response"),
+                new Response(SERVICE_NOT_AVAILABLE_421, "mock response"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.anytime()));
 
             assertThatThrownBy(() -> smtpClient.sendMessage(mail1))
@@ -154,7 +154,7 @@ class MockSMTPServerTest {
             behaviorRepository.setBehaviors(new MockSMTPBehavior(
                 RCPT_TO,
                 Condition.MATCH_ALL,
-                Response.serverReject(SERVICE_NOT_AVAILABLE_421, "mock response"),
+                new Response(SERVICE_NOT_AVAILABLE_421, "mock response"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.anytime()));
 
             assertThatThrownBy(() -> smtpClient.sendMessage(mail1))
@@ -167,7 +167,7 @@ class MockSMTPServerTest {
             behaviorRepository.setBehaviors(new MockSMTPBehavior(
                 DATA,
                 Condition.MATCH_ALL,
-                Response.serverReject(SERVICE_NOT_AVAILABLE_421, "mock response"),
+                new Response(SERVICE_NOT_AVAILABLE_421, "mock response"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.anytime()));
 
             assertThatThrownBy(() -> smtpClient.sendMessage(mail1))
@@ -183,7 +183,7 @@ class MockSMTPServerTest {
             behaviorRepository.setBehaviors(new MockSMTPBehavior(
                 MAIL_FROM,
                 Condition.MATCH_ALL,
-                Response.serverReject(SERVICE_NOT_AVAILABLE_421, "mock response"),
+                new Response(SERVICE_NOT_AVAILABLE_421, "mock response"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.anytime()));
 
             sendMessageIgnoreError(mail1);
@@ -199,7 +199,7 @@ class MockSMTPServerTest {
             MockSMTPBehavior behavior = new MockSMTPBehavior(
                 MAIL_FROM,
                 Condition.MATCH_ALL,
-                Response.serverReject(SERVICE_NOT_AVAILABLE_421, "mock response"),
+                new Response(SERVICE_NOT_AVAILABLE_421, "mock response"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.times(numberOfAnswer));
 
             behaviorRepository.setBehaviors(behavior);
@@ -216,7 +216,7 @@ class MockSMTPServerTest {
             MockSMTPBehavior behavior = new MockSMTPBehavior(
                 MAIL_FROM,
                 Condition.MATCH_ALL,
-                Response.serverReject(SERVICE_NOT_AVAILABLE_421, "mock response"),
+                new Response(SERVICE_NOT_AVAILABLE_421, "mock response"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.times(numberOfAnswer));
 
             behaviorRepository.setBehaviors(behavior);
@@ -237,14 +237,14 @@ class MockSMTPServerTest {
             MockSMTPBehavior matched = new MockSMTPBehavior(
                 MAIL_FROM,
                 Condition.MATCH_ALL,
-                Response.serverReject(SERVICE_NOT_AVAILABLE_421, "matched"),
+                new Response(SERVICE_NOT_AVAILABLE_421, "matched"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.times(matchedBehaviorAnswers));
 
             int nonMatchedBehaviorAnswers = 3;
             MockSMTPBehavior nonMatched = new MockSMTPBehavior(
                 RCPT_TO,
                 new Condition.OperatorCondition(Operator.CONTAINS, "nonMatched"),
-                Response.serverReject(SERVICE_NOT_AVAILABLE_421, "non matched"),
+                new Response(SERVICE_NOT_AVAILABLE_421, "non matched"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.times(nonMatchedBehaviorAnswers));
 
             behaviorRepository.setBehaviors(matched, nonMatched);
@@ -261,14 +261,14 @@ class MockSMTPServerTest {
             MockSMTPBehavior matchesAnyFrom = new MockSMTPBehavior(
                 MAIL_FROM,
                 Condition.MATCH_ALL,
-                Response.serverReject(SERVICE_NOT_AVAILABLE_421, "any from will be matched"),
+                new Response(SERVICE_NOT_AVAILABLE_421, "any from will be matched"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.times(firstBehaviorAnswers));
 
             int secondBehaviorAnswers = 3;
             MockSMTPBehavior matchesAnyRecipient = new MockSMTPBehavior(
                 RCPT_TO,
                 Condition.MATCH_ALL,
-                Response.serverReject(SERVICE_NOT_AVAILABLE_421, "any recipient will be matched"),
+                new Response(SERVICE_NOT_AVAILABLE_421, "any recipient will be matched"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.times(secondBehaviorAnswers));
 
             behaviorRepository.setBehaviors(matchesAnyFrom, matchesAnyRecipient);
@@ -288,13 +288,13 @@ class MockSMTPServerTest {
             MockSMTPBehavior matched = new MockSMTPBehavior(
                 MAIL_FROM,
                 new Condition.OperatorCondition(Operator.CONTAINS, BOB),
-                Response.serverReject(SERVICE_NOT_AVAILABLE_421, "sender bob should match"),
+                new Response(SERVICE_NOT_AVAILABLE_421, "sender bob should match"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.anytime());
 
             MockSMTPBehavior nonMatched = new MockSMTPBehavior(
                 MAIL_FROM,
                 new Condition.OperatorCondition(Operator.CONTAINS, ALICE),
-                Response.serverReject(REQUESTED_MAIL_ACTION_NOT_TAKEN_450, "sender alice
should match"),
+                new Response(REQUESTED_MAIL_ACTION_NOT_TAKEN_450, "sender alice should match"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.anytime());
 
             behaviorRepository.setBehaviors(matched, nonMatched);
@@ -309,13 +309,13 @@ class MockSMTPServerTest {
             MockSMTPBehavior nonMatched = new MockSMTPBehavior(
                 RCPT_TO,
                 new Condition.OperatorCondition(Operator.CONTAINS, BOB),
-                Response.serverReject(SERVICE_NOT_AVAILABLE_421, "recipient bob should match"),
+                new Response(SERVICE_NOT_AVAILABLE_421, "recipient bob should match"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.anytime());
 
             MockSMTPBehavior matched = new MockSMTPBehavior(
                 RCPT_TO,
                 new Condition.OperatorCondition(Operator.CONTAINS, ALICE),
-                Response.serverReject(REQUESTED_MAIL_ACTION_NOT_TAKEN_450, "recipient alice
should match"),
+                new Response(REQUESTED_MAIL_ACTION_NOT_TAKEN_450, "recipient alice should
match"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.anytime());
 
             behaviorRepository.setBehaviors(matched, nonMatched);
@@ -330,13 +330,13 @@ class MockSMTPServerTest {
             MockSMTPBehavior nonMatched = new MockSMTPBehavior(
                 DATA,
                 new Condition.OperatorCondition(Operator.CONTAINS, "nonRelatedString"),
-                Response.serverReject(SERVICE_NOT_AVAILABLE_421, "contains 'nonRelatedString'
should match"),
+                new Response(SERVICE_NOT_AVAILABLE_421, "contains 'nonRelatedString' should
match"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.anytime());
 
             MockSMTPBehavior matched = new MockSMTPBehavior(
                 DATA,
                 new Condition.OperatorCondition(Operator.CONTAINS, "text"),
-                Response.serverReject(REQUESTED_MAIL_ACTION_NOT_TAKEN_450, "contains 'text'
should match"),
+                new Response(REQUESTED_MAIL_ACTION_NOT_TAKEN_450, "contains 'text' should
match"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.anytime());
 
             behaviorRepository.setBehaviors(matched, nonMatched);
@@ -352,14 +352,14 @@ class MockSMTPServerTest {
             MockSMTPBehavior matched = new MockSMTPBehavior(
                 MAIL_FROM,
                 new Condition.OperatorCondition(Operator.CONTAINS, BOB),
-                Response.serverReject(SERVICE_NOT_AVAILABLE_421, "sender bob should match"),
+                new Response(SERVICE_NOT_AVAILABLE_421, "sender bob should match"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.times(matchedAnswerOriginalCount));
 
             int nonMatchedAnswerOriginalCount = 5;
             MockSMTPBehavior nonMatched = new MockSMTPBehavior(
                 MAIL_FROM,
                 new Condition.OperatorCondition(Operator.CONTAINS, ALICE),
-                Response.serverReject(REQUESTED_MAIL_ACTION_NOT_TAKEN_450, "sender alice
should match"),
+                new Response(REQUESTED_MAIL_ACTION_NOT_TAKEN_450, "sender alice should match"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.times(nonMatchedAnswerOriginalCount));
 
             behaviorRepository.setBehaviors(matched, nonMatched);
@@ -377,14 +377,14 @@ class MockSMTPServerTest {
             MockSMTPBehavior matched = new MockSMTPBehavior(
                 MAIL_FROM,
                 new Condition.OperatorCondition(Operator.CONTAINS, BOB),
-                Response.serverReject(SERVICE_NOT_AVAILABLE_421, "sender bob should match"),
+                new Response(SERVICE_NOT_AVAILABLE_421, "sender bob should match"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.times(matchedAnswerOriginalCount));
 
             int nonMatchedAnswerOriginalCount = 5;
             MockSMTPBehavior nonMatched = new MockSMTPBehavior(
                 MAIL_FROM,
                 new Condition.OperatorCondition(Operator.CONTAINS, ALICE),
-                Response.serverReject(REQUESTED_MAIL_ACTION_NOT_TAKEN_450, "sender alice
should match"),
+                new Response(REQUESTED_MAIL_ACTION_NOT_TAKEN_450, "sender alice should match"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.times(nonMatchedAnswerOriginalCount));
 
             behaviorRepository.setBehaviors(matched, nonMatched);
@@ -401,14 +401,14 @@ class MockSMTPServerTest {
             MockSMTPBehavior matched = new MockSMTPBehavior(
                 RCPT_TO,
                 new Condition.OperatorCondition(Operator.CONTAINS, ALICE),
-                Response.serverReject(SERVICE_NOT_AVAILABLE_421, "recipient alice should
match"),
+                new Response(SERVICE_NOT_AVAILABLE_421, "recipient alice should match"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.times(matchedOriginalCount));
 
             int qualifiedButNotMatchedOriginalCount = 5;
             MockSMTPBehavior qualifiedButNotMatched = new MockSMTPBehavior(
                 RCPT_TO,
                 new Condition.OperatorCondition(Operator.CONTAINS, JACK),
-                Response.serverReject(REQUESTED_MAIL_ACTION_NOT_TAKEN_450, "recipient jack
should match"),
+                new Response(REQUESTED_MAIL_ACTION_NOT_TAKEN_450, "recipient jack should
match"),
                 MockSMTPBehavior.NumberOfAnswersPolicy.times(qualifiedButNotMatchedOriginalCount));
 
             behaviorRepository.setBehaviors(matched, qualifiedButNotMatched);
diff --git a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/model/ResponseTest.java
b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/model/ResponseTest.java
index 4f7c985..ca9ae3c 100644
--- a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/model/ResponseTest.java
+++ b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/model/ResponseTest.java
@@ -81,56 +81,44 @@ class ResponseTest {
 
     @Test
     void constructorShouldThrowWhenMessageIsNull() {
-        assertThatThrownBy(() -> Response.serverReject(SMTPStatusCode.ACTION_COMPLETE_250,
null))
+        assertThatThrownBy(() -> new Response(SMTPStatusCode.ACTION_COMPLETE_250, null))
             .isInstanceOf(NullPointerException.class);
     }
 
     @Test
     void constructorShouldThrowWhenCodeIsNull() {
-        assertThatThrownBy(() -> Response.serverReject(null, "message"))
+        assertThatThrownBy(() -> new Response(null, "message"))
             .isInstanceOf(NullPointerException.class);
     }
 
     @Test
     void asReplyStringShouldReturnASMTPResponseLine() {
-        assertThat(Response.serverReject(SMTPStatusCode.ACTION_COMPLETE_250, "message").asReplyString())
+        assertThat(new Response(SMTPStatusCode.ACTION_COMPLETE_250, "message").asReplyString())
             .isEqualTo("250 message");
     }
 
     @Test
     void asReplyStringShouldReturnASMTPResponseLineWhenEmptyMessage() {
-        assertThat(Response.serverReject(SMTPStatusCode.ACTION_COMPLETE_250, "").asReplyString())
+        assertThat(new Response(SMTPStatusCode.ACTION_COMPLETE_250, "").asReplyString())
             .isEqualTo("250 ");
     }
 
-    @Test
-    void isServerRejectedShouldReturnTrueWhenServerReject() {
-        assertThat(Response.serverReject(SMTPStatusCode.ACTION_COMPLETE_250, "message").isServerRejected())
-            .isTrue();
-    }
-
-    @Test
-    void isServerRejectedShouldReturnFalseWhenServerAccept() {
-        assertThat(Response.serverAccept(SMTPStatusCode.ACTION_COMPLETE_250, "message").isServerRejected())
-            .isFalse();
-    }
-
     @Nested
     class JSONTest {
         @Test
         void jacksonShouldDeserializeResponse() throws Exception {
             Response response = OBJECT_MAPPER.readValue(
-                "{\"code\":250, \"message\":\"OK\", \"rejected\":false}",
+                "{\"code\":250, \"message\":\"OK\"}",
                 Response.class);
 
-            assertThat(response).isEqualTo(Response.serverAccept(Response.SMTPStatusCode.of(250),
"OK"));
+            assertThat(response).isEqualTo(new Response(Response.SMTPStatusCode.of(250),
"OK"));
         }
 
         @Test
         void jacksonShouldSerializeResponse() throws Exception {
-            String json = OBJECT_MAPPER.writeValueAsString(Response.serverAccept(Response.SMTPStatusCode.of(250),
"OK"));
+            String json = OBJECT_MAPPER.writeValueAsString(new Response(Response.SMTPStatusCode.of(250),
"OK"));
 
-            assertThatJson(json).isEqualTo("{\"code\":250, \"message\":\"OK\", \"rejected\":false}");
+            assertThatJson(json).isEqualTo("{\"code\":250, \"message\":\"OK\"}");
         }
     }
 }
\ No newline at end of file


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