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 ad...@apache.org on 2016/03/04 11:01:39 UTC

[1/3] james-project git commit: JAMES-1699 add tests for JAMES-1692 setMessages - send a new message

Repository: james-project
Updated Branches:
  refs/heads/master 9e3a28cdb -> 0af4d200f


JAMES-1699 add tests for JAMES-1692 setMessages - send a new message

check messsages are moved from sender's outbox to sent mailbox
check recipient's inbox has a new message once sender has sent a new message.


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

Branch: refs/heads/master
Commit: bf65ad956bd22227018759fefb8c187ab6980b7d
Parents: 45d2607
Author: Fabien Vignon <fv...@linagora.com>
Authored: Tue Mar 1 14:58:16 2016 +0100
Committer: Fabien Vignon <fv...@linagora.com>
Committed: Fri Mar 4 10:51:53 2016 +0100

----------------------------------------------------------------------
 .../jmap/methods/SetMessagesMethodTest.java     | 238 ++++++++++++++++---
 1 file changed, 210 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/bf65ad95/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/SetMessagesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/SetMessagesMethodTest.java b/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/SetMessagesMethodTest.java
index 70dcd8f..fa16c1f 100644
--- a/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/SetMessagesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/SetMessagesMethodTest.java
@@ -39,6 +39,7 @@ import java.io.ByteArrayInputStream;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.TimeUnit;
 
 import javax.mail.Flags;
 
@@ -59,6 +60,9 @@ import org.junit.rules.RuleChain;
 import org.junit.rules.TemporaryFolder;
 
 import com.google.common.base.Charsets;
+import com.jayway.awaitility.Awaitility;
+import com.jayway.awaitility.Duration;
+import com.jayway.awaitility.core.ConditionFactory;
 import com.jayway.restassured.RestAssured;
 import com.jayway.restassured.builder.ResponseSpecBuilder;
 import com.jayway.restassured.http.ContentType;
@@ -68,12 +72,15 @@ public abstract class SetMessagesMethodTest {
 
     private static final String NAME = "[0][0]";
     private static final String ARGUMENTS = "[0][1]";
+    public static final String SECOND_NAME = "[1][0]";
+    public static final String SECOND_ARGUMENTS = "[1][1]";
+    public static final String USERS_DOMAIN = "domain.tld";
 
     private final TemporaryFolder temporaryFolder = new TemporaryFolder();
     private final EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch();
     private final EmbeddedCassandra cassandra = EmbeddedCassandra.createStartServer();
     private final JmapServer jmapServer = jmapServer(temporaryFolder, embeddedElasticSearch, cassandra);
-    private String outboxId;
+    private ConditionFactory calmlyAwait;
 
     protected abstract JmapServer jmapServer(TemporaryFolder temporaryFolder, EmbeddedElasticSearch embeddedElasticSearch, EmbeddedCassandra cassandra);
 
@@ -91,32 +98,39 @@ public abstract class SetMessagesMethodTest {
         RestAssured.port = jmapServer.getPort();
         RestAssured.config = newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8));
 
-        String domain = "domain.tld";
-        username = "username@" + domain;
+        username = "username@" + USERS_DOMAIN;
         String password = "password";
-        jmapServer.serverProbe().addDomain(domain);
+        jmapServer.serverProbe().addDomain(USERS_DOMAIN);
         jmapServer.serverProbe().addUser(username, password);
-        jmapServer.serverProbe().createMailbox("#private", "username", "inbox");
+        jmapServer.serverProbe().createMailbox("#private", username, "inbox");
         accessToken = JmapAuthentication.authenticateJamesUser(username, password);
 
         jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "outbox");
         embeddedElasticSearch.awaitForElasticSearch();
