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 bt...@apache.org on 2019/11/13 03:06:50 UTC
[james-project] 01/21: JAMES-2973 Add a test ensuring JMAP ability
to access to 'Outbox'
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 066d6f54b046c195b0496dedfc19b9099d8b0919
Author: Gautier DI FOLCO <gd...@linagora.com>
AuthorDate: Thu Nov 7 16:15:37 2019 +0100
JAMES-2973 Add a test ensuring JMAP ability to access to 'Outbox'
---
.../integration/GetMessageListMethodTest.java | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMessageListMethodTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMessageListMethodTest.java
index 53ea813..44a2624 100644
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMessageListMethodTest.java
+++ b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMessageListMethodTest.java
@@ -22,7 +22,9 @@ package org.apache.james.jmap.draft.methods.integration;
import static io.restassured.RestAssured.given;
import static io.restassured.RestAssured.with;
import static org.apache.james.jmap.HttpJmapAuthentication.authenticateJamesUser;
+import static org.apache.james.jmap.JmapCommonRequests.bodyOfMessage;
import static org.apache.james.jmap.JmapCommonRequests.getOutboxId;
+import static org.apache.james.jmap.JmapCommonRequests.listMessageIdsInMailbox;
import static org.apache.james.jmap.JmapURIBuilder.baseUri;
import static org.apache.james.jmap.TestingConstants.ALICE;
import static org.apache.james.jmap.TestingConstants.ALICE_PASSWORD;
@@ -66,7 +68,6 @@ import org.apache.james.jmap.draft.model.Number;
import org.apache.james.mailbox.DefaultMailboxes;
import org.apache.james.mailbox.FlagsBuilder;
import org.apache.james.mailbox.MessageManager;
-import org.apache.james.mailbox.exception.MailboxException;
import org.apache.james.mailbox.model.ComposedMessageId;
import org.apache.james.mailbox.model.MailboxACL.Rfc4314Rights;
import org.apache.james.mailbox.model.MailboxACL.Right;
@@ -2319,6 +2320,24 @@ public abstract class GetMessageListMethodTest {
.until(() -> twoMessagesFoundInMailbox(otherMailboxId));
}
+ @Test
+ public void aMessageInOutboxShouldBeAccessibleViaJmap() throws Exception {
+ MailboxId outboxMailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE, "Outbox");
+ String messageBody = "We're all mad here.";
+ mailboxProbe.appendMessage(
+ ALICE,
+ MailboxPath.forUser(ALICE, "Outbox"),
+ new ByteArrayInputStream(("Subject: test\r\n\r\n" + messageBody).getBytes(StandardCharsets.UTF_8)),
+ new Date(), false, new Flags());
+
+ calmlyAwait
+ .atMost(30, TimeUnit.SECONDS)
+ .until(() -> listMessageIdsInMailbox(aliceAccessToken, outboxMailboxId.serialize()).size() == 1);
+
+ assertThat(bodyOfMessage(aliceAccessToken, listMessageIdsInMailbox(aliceAccessToken, outboxMailboxId.serialize()).get(0)))
+ .isEqualTo(messageBody);
+ }
+
private boolean twoMessagesFoundInMailbox(MailboxId mailboxId) {
try {
with()
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org