Repository: james-project Updated Branches: refs/heads/master 33d68a7d1 -> 618845610
JAMES-2187 JMAP integration: Integration testing for download with delegation mailbox Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/8bcabd71 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/8bcabd71 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/8bcabd71 Branch: refs/heads/master Commit: 8bcabd7129b6a59404b1423a11590e2bb8b02086 Parents: 841c45a Author: quynhn <[email protected]> Authored: Mon Oct 16 17:20:45 2017 +0700 Committer: Matthieu Baechler <[email protected]> Committed: Mon Oct 23 13:50:38 2017 +0200 ---------------------------------------------------------------------- .../integration/cucumber/DownloadStepdefs.java | 5 +++-- .../test/resources/cucumber/DownloadGet.feature | 21 +++++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/8bcabd71/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java index 48e0615..f3d0462 100644 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java @@ -105,9 +105,10 @@ public class DownloadStepdefs { public void appendMessageWithAttachmentToMailbox(String user, String mailbox, String messageId, String attachmentId) throws Throwable { MailboxPath mailboxPath = MailboxPath.forUser(user, mailbox); - mainStepdefs.mailboxProbe.appendMessage(user, mailboxPath, + ComposedMessageId composedMessageId = mainStepdefs.mailboxProbe.appendMessage(user, mailboxPath, ClassLoader.getSystemResourceAsStream("eml/oneAttachment.eml"), new Date(), false, new Flags()); - + + inputToMessageId.put(messageId, composedMessageId.getMessageId()); attachmentsByMessageId.put(messageId, attachmentId); blobIdByAttachmentId.put(attachmentId, ONE_ATTACHMENT_EML_ATTACHMENT_BLOB_ID); } http://git-wip-us.apache.org/repos/asf/james-project/blob/8bcabd71/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/DownloadGet.feature ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/DownloadGet.feature b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/DownloadGet.feature index 586a321..16d3271 100644 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/DownloadGet.feature +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/DownloadGet.feature @@ -25,6 +25,7 @@ Feature: Download GET Given a domain named "domain.tld" And a connected user "[email protected]" And "[email protected]" has a mailbox "INBOX" + And "[email protected]" has a mailbox "sharedMailbox" Scenario: Getting an attachment previously stored Given "[email protected]" mailbox "INBOX" contains a message "1" with an attachment "2" @@ -80,4 +81,22 @@ Feature: Download GET And a connected user "[email protected]" And "[email protected]" has a mailbox "INBOX" When "[email protected]" downloads "1" - Then the user should receive a not found response \ No newline at end of file + Then the user should receive a not found response + + Scenario: User can download attachment of another user when shared mailbox + Given "[email protected]" mailbox "sharedMailbox" contains a message "1" with an attachment "2" + And "[email protected]" shares its mailbox "sharedMailbox" with "[email protected]" + And a connected user "[email protected]" + And "[email protected]" has a mailbox "sharedMailbox" + When "[email protected]" downloads "2" + Then the user should receive that blob + And the blob size is 3071 + + Scenario: User can download message blob of another user when shared mailbox + Given "[email protected]" mailbox "sharedMailbox" contains a message "1" with an attachment "2" + And "[email protected]" shares its mailbox "sharedMailbox" with "[email protected]" + And a connected user "[email protected]" + And "[email protected]" has a mailbox "sharedMailbox" + When "[email protected]" downloads "1" + Then the user should receive that blob + And the blob size is 4963 \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