-        // Find the newly created outbox mailbox (using getMailboxes command on /jmap endpoint)
-        List<Map<String, String>> mailboxes = with()
+
+        Duration slowPacedPollInterval = Duration.FIVE_HUNDRED_MILLISECONDS;
+        calmlyAwait = Awaitility.with().pollInterval(slowPacedPollInterval).and().with().pollDelay(slowPacedPollInterval).await();
+    }
+
+    private String getOutboxId() {
+        // Find username's outbox (using getMailboxes command on /jmap endpoint)
+        return getAllMailboxesIds(accessToken).stream()
+                .filter(x -> x.get("role").equals("outbox"))
+                .map(x -> x.get("id"))
+                .findFirst().get();
+    }
+
+    private List<Map<String, String>> getAllMailboxesIds(AccessToken accessToken) {
+        return with()
                 .accept(ContentType.JSON)
                 .contentType(ContentType.JSON)
                 .header("Authorization", accessToken.serialize())
                 .body("[[\"getMailboxes\", {\"properties\": [\"role\", \"id\"]}, \"#0\"]]")
-                .post("/jmap")
+        .post("/jmap")
                 .andReturn()
                 .body()
                 .jsonPath()
                 .getList(ARGUMENTS + ".list");
-
-        outboxId = mailboxes.stream()
-                .filter(x -> x.get("role").equals("outbox"))
-                .map(x -> x.get("id"))
-                .findFirst().get();
     }
 
     @Test
@@ -201,7 +215,7 @@ public abstract class SetMessagesMethodTest {
         // Given
         jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox");
 
-        jmapServer.serverProbe().appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), 
+        jmapServer.serverProbe().appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"),
                 new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
         embeddedElasticSearch.awaitForElasticSearch();
 
@@ -225,7 +239,7 @@ public abstract class SetMessagesMethodTest {
         // Given
         jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox");
 
-        jmapServer.serverProbe().appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), 
+        jmapServer.serverProbe().appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"),
                 new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
         embeddedElasticSearch.awaitForElasticSearch();
 
@@ -258,13 +272,13 @@ public abstract class SetMessagesMethodTest {
     public void setMessagesShouldReturnDestroyedNotDestroyWhenMixed() throws Exception {
         jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox");
 
-        jmapServer.serverProbe().appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), 
+        jmapServer.serverProbe().appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"),
                 new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
 
-        jmapServer.serverProbe().appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), 
+        jmapServer.serverProbe().appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"),
                 new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
 
-        jmapServer.serverProbe().appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), 
+        jmapServer.serverProbe().appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"),
                 new ByteArrayInputStream("Subject: test3\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
         embeddedElasticSearch.awaitForElasticSearch();
 
@@ -293,13 +307,13 @@ public abstract class SetMessagesMethodTest {
         // Given
         jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox");
 
-        jmapServer.serverProbe().appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), 
+        jmapServer.serverProbe().appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"),
                 new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
 
-        jmapServer.serverProbe().appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), 
+        jmapServer.serverProbe().appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"),
                 new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
 
