JAMES-2249 reorganize delegation cucumber test
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/f48f0c22 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/f48f0c22 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/f48f0c22 Branch: refs/heads/master Commit: f48f0c22a0a38271aa41aabd5cd1e79b7034c1a2 Parents: 3cd6e50 Author: Luc DUZAN <ldu...@linagora.com> Authored: Fri Dec 8 19:01:02 2017 +0100 Committer: Antoine Duprat <adup...@linagora.com> Committed: Tue Dec 12 15:12:35 2017 +0100 ---------------------------------------------------------------------- .../CassandraGetMailboxesMethodTest.java | 45 --- ...wordsConsistencyOnDelegationMailboxTest.java | 44 --- ...arentMailboxWithAndWhithoutChildrenTest.java | 44 --- .../cucumber/CassandraSharingTest.java | 61 ++++ .../resources/cucumber/DownloadEndpoint.feature | 8 +- .../test/resources/cucumber/DownloadGet.feature | 27 -- .../resources/cucumber/DownloadPost.feature | 2 +- .../resources/cucumber/GetMailboxes.feature | 366 ------------------- .../test/resources/cucumber/GetMessages.feature | 26 -- ...ywordsConsistencyOnDelegationMailbox.feature | 141 ------- .../resources/cucumber/SetMailboxes.feature | 30 -- .../test/resources/cucumber/SetMessages.feature | 108 +----- ...gParentMailboxWithAndWithoutChildren.feature | 105 ------ .../cucumber/sharing/CopyAndSharing.feature | 55 +++ .../cucumber/sharing/DownloadAndSharing.feature | 42 +++ .../sharing/GetMessageAndSharing.feature | 48 +++ .../sharing/GetMessageListAndSharing.feature | 59 +++ ...ywordsConsistencyOnDelegationMailbox.feature | 140 +++++++ .../sharing/MailboxCreationAndSharing.feature | 36 ++ .../sharing/MailboxDeletionAndSharing.feature | 36 ++ .../sharing/MoveMailboxAndSharing.feature | 76 ++++ .../sharing/MoveMessageAndSharing.feature | 146 ++++++++ .../sharing/RenamingMailboxAndSharing.feature | 48 +++ .../cucumber/sharing/SetFlagAndSharing.feature | 61 ++++ .../sharing/SetMessagesOnSharedMailbox.feature | 107 ++++++ .../SharingChildrenWithoutSharingParent.feature | 42 +++ .../SharingMailboxWithOtherDomain.feature | 31 ++ ...gParentMailboxWithAndWithoutChildren.feature | 104 ++++++ .../cucumber/MemoryGetMailboxesMethodTest.java | 32 -- ...wordsConsistencyOnDelegationMailboxTest.java | 32 -- ...ParentMailboxWithAndWithoutChildrenTest.java | 32 -- .../jmap/memory/cucumber/MemorySharingTest.java | 47 +++ 32 files changed, 1154 insertions(+), 1027 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/f48f0c22/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraGetMailboxesMethodTest.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraGetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraGetMailboxesMethodTest.java deleted file mode 100644 index edf671b..0000000 --- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraGetMailboxesMethodTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one * - * or more contributor license agreements. See the NOTICE file * - * distributed with this work for additional information * - * regarding copyright ownership. The ASF licenses this file * - * to you under the Apache License, Version 2.0 (the * - * "License"); you may not use this file except in compliance * - * with the License. You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, * - * software distributed under the License is distributed on an * - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * - * KIND, either express or implied. See the License for the * - * specific language governing permissions and limitations * - * under the License. * - ****************************************************************/ - -package org.apache.james.jmap.cassandra.cucumber; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.runner.RunWith; - -import cucumber.api.CucumberOptions; -import cucumber.api.junit.Cucumber; - -@RunWith(Cucumber.class) -@CucumberOptions(features="classpath:cucumber/GetMailboxes.feature", - glue={"org.apache.james.jmap.methods.integration", "org.apache.james.jmap.cassandra.cucumber"}, - strict = true) -public class CassandraGetMailboxesMethodTest { - - @BeforeClass - public static void init() { - CucumberCassandraSingleton.cassandraServer.start(); - } - - @AfterClass - public static void after() { - CucumberCassandraSingleton.cassandraServer.stop(); - } - -} http://git-wip-us.apache.org/repos/asf/james-project/blob/f48f0c22/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraKeywordsConsistencyOnDelegationMailboxTest.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraKeywordsConsistencyOnDelegationMailboxTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraKeywordsConsistencyOnDelegationMailboxTest.java deleted file mode 100644 index 2e8688f..0000000 --- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraKeywordsConsistencyOnDelegationMailboxTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one * - * or more contributor license agreements. See the NOTICE file * - * distributed with this work for additional information * - * regarding copyright ownership. The ASF licenses this file * - * to you under the Apache License, Version 2.0 (the * - * "License"); you may not use this file except in compliance * - * with the License. You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, * - * software distributed under the License is distributed on an * - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * - * KIND, either express or implied. See the License for the * - * specific language governing permissions and limitations * - * under the License. * - ****************************************************************/ - -package org.apache.james.jmap.cassandra.cucumber; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.runner.RunWith; - -import cucumber.api.CucumberOptions; -import cucumber.api.junit.Cucumber; - -@RunWith(Cucumber.class) -@CucumberOptions(features="classpath:cucumber/KeywordsConsistencyOnDelegationMailbox.feature", - glue={"org.apache.james.jmap.methods.integration", "org.apache.james.jmap.cassandra.cucumber"}, - strict = true) -public class CassandraKeywordsConsistencyOnDelegationMailboxTest { - - @BeforeClass - public static void init() { - CucumberCassandraSingleton.cassandraServer.start(); - } - - @AfterClass - public static void after() { - CucumberCassandraSingleton.cassandraServer.stop(); - } -} http://git-wip-us.apache.org/repos/asf/james-project/blob/f48f0c22/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraSharingParentMailboxWithAndWhithoutChildrenTest.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraSharingParentMailboxWithAndWhithoutChildrenTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraSharingParentMailboxWithAndWhithoutChildrenTest.java deleted file mode 100644 index 67ba269..0000000 --- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraSharingParentMailboxWithAndWhithoutChildrenTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one * - * or more contributor license agreements. See the NOTICE file * - * distributed with this work for additional information * - * regarding copyright ownership. The ASF licenses this file * - * to you under the Apache License, Version 2.0 (the * - * "License"); you may not use this file except in compliance * - * with the License. You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, * - * software distributed under the License is distributed on an * - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * - * KIND, either express or implied. See the License for the * - * specific language governing permissions and limitations * - * under the License. * - ****************************************************************/ - -package org.apache.james.jmap.cassandra.cucumber; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.runner.RunWith; - -import cucumber.api.CucumberOptions; -import cucumber.api.junit.Cucumber; - -@RunWith(Cucumber.class) -@CucumberOptions(features="classpath:cucumber/SharingParentMailboxWithAndWithoutChildren.feature", - glue={"org.apache.james.jmap.methods.integration", "org.apache.james.jmap.cassandra.cucumber"}, - strict = true) -public class CassandraSharingParentMailboxWithAndWhithoutChildrenTest { - - @BeforeClass - public static void init() { - CucumberCassandraSingleton.cassandraServer.start(); - } - - @AfterClass - public static void after() { - CucumberCassandraSingleton.cassandraServer.stop(); - } -} http://git-wip-us.apache.org/repos/asf/james-project/blob/f48f0c22/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraSharingTest.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraSharingTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraSharingTest.java new file mode 100644 index 0000000..4cace81 --- /dev/null +++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraSharingTest.java @@ -0,0 +1,61 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.jmap.cassandra.cucumber; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.runner.RunWith; + +import cucumber.api.CucumberOptions; +import cucumber.api.junit.Cucumber; + +@RunWith(Cucumber.class) +@CucumberOptions(features= { + "classpath:cucumber/sharing/SharingParentMailboxWithAndWithoutChildren.feature", + "classpath:cucumber/sharing/SharingChildrenWithoutSharingParent.feature", + "classpath:cucumber/sharing/GetMessageAndSharing.feature", + "classpath:cucumber/sharing/SharingMailboxWithOtherDomain.feature", + "classpath:cucumber/sharing/MailboxCreationAndSharing.feature", + "classpath:cucumber/sharing/MailboxDeletionAndSharing.feature", + "classpath:cucumber/sharing/SetMessagesOnSharedMailbox.feature", + "classpath:cucumber/sharing/DownloadAndSharing.feature", + "classpath:cucumber/sharing/KeywordsConsistencyOnDelegationMailbox.feature", + "classpath:cucumber/sharing/GetMessageListAndSharing.feature", + "classpath:cucumber/sharing/MoveMessageAndSharing.feature", + "classpath:cucumber/sharing/MoveMailboxAndSharing.feature", + "classpath:cucumber/sharing/SetFlagAndSharing.feature", + "classpath:cucumber/sharing/RenamingMailboxAndSharing.feature", + "classpath:cucumber/sharing/CopyAndSharing.feature" }, + glue= { "org.apache.james.jmap.methods.integration", "org.apache.james.jmap.cassandra.cucumber" }, + tags = {"~@Ignore"}, + strict = true) +public class CassandraSharingTest { + + @BeforeClass + public static void init() { + CucumberCassandraSingleton.cassandraServer.start(); + } + + @AfterClass + public static void after() { + CucumberCassandraSingleton.cassandraServer.stop(); + } + +} http://git-wip-us.apache.org/repos/asf/james-project/blob/f48f0c22/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/DownloadEndpoint.feature ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/DownloadEndpoint.feature b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/DownloadEndpoint.feature index ea41c5d..3bb275a 100644 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/DownloadEndpoint.feature +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/DownloadEndpoint.feature @@ -23,7 +23,7 @@ Feature: Download endpoint Background: Given a domain named "domain.tld" - And some users "us...@domain.tld", "us...@domain.tld", "us...@domain.tld" + And some users "us...@domain.tld", "us...@domain.tld" And "us...@domain.tld" has a mailbox "INBOX" And "us...@domain.tld" mailbox "INBOX" contains a message "m1" with an attachment "a1" @@ -85,12 +85,6 @@ Feature: Download endpoint When "us...@domain.tld" downloads "a1" Then the user should receive a not found response - Scenario: An authenticated user should have access to a shared attachment - Given "us...@domain.tld" shares his mailbox "INBOX" with "us...@domain.tld" with "lr" rights - And "us...@domain.tld" is connected - When "us...@domain.tld" downloads "a1" - Then the user should be authorized - Scenario: A user should have access to an inlined attachment Given "us...@domain.tld" is connected And "us...@domain.tld" mailbox "INBOX" contains a message "m2" with an inlined attachment "ia1" http://git-wip-us.apache.org/repos/asf/james-project/blob/f48f0c22/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 f739d65..6b8155f 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 @@ -24,9 +24,7 @@ Feature: Download GET Given a domain named "domain.tld" And a user "al...@domain.tld" And a user "b...@domain.tld" - And a user "ced...@domain.tld" And "al...@domain.tld" has a mailbox "INBOX" - And "al...@domain.tld" has a mailbox "sharedMailbox" Scenario: Getting an attachment previously stored Given "al...@domain.tld" mailbox "INBOX" contains a message "1" with an attachment "2" @@ -80,28 +78,3 @@ Feature: Download GET When "b...@domain.tld" downloads "1" Then "b...@domain.tld" should receive a not found response - Scenario: User can download attachment of another user when shared mailbox - Given "al...@domain.tld" mailbox "sharedMailbox" contains a message "1" with an attachment "2" - And "al...@domain.tld" shares her mailbox "sharedMailbox" with "b...@domain.tld" with "lr" rights - When "b...@domain.tld" downloads "2" - Then he can read that blob - And the blob size is 3071 - - Scenario: User can download message blob of another user when shared mailbox - Given "al...@domain.tld" mailbox "sharedMailbox" contains a message "1" with an attachment "2" - And "al...@domain.tld" shares her mailbox "sharedMailbox" with "b...@domain.tld" with "lr" rights - When "b...@domain.tld" downloads "1" - Then he can read that blob - And the blob size is 4963 - - Scenario: Attachment read delegation should be user specific - Given "al...@domain.tld" mailbox "sharedMailbox" contains a message "1" with an attachment "2" - And "al...@domain.tld" shares her mailbox "sharedMailbox" with "b...@domain.tld" with "lr" rights - When "ced...@domain.tld" downloads "1" - Then "ced...@domain.tld" should receive a not found response - - Scenario: Message download read delegation should be user specific - Given "al...@domain.tld" mailbox "sharedMailbox" contains a message "1" with an attachment "2" - And "al...@domain.tld" shares her mailbox "sharedMailbox" with "b...@domain.tld" with "lr" rights - When "ced...@domain.tld" downloads "2" - Then "ced...@domain.tld" should receive a not found response \ No newline at end of file http://git-wip-us.apache.org/repos/asf/james-project/blob/f48f0c22/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/DownloadPost.feature ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/DownloadPost.feature b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/DownloadPost.feature index 571af47..6621c11 100644 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/DownloadPost.feature +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/DownloadPost.feature @@ -19,7 +19,7 @@ Feature: Alternative authentication mechanism for getting attachment via a POST request returning a specific authentication token As a James user - I want to retrieve my attachments without an alternative authentication mechanim + I want to retrieve my attachments without an alternative authentication mechanism Background: Given a domain named "domain.tld" http://git-wip-us.apache.org/repos/asf/james-project/blob/f48f0c22/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/GetMailboxes.feature ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/GetMailboxes.feature b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/GetMailboxes.feature deleted file mode 100644 index 36ff9b4..0000000 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/GetMailboxes.feature +++ /dev/null @@ -1,366 +0,0 @@ -#*************************************************************** -# Licensed to the Apache Software Foundation (ASF) under one * -# or more contributor license agreements. See the NOTICE file * -# distributed with this work for additional information * -# regarding copyright ownership. The ASF licenses this file * -# to you under the Apache License, Version 2.0 (the * -# "License"); you may not use this file except in compliance * -# with the License. You may obtain a copy of the License at * -# * -# http://www.apache.org/licenses/LICENSE-2.0 * -# * -# Unless required by applicable law or agreed to in writing, * -# software distributed under the License is distributed on an * -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * -# KIND, either express or implied. See the License for the * -# specific language governing permissions and limitations * -# under the License. * -# **************************************************************/ -Feature: GetMailboxes method - As a James user - I want to be able to retrieve my mailboxes - - Background: - Given a domain named "domain.tld" - And a user "al...@domain.tld" - And a user "b...@domain.tld" - And "al...@domain.tld" has a mailbox "INBOX" - And "b...@domain.tld" has a mailbox "bobMailbox" - And "al...@domain.tld" has a mailbox "shared" - And "al...@domain.tld" shares her mailbox "shared" with "b...@domain.tld" with "aeilrwt" rights - - Scenario: Sharer can read the total and unread counts on a shared folder - Given "al...@domain.tld" has a message "m1" in "shared" mailbox - And "al...@domain.tld" has a message "m2" in "shared" mailbox with subject "my test subject 2", content "testmail 2" - When "al...@domain.tld" lists mailboxes - Then the mailbox "shared" has 2 messages - And the mailbox "shared" has 2 unseen messages - - Scenario: Sharee can read the total and unread counts on a shared folder - Given "al...@domain.tld" has a message "m1" in "shared" mailbox - And "al...@domain.tld" has a message "m2" in "shared" mailbox with subject "my test subject 2", content "testmail 2" - When "b...@domain.tld" lists mailboxes - Then the mailbox "shared" has 2 messages - And the mailbox "shared" has 2 unseen messages - - Scenario: Copy message should update the total and the unread counts when asked by sharer - Given "al...@domain.tld" has a message "m1" in "INBOX" mailbox - And "al...@domain.tld" copies "m1" from mailbox "INBOX" to mailbox "shared" - When "al...@domain.tld" lists mailboxes - Then the mailbox "shared" has 1 message - And the mailbox "shared" has 1 unseen message - - Scenario: Copy message should update the total and the unread counts when asked by sharer / sharee view - Given "al...@domain.tld" has a message "m1" in "INBOX" mailbox - And "al...@domain.tld" copies "m1" from mailbox "INBOX" to mailbox "shared" - When "b...@domain.tld" lists mailboxes - Then the mailbox "shared" has 1 message - And the mailbox "shared" has 1 unseen message - - Scenario: Copy message should update the total and the unread counts when asked by sharee - Given "b...@domain.tld" has a message "m1" in "bobMailbox" mailbox - And "b...@domain.tld" copies "m1" from mailbox "bobMailbox" of user "b...@domain.tld" to mailbox "shared" of user "al...@domain.tld" - When "al...@domain.tld" lists mailboxes - Then the mailbox "shared" has 1 message - And the mailbox "shared" has 1 unseen message - - Scenario: Copy message should update the total and the unread counts when asked by sharee / sharee view - Given "b...@domain.tld" has a message "m1" in "bobMailbox" mailbox - And "b...@domain.tld" copies "m1" from mailbox "bobMailbox" of user "b...@domain.tld" to mailbox "shared" of user "al...@domain.tld" - When "b...@domain.tld" lists mailboxes - Then the mailbox "shared" has 1 message - And the mailbox "shared" has 1 unseen message - - Scenario: Move message should update the total and the unread counts when asked by sharer - Given "al...@domain.tld" has a message "m1" in "INBOX" mailbox - And "al...@domain.tld" moves "m1" to mailbox "shared" of user "al...@domain.tld" - When "al...@domain.tld" lists mailboxes - Then the mailbox "shared" has 1 message - And the mailbox "shared" has 1 unseen message - - Scenario: Move message should update the total and the unread counts of origin mailbox when asked by sharer - Given "al...@domain.tld" has a message "m1" in "INBOX" mailbox - And "al...@domain.tld" moves "m1" to mailbox "shared" of user "al...@domain.tld" - When "al...@domain.tld" lists mailboxes - Then the mailbox "INBOX" has 0 messages - And the mailbox "INBOX" has 0 unseen messages - - Scenario: Move message should update the total and the unread counts when asked by sharer / sharee view - Given "al...@domain.tld" has a message "m1" in "INBOX" mailbox - And "al...@domain.tld" moves "m1" to mailbox "shared" of user "al...@domain.tld" - When "b...@domain.tld" lists mailboxes - Then the mailbox "shared" has 1 message - And the mailbox "shared" has 1 unseen message - - Scenario: Move message should update the total and the unread counts of origin mailbox when asked by sharer / sharee view - Given "al...@domain.tld" has a mailbox "sharedBis" - And "al...@domain.tld" has a message "m1" in "sharedBis" mailbox - And "al...@domain.tld" shares her mailbox "sharedBis" with "b...@domain.tld" with "aeilrwt" rights - And "al...@domain.tld" moves "m1" to mailbox "shared" of user "al...@domain.tld" - When "b...@domain.tld" lists mailboxes - Then the mailbox "sharedBis" has 0 messages - And the mailbox "sharedBis" has 0 unseen messages - - Scenario: Move message should update the total and the unread counts when asked by sharee - Given "b...@domain.tld" has a message "m1" in "bobMailbox" mailbox - And "b...@domain.tld" moves "m1" to mailbox "shared" of user "al...@domain.tld" - When "al...@domain.tld" lists mailboxes - Then the mailbox "shared" has 1 message - And the mailbox "shared" has 1 unseen message - - Scenario: Move message should update the total and the unread counts of origin mailbox when asked by sharee - Given "b...@domain.tld" has a mailbox "sharedBis" - And "b...@domain.tld" has a message "m1" in "sharedBis" mailbox - And "b...@domain.tld" shares her mailbox "sharedBis" with "al...@domain.tld" with "aeilrwt" rights - And "b...@domain.tld" moves "m1" to mailbox "shared" of user "al...@domain.tld" - When "al...@domain.tld" lists mailboxes - Then the mailbox "sharedBis" has 0 messages - And the mailbox "sharedBis" has 0 unseen messages - - Scenario: Move message should update the total and the unread counts when asked by sharee / sharee view - Given "b...@domain.tld" has a message "m1" in "bobMailbox" mailbox - And "b...@domain.tld" moves "m1" to mailbox "shared" of user "al...@domain.tld" - When "b...@domain.tld" lists mailboxes - Then the mailbox "shared" has 1 message - And the mailbox "shared" has 1 unseen message - - Scenario: Move message should update the total and the unread counts of origin mailbox when asked by sharee / sharee view - Given "b...@domain.tld" has a message "m1" in "bobMailbox" mailbox - And "b...@domain.tld" moves "m1" to mailbox "shared" of user "al...@domain.tld" - When "b...@domain.tld" lists mailboxes - Then the mailbox "bobMailbox" has 0 messages - And the mailbox "bobMailbox" has 0 unseen messages - - Scenario: Moving a message to a delegated mailbox without rights should not change the total and the unread counts - Given "al...@domain.tld" has a mailbox "shared2" - And "al...@domain.tld" shares her mailbox "shared2" with "b...@domain.tld" with "lr" rights - And "b...@domain.tld" has a message "m1" in "bobMailbox" mailbox - And "b...@domain.tld" moves "m1" to mailbox "shared2" of user "al...@domain.tld" - When "al...@domain.tld" lists mailboxes - Then the mailbox "shared" has 0 messages - And the mailbox "shared" has 0 unseen messages - - Scenario: Moving a message to a delegated mailbox without rights should not change the total and the unread counts / sharee view - Given "al...@domain.tld" has a mailbox "shared2" - And "al...@domain.tld" shares her mailbox "shared2" with "b...@domain.tld" with "lr" rights - And "b...@domain.tld" has a message "m1" in "bobMailbox" mailbox - And "b...@domain.tld" moves "m1" to mailbox "shared2" of user "al...@domain.tld" - When "b...@domain.tld" lists mailboxes - Then the mailbox "shared" has 0 messages - And the mailbox "shared" has 0 unseen messages - - Scenario: Move message should update the total and the unread counts when asked by sharee and seen message - Given "b...@domain.tld" has a message "m1" in the "bobMailbox" mailbox with flags "$Seen" - And "b...@domain.tld" moves "m1" to mailbox "shared" of user "al...@domain.tld" - When "al...@domain.tld" lists mailboxes - Then the mailbox "shared" has 1 message - And the mailbox "shared" has 0 unseen message - - Scenario: Move message should update the total and the unread counts when asked by sharee / sharee view and seen message - Given "b...@domain.tld" has a message "m1" in the "bobMailbox" mailbox with flags "$Seen" - And "b...@domain.tld" moves "m1" to mailbox "shared" of user "al...@domain.tld" - When "b...@domain.tld" lists mailboxes - Then the mailbox "shared" has 1 message - And the mailbox "shared" has 0 unseen message - - Scenario: Move message should update the total and the unread counts of origin mailbox when asked by sharer and seen message - Given "al...@domain.tld" has a message "m1" in the "INBOX" mailbox with flags "$Seen" - And "al...@domain.tld" moves "m1" to mailbox "shared" of user "al...@domain.tld" - When "al...@domain.tld" lists mailboxes - Then the mailbox "INBOX" has 0 messages - And the mailbox "INBOX" has 0 unseen messages - - Scenario: Moving a message to a delegated mailbox without rights should not change the total and the unread counts - Given "al...@domain.tld" has a mailbox "shared2" - And "al...@domain.tld" shares her mailbox "shared2" with "b...@domain.tld" with "lri" rights - And "b...@domain.tld" has a message "m1" in the "bobMailbox" mailbox with flags "$Seen" - And "b...@domain.tld" moves "m1" to mailbox "shared2" of user "al...@domain.tld" - When "al...@domain.tld" lists mailboxes - Then the mailbox "shared" has 0 messages - And the mailbox "shared" has 0 unseen messages - - Scenario: Moving a message to a delegated mailbox without rights should not change the total and the unread counts / sharee view - Given "al...@domain.tld" has a mailbox "shared2" - And "al...@domain.tld" shares her mailbox "shared2" with "b...@domain.tld" with "lri" rights - And "b...@domain.tld" has a message "m1" in the "bobMailbox" mailbox with flags "$Seen" - And "b...@domain.tld" moves "m1" to mailbox "shared2" of user "al...@domain.tld" - When "b...@domain.tld" lists mailboxes - Then the mailbox "shared" has 0 messages - And the mailbox "shared" has 0 unseen messages - - Scenario: Set flags by sharer should update unseen count when read by sharer - Given "al...@domain.tld" has a message "m1" in "shared" mailbox - When "al...@domain.tld" sets flags "$Seen" on message "m1" - When "al...@domain.tld" lists mailboxes - Then the mailbox "shared" has 1 message - And the mailbox "shared" has 0 unseen messages - - Scenario: Set flags by sharer should update unseen count when read by sharee - Given "al...@domain.tld" has a message "m1" in "shared" mailbox - When "al...@domain.tld" sets flags "$Seen" on message "m1" - When "b...@domain.tld" lists mailboxes - Then the mailbox "shared" has 1 message - And the mailbox "shared" has 0 unseen messages - - Scenario: Set flags by sharee should update unseen count when read by sharer - Given "al...@domain.tld" has a message "m1" in "shared" mailbox - When "b...@domain.tld" sets flags "$Seen" on message "m1" - When "al...@domain.tld" lists mailboxes - Then the mailbox "shared" has 1 message - And the mailbox "shared" has 0 unseen messages - - Scenario: Set flags by sharee should update unseen count when read by sharee - Given "al...@domain.tld" has a message "m1" in "shared" mailbox - When "b...@domain.tld" sets flags "$Seen" on message "m1" - When "b...@domain.tld" lists mailboxes - Then the mailbox "shared" has 1 message - And the mailbox "shared" has 0 unseen messages - - Scenario: Set flags by sharee should not update unseen count when no rights and read by sharer - Given "al...@domain.tld" has a mailbox "shared2" - And "al...@domain.tld" shares her mailbox "shared2" with "b...@domain.tld" with "lri" rights - And "al...@domain.tld" has a message "m1" in "shared2" mailbox - When "b...@domain.tld" sets flags "$Seen" on message "m1" - When "al...@domain.tld" lists mailboxes - Then the mailbox "shared2" has 1 message - And the mailbox "shared2" has 1 unseen message - - Scenario: As sharee read a message it should not update unseen count when no rights and read by sharee - Given "al...@domain.tld" has a mailbox "shared2" - And "al...@domain.tld" shares her mailbox "shared2" with "b...@domain.tld" with "lri" rights - And "al...@domain.tld" has a message "m1" in "shared2" mailbox - When "b...@domain.tld" sets flags "$Seen" on message "m1" - When "b...@domain.tld" lists mailboxes - Then the mailbox "shared2" has 1 message - And the mailbox "shared2" has 1 unseen message - - Scenario: Lookup right should not be enough to read message and unseen counts - Given "al...@domain.tld" has a mailbox "shared2" - And "al...@domain.tld" shares her mailbox "shared2" with "b...@domain.tld" with "l" rights - And "al...@domain.tld" has a message "m1" in "shared2" mailbox - When "b...@domain.tld" lists mailboxes - Then the mailbox "shared2" has 0 messages - And the mailbox "shared2" has 0 unseen messages - - Scenario: User can share sub-mailbox without sharing its parent - Given "al...@domain.tld" has a mailbox "mailbox1" - And "al...@domain.tld" has a mailbox "mailbox1.shared" - And "al...@domain.tld" shares her mailbox "mailbox1.shared" with "b...@domain.tld" with "aeirwt" rights - When "b...@domain.tld" lists mailboxes - Then the mailboxes should contain "shared" in "Delegated" namespace - And the mailboxes should not contain "mailbox1" - - Scenario: User can share sub-mailbox without sharing its parent and then sharee can see the parent mailbox - Given "al...@domain.tld" has a mailbox "mailbox1" - And "al...@domain.tld" has a mailbox "mailbox1.shared" - And "al...@domain.tld" shares her mailbox "mailbox1.shared" with "b...@domain.tld" with "l" rights - When "b...@domain.tld" lists mailboxes - Then the mailboxes should contain "shared" in "Delegated" namespace - And the mailboxes should contain "mailbox1" in "Delegated" namespace - - Scenario: A sharee should be able to access a shared mailbox after it has been renamed by the owner - Given "al...@domain.tld" renames her mailbox "shared" to "mySharedMailbox" - When "b...@domain.tld" lists mailboxes - Then the mailboxes should contain "mySharedMailbox" in "Delegated" namespace - - Scenario: A sharee should not be able to rename a shared mailbox - Given "b...@domain.tld" renames the mailbox, owned by "al...@domain.tld", "shared" to "mySharedMailbox" - When "al...@domain.tld" lists mailboxes - Then the mailboxes should contain "shared" in "Personal" namespace - - Scenario: A user should not be able to rename an other user mailbox - Given "al...@domain.tld" has a mailbox "mySecrets" - And "b...@domain.tld" renames the mailbox, owned by "al...@domain.tld", "mySecrets" to "revealMySecrets" - When "al...@domain.tld" lists mailboxes - Then the mailboxes should contain "mySecrets" in "Personal" namespace - - Scenario: A sharee should receive a not updated response when trying to rename a shared mailbox - Given "b...@domain.tld" renames the mailbox, owned by "al...@domain.tld", "shared" to "mySharedMailbox" - Then mailbox "shared" owned by "al...@domain.tld" is not updated - - Scenario: A sharee should receive a not destroyed response when trying to destroy a shared mailbox - Given "b...@domain.tld" deletes the mailbox "shared" owned by "al...@domain.tld" - Then mailbox "shared" owned by "al...@domain.tld" is not destroyed - - Scenario: A sharee should not be able to delete a shared mailbox - Given "b...@domain.tld" deletes the mailbox "shared" owned by "al...@domain.tld" - When "al...@domain.tld" lists mailboxes - Then the mailboxes should contain "shared" in "Personal" namespace - - Scenario: A sharee should not be able to create a shared mailbox child - Given "b...@domain.tld" creates mailbox "sharedChild" with creationId "c-01" in mailbox "shared" owned by "al...@domain.tld" - When "al...@domain.tld" lists mailboxes - Then the mailboxes should contain "shared" in "Personal" namespace - - Scenario: A sharee should receive a not created response when trying to create a shared mailbox child - When "b...@domain.tld" creates mailbox "sharedChild" with creationId "c-01" in mailbox "shared" owned by "al...@domain.tld" - Then mailbox with creationId "c-01" is not created - - Scenario: A sharee moving a delegated mailbox as top level should be rejected - Given "al...@domain.tld" has a mailbox "shared.sharedChild" - And "al...@domain.tld" shares her mailbox "shared.sharedChild" with "b...@domain.tld" with "aeilrwt" rights - When "b...@domain.tld" moves the mailbox "shared.sharedChild" owned by "al...@domain.tld" as top level mailbox - Then mailbox "shared.sharedChild" owned by "al...@domain.tld" is not updated - - Scenario: A sharee moving a delegated mailbox as top level should not move mailbox - Given "al...@domain.tld" has a mailbox "shared.sharedChild" - And "al...@domain.tld" shares her mailbox "shared.sharedChild" with "b...@domain.tld" with "aeilrwt" rights - When "b...@domain.tld" moves the mailbox "shared.sharedChild" owned by "al...@domain.tld" as top level mailbox - Then "al...@domain.tld" lists mailboxes - And the mailboxes should contain "sharedChild" in "Personal" namespace, with parent mailbox "shared" of user "al...@domain.tld" - - Scenario: A sharee moving a delegated mailbox into sharer mailboxes should be rejected - Given "al...@domain.tld" has a mailbox "shared.sharedChild" - And "al...@domain.tld" has a mailbox "otherShared" - And "al...@domain.tld" shares her mailbox "shared.sharedChild" with "b...@domain.tld" with "aeilrwt" rights - And "al...@domain.tld" shares her mailbox "otherShared" with "b...@domain.tld" with "aeilrwt" rights - When "b...@domain.tld" moves the mailbox "shared.sharedChild" owned by "al...@domain.tld", into mailbox "otherShared" owned by "al...@domain.tld" - Then mailbox "shared.sharedChild" owned by "al...@domain.tld" is not updated - - Scenario: A sharee moving a delegated mailbox into another delegated mailbox should not move mailbox - Given "al...@domain.tld" has a mailbox "shared.sharedChild" - And "al...@domain.tld" has a mailbox "otherShared" - And "al...@domain.tld" shares her mailbox "shared.sharedChild" with "b...@domain.tld" with "aeilrwt" rights - And "al...@domain.tld" shares her mailbox "otherShared" with "b...@domain.tld" with "aeilrwt" rights - When "b...@domain.tld" moves the mailbox "shared.sharedChild" owned by "al...@domain.tld", into mailbox "otherShared" owned by "al...@domain.tld" - Then "al...@domain.tld" lists mailboxes - And the mailboxes should contain "sharedChild" in "Personal" namespace, with parent mailbox "shared" of user "al...@domain.tld" - - Scenario: A sharee moving a delegated mailbox to his mailboxes should be rejected - Given "al...@domain.tld" has a mailbox "shared.sharedChild" - And "b...@domain.tld" has a mailbox "other" - And "al...@domain.tld" shares her mailbox "shared.sharedChild" with "b...@domain.tld" with "aeilrwt" rights - When "b...@domain.tld" moves the mailbox "shared.sharedChild" owned by "al...@domain.tld", into mailbox "other" owned by "b...@domain.tld" - Then mailbox "shared.sharedChild" owned by "al...@domain.tld" is not updated - - Scenario: A sharee moving a delegated mailbox into his mailbox should not move mailbox - Given "al...@domain.tld" has a mailbox "shared.sharedChild" - And "b...@domain.tld" has a mailbox "other" - And "al...@domain.tld" shares her mailbox "shared.sharedChild" with "b...@domain.tld" with "aeilrwt" rights - When "b...@domain.tld" moves the mailbox "shared.sharedChild" owned by "al...@domain.tld", into mailbox "other" owned by "b...@domain.tld" - Then "al...@domain.tld" lists mailboxes - And the mailboxes should contain "sharedChild" in "Personal" namespace, with parent mailbox "shared" of user "al...@domain.tld" - - Scenario: A sharee should be able to retrieve a mailbox after sharer moved it as a top level mailbox - Given "al...@domain.tld" has a mailbox "shared.sharedChild" - And "al...@domain.tld" shares her mailbox "shared.sharedChild" with "b...@domain.tld" with "aeilrwt" rights - When "al...@domain.tld" moves the mailbox "shared.sharedChild" owned by "al...@domain.tld" as top level mailbox - Then "b...@domain.tld" lists mailboxes - And the mailboxes should contain "sharedChild" in "Delegated" namespace, with no parent mailbox - - Scenario: A sharee should be able to retrieve a mailbox after sharer moved it into another mailbox - Given "al...@domain.tld" has a mailbox "shared.sharedChild" - And "al...@domain.tld" has a mailbox "other" - And "al...@domain.tld" shares her mailbox "shared.sharedChild" with "b...@domain.tld" with "aeilrwt" rights - When "al...@domain.tld" moves the mailbox "shared.sharedChild" owned by "al...@domain.tld", into mailbox "other" owned by "al...@domain.tld" - Then "b...@domain.tld" lists mailboxes - And the mailboxes should contain "sharedChild" in "Delegated" namespace, with parent mailbox "other" of user "al...@domain.tld" - - Scenario: A sharer can not move its mailboxes to someone else delegated mailboxes - Given "al...@domain.tld" has a mailbox "shared.sharedChild" - And "b...@domain.tld" has a mailbox "other" - And "al...@domain.tld" shares her mailbox "shared.sharedChild" with "b...@domain.tld" with "aeilrwt" rights - And "b...@domain.tld" shares her mailbox "other" with "al...@domain.tld" with "aeilrwt" rights - When "al...@domain.tld" moves the mailbox "shared.sharedChild" owned by "al...@domain.tld", into mailbox "other" owned by "b...@domain.tld" - Then mailbox "shared.sharedChild" owned by "al...@domain.tld" is not updated - http://git-wip-us.apache.org/repos/asf/james-project/blob/f48f0c22/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/GetMessages.feature ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/GetMessages.feature b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/GetMessages.feature index e2f1e73..11dde7a 100644 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/GetMessages.feature +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/GetMessages.feature @@ -23,8 +23,6 @@ Feature: GetMessages method Background: Given a domain named "domain.tld" And a user "al...@domain.tld" - And a user "b...@domain.tld" - And a user "ced...@domain.tld" And "al...@domain.tld" has a mailbox "INBOX" Scenario: Retrieving a message in several mailboxes should return a single message in these mailboxes @@ -36,30 +34,6 @@ Feature: GetMessages method And the id of the message is "m1" And the message is in "custom,INBOX" mailboxes - Scenario: Retrieving a message in a mailbox delegated to me - Given "al...@domain.tld" has a mailbox "shared" - And "al...@domain.tld" shares her mailbox "shared" with "b...@domain.tld" with "lr" rights - And "al...@domain.tld" has a message "m1" in "shared" mailbox with subject "my test subject", content "testmail" - When "b...@domain.tld" ask for messages "m1" - Then no error is returned - And the list should contain 1 message - And the id of the message is "m1" - - Scenario: Retrieving a message in a mailbox delegated to someone else - Given "al...@domain.tld" has a mailbox "shared" - And "al...@domain.tld" shares her mailbox "shared" with "b...@domain.tld" with "lr" rights - And "al...@domain.tld" has a message "m1" in "shared" mailbox with subject "my test subject", content "testmail" - When "ced...@domain.tld" ask for messages "m1" - Then no error is returned - And the list of messages is empty - - Scenario: Retrieving a message in a mailbox not delegated to me - Given "al...@domain.tld" has a mailbox "notShared" - And "al...@domain.tld" has a message "m1" in "notShared" mailbox with subject "my test subject", content "testmail" - When "b...@domain.tld" ask for messages "m1" - Then no error is returned - And the list should contain 0 message - Scenario: Retrieving messages with a non null accountId should return a NotSupported error When "al...@domain.tld" ask for messages using its accountId Then an error "Not yet implemented" is returned http://git-wip-us.apache.org/repos/asf/james-project/blob/f48f0c22/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/KeywordsConsistencyOnDelegationMailbox.feature ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/KeywordsConsistencyOnDelegationMailbox.feature b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/KeywordsConsistencyOnDelegationMailbox.feature deleted file mode 100644 index de01c1c..0000000 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/KeywordsConsistencyOnDelegationMailbox.feature +++ /dev/null @@ -1,141 +0,0 @@ -#*************************************************************** -# Licensed to the Apache Software Foundation (ASF) under one * -# or more contributor license agreements. See the NOTICE file * -# distributed with this work for additional information * -# regarding copyright ownership. The ASF licenses this file * -# to you under the Apache License, Version 2.0 (the * -# "License"); you may not use this file except in compliance * -# with the License. You may obtain a copy of the License at * -# * -# http://www.apache.org/licenses/LICENSE-2.0 * -# * -# Unless required by applicable law or agreed to in writing, * -# software distributed under the License is distributed on an * -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * -# KIND, either express or implied. See the License for the * -# specific language governing permissions and limitations * -# under the License. * -# **************************************************************/ -Feature: Keywords consistency on delegation mailbox - - Background: - Given a domain named "domain.tld" - And a user "al...@domain.tld" - And a user "b...@domain.tld" - And "al...@domain.tld" has a mailbox "notShared" - And "al...@domain.tld" has a mailbox "shared" - And "al...@domain.tld" shares its mailbox "shared" with rights "lrw" with "b...@domain.tld" - And "al...@domain.tld" has a message "m1" in "notShared" mailbox with subject "My awesome subject", content "This is the content" - And "al...@domain.tld" copies "m1" from mailbox "notShared" to mailbox "shared" - - Scenario: getMessageList filtered by flag should combine flag when delegation mailbox - Given "b...@domain.tld" sets flags "$Flagged" on message "m1" - When "al...@domain.tld" asks for message list in mailboxes "shared,notShared" with flag "$Flagged" - Then the message list contains "m1" - - Scenario: getMessageList filtered by flag should keep flag on non-shared mailbox - Given "b...@domain.tld" sets flags "$Flagged" on message "m1" - When "al...@domain.tld" asks for message list in mailboxes "notShared" with flag "$Flagged" - Then the message list is empty - - Scenario: getMessageList filtered by flag should keep flag on delegation mailbox - Given "b...@domain.tld" sets flags "$Flagged" on message "m1" - When "al...@domain.tld" asks for message list in mailboxes "shared" with flag "$Flagged" - Then the message list contains "m1" - - Scenario: Get message list should select Draft flag on all mailbox - Given message "m1" has flags $Draft in mailbox "shared" of user "al...@domain.tld" - When "al...@domain.tld" asks for message list in mailboxes "shared,notShared" with flag "$Draft" - Then the message list contains "m1" - - Scenario: Get message list should keep flags on non-shared mailbox - Given message "m1" has flags $Draft in mailbox "shared" of user "al...@domain.tld" - When "al...@domain.tld" asks for message list in mailbox "notShared" with flag "$Draft" - Then the message list is empty - - Scenario: Get message list should keep flags on shared mailbox - Given message "m1" has flags $Draft in mailbox "shared" of user "al...@domain.tld" - When "al...@domain.tld" asks for message list in mailbox "shared" with flag "$Draft" - Then the message list contains "m1" - - Scenario: getMessage with shared user should return message with combine flag when delegation mailbox - Given message "m1" has flags $Flagged in mailbox "shared" of user "al...@domain.tld" - When "b...@domain.tld" ask for messages "m1" - Then no error is returned - And the keywords of the message is $Flagged - - Scenario: getMessage of owner mailbox should return message with combine flag when delegation mailbox - Given message "m1" has flags $Flagged in mailbox "shared" of user "al...@domain.tld" - When "al...@domain.tld" ask for messages "m1" - Then no error is returned - And the keywords of the message is $Flagged - - Scenario: message should update message status based on delegation mailbox - Given "al...@domain.tld" sets flags "$Flagged,$Seen" on message "m1" - And "b...@domain.tld" sets flags "$Seen" on message "m1" - When "al...@domain.tld" ask for messages "m1" - Then no error is returned - And the message has IMAP flag "\Flagged \Seen" in mailbox "notShared" for "al...@domain.tld" - And the message has IMAP flag "\Seen" in mailbox "shared" for "al...@domain.tld" - - Scenario: message should keep origin message status when cut the sharing - Given "b...@domain.tld" sets flags "$Flagged" on message "m1" - And "al...@domain.tld" shares its mailbox "shared" with rights "" with "b...@domain.tld" - When "al...@domain.tld" ask for messages "m1" - Then no error is returned - And the message has IMAP flag "\Flagged" in mailbox "shared" for "al...@domain.tld" - And the message has IMAP flag "" in mailbox "notShared" for "al...@domain.tld" - - Scenario: getMessage should keep origin message status when delegation mailbox - Given message "m1" has flags $Flagged in mailbox "notShared" of user "al...@domain.tld" - And message "m1" has flags $Seen in mailbox "shared" of user "al...@domain.tld" - And "al...@domain.tld" shares its mailbox "shared" with rights "" with "b...@domain.tld" - When "al...@domain.tld" ask for messages "m1" - Then no error is returned - And the keywords of the message is $Flagged,$Seen - - Scenario: getMessage on mailbox should keep its flag as it is when owner - Given "al...@domain.tld" sets flags "$Flagged" on message "m1" - When "al...@domain.tld" ask for messages "m1" - Then no error is returned - And the message has IMAP flag "\Flagged" in mailbox "shared" for "al...@domain.tld" - And the message has IMAP flag "\Flagged" in mailbox "notShared" for "al...@domain.tld" - - Scenario: messages should keep Draft flag as it is when onwer - Given message "m1" has flags $Draft in mailbox "shared" of user "al...@domain.tld" - When "b...@domain.tld" ask for messages "m1" - Then no error is returned - And the keywords of the message is $Draft - - Scenario: message should intersect flag when Draft - Given message "m1" has flags $Draft in mailbox "shared" of user "al...@domain.tld" - When "al...@domain.tld" ask for messages "m1" - Then no error is returned - And the message has no keyword - - Scenario: message should intersect flag when Draft after cut sharing - Given message "m1" has flags $Draft in mailbox "shared" of user "al...@domain.tld" - And "al...@domain.tld" shares its mailbox "shared" with rights "" with "b...@domain.tld" - When "al...@domain.tld" ask for messages "m1" - Then no error is returned - And the message has no keyword - - Scenario: message should combine flag if not Draft - Given the user has an open IMAP connection with mailbox "shared" selected - And the user set flags via IMAP to "\FLAGGED" for all messages in mailbox "shared" - When "al...@domain.tld" ask for messages "m1" - Then no error is returned - And the keywords of the message is $Flagged - - Scenario: message should combine flag if not Draft on all mailboxes - Given "al...@domain.tld" sets flags "$Flagged" on message "m1" - When "al...@domain.tld" ask for messages "m1" - Then no error is returned - And the keywords of the message is $Flagged - - Scenario: message should intersect Draft flag with onwer mailbox - Given the user has an open IMAP connection with mailbox "shared" selected - And the user set flags via IMAP to "\DRAFT" for all messages in mailbox "shared" - When "al...@domain.tld" ask for messages "m1" - Then no error is returned - And the message has no keyword http://git-wip-us.apache.org/repos/asf/james-project/blob/f48f0c22/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/SetMailboxes.feature ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/SetMailboxes.feature b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/SetMailboxes.feature deleted file mode 100644 index 57a7512..0000000 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/SetMailboxes.feature +++ /dev/null @@ -1,30 +0,0 @@ -#*************************************************************** -# Licensed to the Apache Software Foundation (ASF) under one * -# or more contributor license agreements. See the NOTICE file * -# distributed with this work for additional information * -# regarding copyright ownership. The ASF licenses this file * -# to you under the Apache License, Version 2.0 (the * -# "License"); you may not use this file except in compliance * -# with the License. You may obtain a copy of the License at * -# * -# http://www.apache.org/licenses/LICENSE-2.0 * -# * -# Unless required by applicable law or agreed to in writing, * -# software distributed under the License is distributed on an * -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * -# KIND, either express or implied. See the License for the * -# specific language governing permissions and limitations * -# under the License. * -# **************************************************************/ -Feature: SetMailboxes method - - Background: - Given a domain named "domain.tld" - And a user "al...@domain.tld" - And "al...@domain.tld" has a mailbox "shared" - - Scenario: setMailboxes should reject sharing a mailbox to another domain - Given a domain named "otherdomain.tld" - And a user "b...@otherdomain.tld" - When "al...@domain.tld" shares its mailbox "shared" with rights "lrw" with "b...@otherdomain.tld" - Then "al...@domain.tld" receives not updated on mailbox "shared" with kind "invalidArguments" and message "Cannot share a mailbox to another domain" http://git-wip-us.apache.org/repos/asf/james-project/blob/f48f0c22/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/SetMessages.feature ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/SetMessages.feature b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/SetMessages.feature index b3447fb..ffe6eec 100644 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/SetMessages.feature +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/SetMessages.feature @@ -13,99 +13,24 @@ # software distributed under the License is distributed on an * # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * # KIND, either express or implied. See the License for the * -# specific language governing permissions and limitations * -# under the License. * +# specific language governing permissions and limitations * # under the License. * # **************************************************************/ -Feature: SetMessages method on shared folders +Feature: SetMessages method As a James user - I want to be able to modify properties of a shared mail + I want to be able to modify properties of a mail Background: Given a domain named "domain.tld" - And a user "al...@domain.tld" And a user "b...@domain.tld" - And "b...@domain.tld" has a mailbox "shared" - And "al...@domain.tld" has a mailbox "INBOX" - And "b...@domain.tld" has a message "mBob" in "shared" mailbox with two attachments in text - And "al...@domain.tld" has a message "mAlice" in "INBOX" mailbox with two attachments in text - -# Set in mailboxes - - Scenario: A delegated user can copy messages from shared mailbox when having "read" right - Given "b...@domain.tld" shares his mailbox "shared" with "al...@domain.tld" with "lr" rights - And "al...@domain.tld" copies "mBob" from mailbox "shared" of user "b...@domain.tld" to mailbox "INBOX" of user "al...@domain.tld" - Then "al...@domain.tld" should see message "mBob" in mailboxes: - |al...@domain.tld |INBOX | - |b...@domain.tld |shared | - - Scenario: A delegated user can move messages out of shared mailbox when having "read" and "delete" rights - Given "b...@domain.tld" shares his mailbox "shared" with "al...@domain.tld" with "lrte" rights - And "al...@domain.tld" moves "mBob" to mailbox "INBOX" of user "al...@domain.tld" - Then "al...@domain.tld" should see message "mBob" in mailboxes: - |al...@domain.tld |INBOX | - - Scenario: A delegated user can add messages to a shared mailbox when having "insert" rights - Given "b...@domain.tld" shares his mailbox "shared" with "al...@domain.tld" with "lri" rights - And "al...@domain.tld" copies "mAlice" from mailbox "INBOX" of user "al...@domain.tld" to mailbox "shared" of user "b...@domain.tld" - Then "al...@domain.tld" should see message "mAlice" in mailboxes: - |al...@domain.tld |INBOX | - |b...@domain.tld |shared | - - Scenario: A delegated user can add messages with keywords to a shared mailbox when having "write" right - Given "b...@domain.tld" shares his mailbox "shared" with "al...@domain.tld" with "lriws" rights - And "al...@domain.tld" sets flags "$Flagged" on message "mAlice" - And "al...@domain.tld" moves "mAlice" to mailbox "shared" of user "b...@domain.tld" - Then "al...@domain.tld" should see message "mAlice" with keywords "$Flagged" - - Scenario: A delegated user can add sanitized messages to a shared mailbox when missing "write" right - Given "b...@domain.tld" shares his mailbox "shared" with "al...@domain.tld" with "lri" rights - And "al...@domain.tld" sets flags "$Flagged" on message "mAlice" - And "al...@domain.tld" moves "mAlice" to mailbox "shared" of user "b...@domain.tld" - Then "al...@domain.tld" should see message "mAlice" without keywords - - Scenario: A delegated user can not copy messages from shared mailbox when missing "read" right - Given "b...@domain.tld" shares his mailbox "shared" with "al...@domain.tld" with "litewsa" rights - When "al...@domain.tld" copies "mBob" from mailbox "shared" of user "b...@domain.tld" to mailbox "INBOX" of user "al...@domain.tld" - Then message "mBob" is not updated - - Scenario: A delegated user can not copy messages to shared mailbox when missing "insert" right - Given "b...@domain.tld" shares his mailbox "shared" with "al...@domain.tld" with "lrtewsa" rights - When "al...@domain.tld" copies "mAlice" from mailbox "INBOX" of user "al...@domain.tld" to mailbox "shared" of user "b...@domain.tld" - Then message "mAlice" is not updated - - Scenario: A delegated user can not move messages out of shared mailbox when missing "delete" right - Given "b...@domain.tld" shares his mailbox "shared" with "al...@domain.tld" with "lriwsa" rights - When "al...@domain.tld" moves "mBob" to mailbox "INBOX" of user "al...@domain.tld" - Then message "mBob" is not updated + And "b...@domain.tld" has a mailbox "mailbox" + And "b...@domain.tld" has a message "mBob" in "mailbox" mailbox with two attachments in text # Flags update Scenario: A user can update the flags on a message - Given "al...@domain.tld" sets flags "$Flagged,$Seen" on message "mAlice" - When "al...@domain.tld" sets flags "$Flagged,$Forwarded" on message "mAlice" - Then "al...@domain.tld" should see message "mAlice" with keywords "$Flagged,$Forwarded" - - Scenario: A delegated user add keywords on a delegated message when having "write" right - Given "b...@domain.tld" shares his mailbox "shared" with "al...@domain.tld" with "lrw" rights - When "al...@domain.tld" sets flags "$Flagged" on message "mBob" - Then "al...@domain.tld" should see message "mBob" with keywords "$Flagged" - - Scenario: A delegated user can not add keywords on a delegated message when missing "write" right - Given "b...@domain.tld" shares his mailbox "shared" with "al...@domain.tld" with "latires" rights - When "al...@domain.tld" sets flags "$Flagged" on message "mBob" - Then message "mBob" is not updated - - Scenario: A delegated user remove keywords on a delegated message when having "write" right - Given "b...@domain.tld" shares his mailbox "shared" with "al...@domain.tld" with "lrw" rights - And "b...@domain.tld" sets flags "$Flagged" on message "mBob" - When "al...@domain.tld" sets flags "" on message "mBob" - Then "al...@domain.tld" should see message "mBob" without keywords - - Scenario: A delegated user can not remove keywords on a delegated message when missing "write" right - Given "b...@domain.tld" shares his mailbox "shared" with "al...@domain.tld" with "latires" rights - And "b...@domain.tld" sets flags "$Flagged" on message "mBob" - When "al...@domain.tld" sets flags "" on message "mBob" - Then message "mBob" is not updated + Given "b...@domain.tld" sets flags "$Flagged,$Seen" on message "mBob" + When "b...@domain.tld" sets flags "$Flagged,$Forwarded" on message "mBob" + Then "b...@domain.tld" should see message "mBob" with keywords "$Flagged,$Forwarded" # Updating draft @@ -142,28 +67,21 @@ Feature: SetMessages method on shared folders Scenario: Draft creation in any mailbox is allowed Given "b...@domain.tld" has a mailbox "Outbox" - When "b...@domain.tld" tries to create a draft message "mDraft" in mailbox "shared" + When "b...@domain.tld" tries to create a draft message "mDraft" in mailbox "mailbox" Then message "mDraft" is created Scenario: A user can move draft out of draft mailbox Given "b...@domain.tld" has a mailbox "Drafts" And "b...@domain.tld" tries to create a draft message "mDraft" in mailbox "Drafts" - When "b...@domain.tld" moves "mDraft" to user mailbox "shared" + When "b...@domain.tld" moves "mDraft" to user mailbox "mailbox" Then message "mDraft" is updated Scenario: A user can move draft out of draft mailbox when removing draft flag Given "b...@domain.tld" has a mailbox "Drafts" And "b...@domain.tld" tries to create a draft message "mDraft" in mailbox "Drafts" - When the user moves "mDraft" to user mailbox "shared" and set flags "" + When the user moves "mDraft" to user mailbox "mailbox" and set flags "" Then message "mDraft" is updated - Scenario: A delegated user can not move draft from draft mailbox to outbox - Given "b...@domain.tld" has a mailbox "Drafts" - And "b...@domain.tld" tries to create a draft message "mDraft" in mailbox "Drafts" - When "al...@domain.tld" moves "mDraft" to mailbox "Outbox" of user "b...@domain.tld" - Then message "mDraft" is not updated - And message "mBob" has flags $Draft in mailbox "Drafts" of user "b...@domain.tld" - Scenario: A user can move non-draft messages to draft mailbox when setting $Draft Given "b...@domain.tld" has a mailbox "Drafts" When the user moves "mBob" to user mailbox "Drafts" and set flags "$Draft" @@ -172,7 +90,7 @@ Feature: SetMessages method on shared folders Scenario: A user can copy draft out of draft mailbox Given "b...@domain.tld" has a mailbox "Drafts" And "b...@domain.tld" tries to create a draft message "mDraft" in mailbox "Drafts" - When "b...@domain.tld" copies "mDraft" from mailbox "Drafts" to mailbox "shared" + When "b...@domain.tld" copies "mDraft" from mailbox "Drafts" to mailbox "mailbox" Then message "mDraft" is updated Scenario: A user can copy draft out of draft mailbox @@ -182,5 +100,5 @@ Feature: SetMessages method on shared folders Scenario: A user can copy draft out of draft mailbox Given "b...@domain.tld" has a mailbox "Drafts" - When "b...@domain.tld" copies "mBob" from mailbox "shared" to mailbox "Drafts" + When "b...@domain.tld" copies "mBob" from mailbox "mailbox" to mailbox "Drafts" Then message "mBob" is updated \ No newline at end of file http://git-wip-us.apache.org/repos/asf/james-project/blob/f48f0c22/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/SharingParentMailboxWithAndWithoutChildren.feature ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/SharingParentMailboxWithAndWithoutChildren.feature b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/SharingParentMailboxWithAndWithoutChildren.feature deleted file mode 100644 index 4c6e6b8..0000000 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/SharingParentMailboxWithAndWithoutChildren.feature +++ /dev/null @@ -1,105 +0,0 @@ -#*************************************************************** -# Licensed to the Apache Software Foundation (ASF) under one * -# or more contributor license agreements. See the NOTICE file * -# distributed with this work for additional information * -# regarding copyright ownership. The ASF licenses this file * -# to you under the Apache License, Version 2.0 (the * -# "License"); you may not use this file except in compliance * -# with the License. You may obtain a copy of the License at * -# * -# http://www.apache.org/licenses/LICENSE-2.0 * -# * -# Unless required by applicable law or agreed to in writing, * -# software distributed under the License is distributed on an * -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * -# KIND, either express or implied. See the License for the * -# specific language governing permissions and limitations * -# under the License. * -# **************************************************************/ - -Feature: Share parent mailbox without sharing submailbox - As a James user - I want to be able to retrieve my mailboxes - - Background: - Given a domain named "domain.tld" - And a user "al...@domain.tld" - And a user "b...@domain.tld" - And "al...@domain.tld" has a mailbox "shared" - And "al...@domain.tld" has a mailbox "shared.secret" - And "al...@domain.tld" has a mailbox "shared.notsecret" - And "al...@domain.tld" shares her mailbox "shared" with "b...@domain.tld" with "aeilrwt" rights - And "al...@domain.tld" shares her mailbox "shared.notsecret" with "b...@domain.tld" with "aeilrwt" rights - And "al...@domain.tld" has a message "m1" in "shared" mailbox - And "al...@domain.tld" has a message "m2" in "shared.secret" mailbox - And "al...@domain.tld" has a message "m3" in "shared.notsecret" mailbox - - Scenario: Bob can see shared mailbox and explicitly shared children mailbox - When "b...@domain.tld" lists mailboxes - Then the mailboxes should contain "shared" in "Delegated" namespace - And the mailboxes should contain "notsecret" in "Delegated" namespace, with parent mailbox "shared" of user "al...@domain.tld" - And the mailbox "shared" has 1 messages - And the mailbox "notsecret" has 1 messages - - Scenario: Bob can not see not explicitly shared children mailbox - When "b...@domain.tld" lists mailboxes - And the mailboxes should not contain "shared.secret" in "Delegated" namespace - And the mailboxes should not contain "secret" in "Personal" namespace - And the mailboxes should not contain "secret" in "Delegated" namespace, with parent mailbox "shared" of user "al...@domain.tld" - - Scenario: Alice can see all her shared mailbox - When "al...@domain.tld" lists mailboxes - And the mailboxes should contain "shared" in "Personal" namespace - And the mailboxes should contain "notsecret" in "Personal" namespace, with parent mailbox "shared" of user "al...@domain.tld" - And the mailbox "shared" has 1 messages - And the mailbox "notsecret" has 1 messages - - Scenario: Alice can see all her not shared mailbox - When "al...@domain.tld" lists mailboxes - And the mailboxes should contain "secret" in "Personal" namespace, with parent mailbox "shared" of user "al...@domain.tld" - And the mailbox "secret" has 1 messages - - Scenario: Alice can get message from her shared mailbox - When "al...@domain.tld" ask for messages "m1" - Then no error is returned - And the list should contain 1 message - When "al...@domain.tld" ask for messages "m3" - Then no error is returned - And the list should contain 1 message - - Scenario: Alice can get message from her not shared mailbox - When "al...@domain.tld" ask for messages "m2" - Then no error is returned - And the list should contain 1 message - - Scenario: Bob can get message from all his shared mailbox - When "b...@domain.tld" ask for messages "m1" - Then no error is returned - And the list should contain 1 message - When "b...@domain.tld" ask for messages "m3" - Then no error is returned - And the list should contain 1 message - - Scenario: Bob can not get message from mailbox not shared with him - When "b...@domain.tld" ask for messages "m2" - And the list should contain 0 message - - Scenario: Alice can list message from all her shared mailbox - When "al...@domain.tld" asks for message list in mailbox "shared" - Then the message list has size 1 - When "al...@domain.tld" asks for message list in mailbox "shared.notsecret" - Then the message list has size 1 - - Scenario: Alice can list message from all her mailbox she is not sharing - When "al...@domain.tld" asks for message list in mailbox "shared.secret" - Then the message list has size 1 - - Scenario: Bob can list message from all mailbox that are shared to him - When "b...@domain.tld" asks for message list in delegated mailbox "shared" from "al...@domain.tld" - Then the message list has size 1 - When "b...@domain.tld" asks for message list in delegated mailbox "shared.notsecret" from "al...@domain.tld" - Then the message list has size 1 - - Scenario: Bob can not list message from mailbox that are not shared to him - When "b...@domain.tld" asks for message list in delegated mailbox "shared.secret" from "al...@domain.tld" - Then the message list has size 0 http://git-wip-us.apache.org/repos/asf/james-project/blob/f48f0c22/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/sharing/CopyAndSharing.feature ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/sharing/CopyAndSharing.feature b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/sharing/CopyAndSharing.feature new file mode 100644 index 0000000..de466d7 --- /dev/null +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/sharing/CopyAndSharing.feature @@ -0,0 +1,55 @@ +#*************************************************************** +# Licensed to the Apache Software Foundation (ASF) under one * +# or more contributor license agreements. See the NOTICE file * +# distributed with this work for additional information * +# regarding copyright ownership. The ASF licenses this file * +# to you under the Apache License, Version 2.0 (the * +# "License"); you may not use this file except in compliance * +# with the License. You may obtain a copy of the License at * +# * +# http://www.apache.org/licenses/LICENSE-2.0 * +# * +# Unless required by applicable law or agreed to in writing, * +# software distributed under the License is distributed on an * +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * +# KIND, either express or implied. See the License for the * +# specific language governing permissions and limitations * +# under the License. * +# **************************************************************/ +Feature: Copy message and sharing + As a James user + I want that copying message work correctly with shared folder + + Background: + Given a domain named "domain.tld" + And some users "al...@domain.tld", "b...@domain.tld" + And "al...@domain.tld" has a mailbox "shared" + And "al...@domain.tld" shares her mailbox "shared" with "b...@domain.tld" with "aeilrwt" rights + And "b...@domain.tld" has a mailbox "bobMailbox" + And "al...@domain.tld" has a message "m1" in "INBOX" mailbox + And "b...@domain.tld" has a message "m2" in "bobMailbox" mailbox + + Scenario: Copy message should update the total and the unread counts when asked by sharer + Given "al...@domain.tld" copies "m1" from mailbox "INBOX" to mailbox "shared" + When "al...@domain.tld" lists mailboxes + Then the mailbox "shared" has 1 message + And the mailbox "shared" has 1 unseen message + + Scenario: Copy message should update the total and the unread counts when asked by sharer / sharee view + Given "al...@domain.tld" copies "m1" from mailbox "INBOX" to mailbox "shared" + When "b...@domain.tld" lists mailboxes + Then the mailbox "shared" has 1 message + And the mailbox "shared" has 1 unseen message + + Scenario: Copy message should update the total and the unread counts when asked by sharee + Given "b...@domain.tld" copies "m2" from mailbox "bobMailbox" of user "b...@domain.tld" to mailbox "shared" of user "al...@domain.tld" + When "al...@domain.tld" lists mailboxes + Then the mailbox "shared" has 1 message + And the mailbox "shared" has 1 unseen message + + Scenario: Copy message should update the total and the unread counts when asked by sharee / sharee view + Given "b...@domain.tld" copies "m2" from mailbox "bobMailbox" of user "b...@domain.tld" to mailbox "shared" of user "al...@domain.tld" + When "b...@domain.tld" lists mailboxes + Then the mailbox "shared" has 1 message + And the mailbox "shared" has 1 unseen message + http://git-wip-us.apache.org/repos/asf/james-project/blob/f48f0c22/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/sharing/DownloadAndSharing.feature ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/sharing/DownloadAndSharing.feature b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/sharing/DownloadAndSharing.feature new file mode 100644 index 0000000..23194ab --- /dev/null +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/sharing/DownloadAndSharing.feature @@ -0,0 +1,42 @@ +#*************************************************************** +# Licensed to the Apache Software Foundation (ASF) under one * +# or more contributor license agreements. See the NOTICE file * +# distributed with this work for additional information * +# regarding copyright ownership. The ASF licenses this file * +# to you under the Apache License, Version 2.0 (the * +# "License"); you may not use this file except in compliance * +# with the License. You may obtain a copy of the License at * +# * +# http://www.apache.org/licenses/LICENSE-2.0 * +# * +# Unless required by applicable law or agreed to in writing, * +# software distributed under the License is distributed on an * +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * +# KIND, either express or implied. See the License for the * +# specific language governing permissions and limitations * +# under the License. * +# **************************************************************/ +Feature: Download endpoint and shared mailbox + As a James user + I want to access to the download endpoint in order to download attachment from mail of mailbox that has been shared to me + + Background: + Given a domain named "domain.tld" + And some users "al...@domain.tld", "b...@domain.tld", "some...@domain.tld" + And "al...@domain.tld" has a mailbox "shared" + And "al...@domain.tld" mailbox "shared" contains a message "m1" with an attachment "a1" + And "al...@domain.tld" shares his mailbox "shared" with "b...@domain.tld" with "lr" rights + + Scenario: Bob should have access to a shared attachment + Given "b...@domain.tld" is connected + When "b...@domain.tld" downloads "a1" + Then the user should be authorized + + Scenario: Bob can download attachment of another user when shared mailbox + When "b...@domain.tld" downloads "a1" + Then he can read that blob + And the blob size is 3071 + + Scenario: Someone should not be able to download mail's attachment of mailbox shared to others + When "some...@domain.tld" downloads "a1" + Then "some...@domain.tld" should receive a not found response http://git-wip-us.apache.org/repos/asf/james-project/blob/f48f0c22/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/sharing/GetMessageAndSharing.feature ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/sharing/GetMessageAndSharing.feature b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/sharing/GetMessageAndSharing.feature new file mode 100644 index 0000000..30e662f --- /dev/null +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/sharing/GetMessageAndSharing.feature @@ -0,0 +1,48 @@ +#*************************************************************** +# Licensed to the Apache Software Foundation (ASF) under one * +# or more contributor license agreements. See the NOTICE file * +# distributed with this work for additional information * +# regarding copyright ownership. The ASF licenses this file * +# to you under the Apache License, Version 2.0 (the * +# "License"); you may not use this file except in compliance * +# with the License. You may obtain a copy of the License at * +# * +# http://www.apache.org/licenses/LICENSE-2.0 * +# * +# Unless required by applicable law or agreed to in writing, * +# software distributed under the License is distributed on an * +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * +# KIND, either express or implied. See the License for the * +# specific language governing permissions and limitations * +# under the License. * +# **************************************************************/ +Feature: GetMessages method on shared mailbox + As a James user + I want to be able to retrieve messages contained by mailbox that has been shared to me + + Background: + Given a domain named "domain.tld" + And some users "al...@domain.tld", "b...@domain.tld", "some...@domain.tld" + And "al...@domain.tld" has a mailbox "INBOX" + And "al...@domain.tld" has a mailbox "shared" + And "al...@domain.tld" shares her mailbox "shared" with "b...@domain.tld" with "lr" rights + And "al...@domain.tld" has a message "m1" in "shared" mailbox with subject "my test subject", content "testmail" + + Scenario: Retrieving a message in a mailbox delegated to me + When "b...@domain.tld" ask for messages "m1" + Then no error is returned + And the list should contain 1 message + And the id of the message is "m1" + + Scenario: Retrieving a message in a mailbox delegated to someone else + When "some...@domain.tld" ask for messages "m1" + Then no error is returned + And the list of messages is empty + + Scenario: Retrieving a message in a mailbox not delegated to me + Given "al...@domain.tld" has a mailbox "notShared" + And "al...@domain.tld" has a message "m2" in "notShared" mailbox with subject "my test subject", content "testmail" + When "b...@domain.tld" ask for messages "m2" + Then no error is returned + And the list should contain 0 message + --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org