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 2017/11/16 01:37:03 UTC

james-project git commit: JAMES-2216 Integration test when sharing subfolder without sharing parent

Repository: james-project
Updated Branches:
  refs/heads/master f339d8c69 -> 29510c2a3


JAMES-2216 Integration test when sharing subfolder without sharing parent


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

Branch: refs/heads/master
Commit: 29510c2a3e3e7c501e4d64cbe5935e3ef8db2218
Parents: f339d8c
Author: quynhn <qn...@linagora.com>
Authored: Tue Nov 14 17:46:55 2017 +0700
Committer: benwa <bt...@linagora.com>
Committed: Thu Nov 16 08:36:29 2017 +0700

----------------------------------------------------------------------
 .../cucumber/GetMailboxesMethodStepdefs.java         | 12 ++++++++++--
 .../src/test/resources/cucumber/GetMailboxes.feature | 15 +++++++++++++++
 2 files changed, 25 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/29510c2a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMailboxesMethodStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMailboxesMethodStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMailboxesMethodStepdefs.java
index 8b6514e..85e9af3 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMailboxesMethodStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMailboxesMethodStepdefs.java
@@ -63,9 +63,17 @@ public class GetMailboxesMethodStepdefs {
         assertThat(httpClient.jsonPath.<List<String>>read(ARGUMENTS + ".list")).hasSize(numberOfMailboxes);
     }
 
-    @Then("^the mailbox \"([^\"]*)\" should be present$")
-    public void assertMailboxesNames(String mailboxName) throws Exception {
+    @Then("^the mailboxes should contain \"([^\"]*)\" in \"([^\"]*)\" namespace$")
+    public void assertMailboxesNames(String mailboxName, String namespace) throws Exception {
         assertThat(httpClient.jsonPath.<List<String>>read(ARGUMENTS + ".list[*].name")).contains(mailboxName);
+        assertThat(httpClient.jsonPath.<List<String>>read(ARGUMENTS + ".list[?].namespace.type",
+                filter(where("name").is(mailboxName))))
+            .containsOnly(namespace);
+    }
+
+    @Then("^the mailboxes should not contain \"([^\"]*)\"$")
+    public void assertNoMailboxesNames(String mailboxName) throws Exception {
+        assertThat(httpClient.jsonPath.<List<String>>read(ARGUMENTS + ".list[*].name")).doesNotContain(mailboxName);
     }
 
     @Then("^the mailbox \"([^\"]*)\" has (\\d+) (?:messages|message)$")

http://git-wip-us.apache.org/repos/asf/james-project/blob/29510c2a/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
index 9bbe9cc..28f0011 100644
--- 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
@@ -242,3 +242,18 @@ Feature: GetMailboxes method
     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 "alice@domain.tld" has a mailbox "mailbox1"
+    And "alice@domain.tld" has a mailbox "mailbox1.shared"
+    And "alice@domain.tld" shares her mailbox "mailbox1.shared" with "bob@domain.tld" with "aeirwt" rights
+    When "bob@domain.tld" ask for 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 "alice@domain.tld" has a mailbox "mailbox1"
+    And "alice@domain.tld" has a mailbox "mailbox1.shared"
+    And "alice@domain.tld" shares her mailbox "mailbox1.shared" with "bob@domain.tld" with "l" rights
+    When "bob@domain.tld" ask for mailboxes
+    Then the mailboxes should contain "shared" in "Delegated" namespace
+    And the mailboxes should contain "mailbox1" in "Delegated" namespace
\ No newline at end of file


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