-        jmapServer.serverProbe().appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), 
+        jmapServer.serverProbe().appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"),
                 new ByteArrayInputStream("Subject: test3\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
         embeddedElasticSearch.awaitForElasticSearch();
 
@@ -660,7 +674,7 @@ public abstract class SetMessagesMethodTest {
                 "        \"to\": [{ \"name\": \"BOB\", \"email\": \"someone@example.com\"}]," +
                 "        \"subject\": \"Thank you for joining example.com!\"," +
                 "        \"textBody\": \"Hello someone, and thank you for joining example.com!\"," +
-                "        \"mailboxIds\": [\"" + outboxId + "\"]" +
+                "        \"mailboxIds\": [\"" + getOutboxId() + "\"]" +
                 "      }}" +
                 "    }," +
                 "    \"#0\"" +
@@ -706,6 +720,7 @@ public abstract class SetMessagesMethodTest {
         String messageCreationId = "user|inbox|1";
         String presumedMessageId = "username@domain.tld|outbox|1";
         String messageSubject = "Thank you for joining example.com!";
+        String outboxId = getOutboxId();
         String requestBody = "[" +
                 "  [" +
                 "    \"setMessages\","+
@@ -742,7 +757,67 @@ public abstract class SetMessagesMethodTest {
                 .body(NAME, equalTo("messages"))
                 .body(ARGUMENTS + ".list", hasSize(1))
                 .body(ARGUMENTS + ".list[0].subject", equalTo(messageSubject))
-                .log().ifValidationFails();
+                .body(ARGUMENTS + ".list[0].mailboxIds", contains(outboxId))
+                ;
+    }
+
+    @Test
+    public void setMessagesShouldMoveMessageInSentWhenMessageIsSent() throws MailboxException {
+        // Given
+        jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "sent");
+        String sentMailboxId = getAllMailboxesIds(accessToken).stream()
+                .filter(x -> x.get("role").equals("sent"))
+                .map(x -> x.get("id"))
+                .findFirst().get();
+
+        String messageCreationId = "user|inbox|1";
+        String messageSubject = "Thank you for joining example.com!";
+        String requestBody = "[" +
+                "  [" +
+                "    \"setMessages\","+
+                "    {" +
+                "      \"create\": { \"" + messageCreationId  + "\" : {" +
+                "        \"from\": { \"name\": \"MAILER-DAEMON\", \"email\": \"postmaster@example.com\"}," +
+                "        \"to\": [{ \"name\": \"BOB\", \"email\": \"someone@example.com\"}]," +
+                "        \"subject\": \"" + messageSubject + "\"," +
+                "        \"textBody\": \"Hello someone, and thank you for joining example.com!\"," +
+                "        \"mailboxIds\": [\"" + getOutboxId() + "\"]" +
+                "      }}" +
+                "    }," +
+                "    \"#0\"" +
+                "  ]" +
+                "]";
+
+        given()
+                .accept(ContentType.JSON)
+                .contentType(ContentType.JSON)
+                .header("Authorization", accessToken.serialize())
+                .body(requestBody)
+        // When
+        .when()
+                .post("/jmap");
+
+        // Then
+        calmlyAwait.atMost(10, TimeUnit.SECONDS).until( () -> messageHasBeenMovedToSentBox(sentMailboxId));
+    }
+
+    private boolean messageHasBeenMovedToSentBox(String sentMailboxId) {
+        try {
+            with()
+                    .accept(ContentType.JSON)
+                    .contentType(ContentType.JSON)
+                    .header("Authorization", accessToken.serialize())
+                    .body("[[\"getMessageList\", {\"fetchMessages\":true, \"filter\":{\"inMailboxes\":[\"" + sentMailboxId + "\"]}}, \"#0\"]]")
+            .when()
+                    .post("/jmap")
+            .then()
+                    .statusCode(200)
+                    .body(SECOND_NAME, equalTo("messages"))
+                    .body(SECOND_ARGUMENTS + ".list", hasSize(1));
+            return true;
+        } catch(AssertionError e) {
+            return false;
+        }
     }
 
     @Test
@@ -758,7 +833,7 @@ public abstract class SetMessagesMethodTest {
                 "        \"cc\": [{ \"name\": \"ALICE\"}]," +
                 "        \"subject\": \"Thank you for joining example.com!\"," +
                 "        \"textBody\": \"Hello someone, and thank you for joining example.com!\"," +
-                "        \"mailboxIds\": [\"" + outboxId + "\"]" +
+                "        \"mailboxIds\": [\"" + getOutboxId() + "\"]" +
                 "      }}" +
                 "    }," +
                 "    \"#0\"" +
@@ -795,7 +870,7 @@ public abstract class SetMessagesMethodTest {
                 "        \"cc\": [{ \"name\": \"ALICE\"}]," +
                 "        \"subject\": \"Thank you for joining example.com!\"," +
                 "        \"textBody\": \"Hello someone, and thank you for joining example.com!\"," +
-                "        \"mailboxIds\": [\"" + outboxId + "\"]" +
+                "        \"mailboxIds\": [\"" + getOutboxId() + "\"]" +
                 "      }}" +
                 "    }," +
                 "    \"#0\"" +
@@ -835,7 +910,7 @@ public abstract class SetMessagesMethodTest {
                 "        \"cc\": [{ \"name\": \"ALICE\"}]," +
                 "        \"subject\": \"Thank you for joining example.com!\"," +
                 "        \"textBody\": \"Hello someone, and thank you for joining example.com!\"," +
-                "        \"mailboxIds\": [\"" + outboxId + "\"]" +
+                "        \"mailboxIds\": [\"" + getOutboxId() + "\"]" +
                 "      }}" +
                 "    }," +
                 "    \"#0\"" +
@@ -861,6 +936,47 @@ public abstract class SetMessagesMethodTest {
     }
 
     @Test
+    public void setMessagesShouldMoveToSentWhenSendingMessageWithOnlyFromAddress() {
+        jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "sent");
+        String sentMailboxId = getAllMailboxesIds(accessToken).stream()
+                .filter(x -> x.get("role").equals("sent"))
+                .map(x -> x.get("id"))
+                .findFirst().get();
+
+        String messageCreationId = "user|inbox|1";
+        String fromAddress = "postmaster@example.com";
+        String requestBody = "[" +
+                "  [" +
+                "    \"setMessages\","+
+                "    {" +
+                "      \"create\": { \"" + messageCreationId  + "\" : {" +
+                "        \"from\": { \"email\": \"" + fromAddress + "\"}," +
+                "        \"to\": [{ \"name\": \"BOB\", \"email\": \"someone@example.com\"}]," +
+                "        \"cc\": [{ \"name\": \"ALICE\"}]," +
+                "        \"subject\": \"Thank you for joining example.com!\"," +
+                "        \"textBody\": \"Hello someone, and thank you for joining example.com!\"," +
+                "        \"mailboxIds\": [\"" + getOutboxId() + "\"]" +
+                "      }}" +
+                "    }," +
+                "    \"#0\"" +
+                "  ]" +
+                "]";
+
+        // Given
+        given()
+                .accept(ContentType.JSON)
+                .contentType(ContentType.JSON)
+                .header("Authorization", accessToken.serialize())
+                .body(requestBody)
+        // When
+        .when()
+                .post("/jmap");
+        // Then
+        calmlyAwait.atMost(10, TimeUnit.SECONDS).until( () -> messageHasBeenMovedToSentBox(sentMailboxId));
+    }
+
+
+    @Test
     public void setMessagesShouldRejectWhenSendingMessageHasMissingSubject() {
         String messageCreationId = "user|inbox|1";
         String requestBody = "[" +
@@ -872,7 +988,7 @@ public abstract class SetMessagesMethodTest {
                 "        \"to\": [{ \"name\": \"BOB\", \"email\": \"someone@example.com\"}]," +
                 "        \"cc\": [{ \"name\": \"ALICE\"}]," +
                 "        \"textBody\": \"Hello someone, and thank you for joining example.com!\"," +
-                "        \"mailboxIds\": [\"" + outboxId + "\"]" +
+                "        \"mailboxIds\": [\"" + getOutboxId() + "\"]" +
                 "      }}" +
                 "    }," +
                 "    \"#0\"" +
@@ -897,4 +1013,70 @@ public abstract class SetMessagesMethodTest {
                 .body(ARGUMENTS + ".notCreated[\""+messageCreationId+"\"].description", endsWith("'subject' is missing"))
                 .body(ARGUMENTS + ".created", aMapWithSize(0));
     }
-}
\ No newline at end of file
+
+    @Test
+    public void setMessagesShouldPushMessageIntoRecipientUsersInbox() throws Exception {
+        // Sender
+        jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "sent");
+        // Recipient
+        String recipientAddress = "recipient" + "@" + USERS_DOMAIN;
+        String password = "password";
+        jmapServer.serverProbe().addUser(recipientAddress, password);
+        jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, recipientAddress, "inbox");
+        embeddedElasticSearch.awaitForElasticSearch();
+        AccessToken recipientToken = JmapAuthentication.authenticateJamesUser(recipientAddress, password);
+
+        String messageCreationId = "user|inbox|1";
+        String fromAddress = username;
+        String requestBody = "[" +
+                "  [" +
+                "    \"setMessages\","+
+                "    {" +
+                "      \"create\": { \"" + messageCreationId  + "\" : {" +
+                "        \"from\": { \"email\": \"" + fromAddress + "\"}," +
+                "        \"to\": [{ \"name\": \"BOB\", \"email\": \"" + recipientAddress + "\"}]," +
+                "        \"cc\": [{ \"name\": \"ALICE\"}]," +
+                "        \"subject\": \"Thank you for joining example.com!\"," +
+                "        \"textBody\": \"Hello someone, and thank you for joining example.com!\"," +
+                "        \"mailboxIds\": [\"" + getOutboxId() + "\"]" +
+                "      }}" +
+                "    }," +
+                "    \"#0\"" +
+                "  ]" +
+                "]";
+
+        // Given
+        given()
+                .accept(ContentType.JSON)
+                .contentType(ContentType.JSON)
+                .header("Authorization", this.accessToken.serialize())
+                .body(requestBody)
+        // When
+        .when()
+                .post("/jmap");
+
+        // Then
+        calmlyAwait.atMost(10, TimeUnit.SECONDS).until( () -> messageHaveBeenDeliveredToRecipientsInbox(recipientToken));
+    }
+
+    private boolean messageHaveBeenDeliveredToRecipientsInbox(AccessToken recipientToken) {
+        try {
+            with()
+                    .accept(ContentType.JSON)
+                    .contentType(ContentType.JSON)
+                    .header("Authorization", recipientToken.serialize())
+                    .body("[[\"getMessageList\", {}, \"#0\"]]")
+            .when()
+                    .post("/jmap")
+            .then()
+                    .statusCode(200)
+                    .body(NAME, equalTo("messageList"))
+                    .body(ARGUMENTS + ".messageIds", hasSize(1))
+            ;
+            return true;
+        } catch(AssertionError e) {
+            return false;
+        }
+    }
+
+}


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


[3/3] james-project git commit: Merge remote-tracking branch 'fvignon/JAMES-1699'

Posted by ad...@apache.org.
Merge remote-tracking branch 'fvignon/JAMES-1699'


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

Branch: refs/heads/master
Commit: 0af4d200fbffc36f144f03edc5201420c220b582
Parents: 9e3a28c 7d25d87
Author: Antoine Duprat <ad...@linagora.com>
Authored: Fri Mar 4 11:01:13 2016 +0100
Committer: Antoine Duprat <ad...@linagora.com>
Committed: Fri Mar 4 11:01:13 2016 +0100

----------------------------------------------------------------------
 .../jmap/methods/SetMessagesMethodTest.java     | 244 ++++++++++++++++---
 .../protocols/jmap/doc/specs/spec/message.mdwn  |   1 -
 2 files changed, 213 insertions(+), 32 deletions(-)
----------------------------------------------------------------------



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


[2/3] james-project git commit: JAMES-1699 spec: mark setMessages/send message as implemented

Posted by ad...@apache.org.
JAMES-1699 spec: mark setMessages/send message as implemented


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

Branch: refs/heads/master
Commit: 7d25d879745e1c123c3715434408b51718714b04
Parents: bf65ad9
Author: Fabien Vignon <fv...@linagora.com>
Authored: Thu Mar 3 15:43:02 2016 +0100
Committer: Fabien Vignon <fv...@linagora.com>
Committed: Fri Mar 4 10:51:54 2016 +0100

----------------------------------------------------------------------
 .../james/jmap/methods/SetMessagesMethodTest.java | 18 +++++++++---------
 server/protocols/jmap/doc/specs/spec/message.mdwn |  1 -
 2 files changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/7d25d879/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/SetMessagesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/SetMessagesMethodTest.java b/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/SetMessagesMethodTest.java
index fa16c1f..1828097 100644
--- a/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/SetMessagesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/SetMessagesMethodTest.java
@@ -72,9 +72,9 @@ public abstract class SetMessagesMethodTest {
 
     private static final String NAME = "[0][0]";
     private static final String ARGUMENTS = "[0][1]";
-    public static final String SECOND_NAME = "[1][0]";
-    public static final String SECOND_ARGUMENTS = "[1][1]";
-    public static final String USERS_DOMAIN = "domain.tld";
+    private static final String SECOND_NAME = "[1][0]";
+    private static final String SECOND_ARGUMENTS = "[1][1]";
+    private static final String USERS_DOMAIN = "domain.tld";
 
     private final TemporaryFolder temporaryFolder = new TemporaryFolder();
     private final EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch();
@@ -670,7 +670,7 @@ public abstract class SetMessagesMethodTest {
                 "    \"setMessages\","+
                 "    {" +
                 "      \"create\": { \"" + messageCreationId  + "\" : {" +
-                "        \"from\": { \"name\": \"MAILER-DEAMON\", \"email\": \"postmaster@example.com\"}," +
+                "        \"from\": { \"name\": \"MAILER-DAEMON\", \"email\": \"postmaster@example.com\"}," +
                 "        \"to\": [{ \"name\": \"BOB\", \"email\": \"someone@example.com\"}]," +
                 "        \"subject\": \"Thank you for joining example.com!\"," +
                 "        \"textBody\": \"Hello someone, and thank you for joining example.com!\"," +
@@ -828,7 +828,7 @@ public abstract class SetMessagesMethodTest {
                 "    \"setMessages\","+
                 "    {" +
                 "      \"create\": { \"" + messageCreationId  + "\" : {" +
-                "        \"from\": { \"name\": \"MAILER-DEAMON\", \"email\": \"postmaster@example.com\"}," +
+                "        \"from\": { \"name\": \"MAILER-DAEMON\", \"email\": \"postmaster@example.com\"}," +
                 "        \"to\": [{ \"name\": \"BOB\", \"email\": \"someone@example.com@example.com\"}]," +
                 "        \"cc\": [{ \"name\": \"ALICE\"}]," +
                 "        \"subject\": \"Thank you for joining example.com!\"," +
@@ -984,7 +984,7 @@ public abstract class SetMessagesMethodTest {
                 "    \"setMessages\","+
                 "    {" +
                 "      \"create\": { \"" + messageCreationId  + "\" : {" +
-                "        \"from\": { \"name\": \"MAILER-DEAMON\", \"email\": \"postmaster@example.com\"}," +
+                "        \"from\": { \"name\": \"MAILER-DAEMON\", \"email\": \"postmaster@example.com\"}," +
                 "        \"to\": [{ \"name\": \"BOB\", \"email\": \"someone@example.com\"}]," +
                 "        \"cc\": [{ \"name\": \"ALICE\"}]," +
                 "        \"textBody\": \"Hello someone, and thank you for joining example.com!\"," +
@@ -1015,7 +1015,7 @@ public abstract class SetMessagesMethodTest {
     }
 
     @Test
-    public void setMessagesShouldPushMessageIntoRecipientUsersInbox() throws Exception {
+    public void setMessagesShouldDeliverMessageToRecipient() throws Exception {
         // Sender
         jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "sent");
         // Recipient
@@ -1056,10 +1056,10 @@ public abstract class SetMessagesMethodTest {
                 .post("/jmap");
 
         // Then
-        calmlyAwait.atMost(10, TimeUnit.SECONDS).until( () -> messageHaveBeenDeliveredToRecipientsInbox(recipientToken));
+        calmlyAwait.atMost(10, TimeUnit.SECONDS).until( () -> isAnyMessageFoundInRecipientsMailboxes(recipientToken));
     }
 
-    private boolean messageHaveBeenDeliveredToRecipientsInbox(AccessToken recipientToken) {
+    private boolean isAnyMessageFoundInRecipientsMailboxes(AccessToken recipientToken) {
         try {
             with()
                     .accept(ContentType.JSON)

http://git-wip-us.apache.org/repos/asf/james-project/blob/7d25d879/server/protocols/jmap/doc/specs/spec/message.mdwn
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/doc/specs/spec/message.mdwn b/server/protocols/jmap/doc/specs/spec/message.mdwn
index 727c874..2c65069 100644
--- a/server/protocols/jmap/doc/specs/spec/message.mdwn
+++ b/server/protocols/jmap/doc/specs/spec/message.mdwn
@@ -250,7 +250,6 @@ The *setMessages* method encompasses:
 - Creating a draft message
 <aside class="warning">Not implemented</aside>
 - Sending a message
-<aside class="warning">Not implemented</aside>
 - Changing the flags of a message (unread/flagged status)
 
 - Adding/removing a message to/from mailboxes (moving a message)


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