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 ma...@apache.org on 2016/01/25 16:22:10 UTC

svn commit: r1726640 - /james/project/trunk/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java

Author: matthieu
Date: Mon Jan 25 15:22:10 2016
New Revision: 1726640

URL: http://svn.apache.org/viewvc?rev=1726640&view=rev
Log:
JAMES-1661 Mailboxes should belong to the authenticated user in integration tests

	Contributed by Raphaƫl Ouazana

Modified:
    james/project/trunk/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java

Modified: james/project/trunk/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java?rev=1726640&r1=1726639&r2=1726640&view=diff
==============================================================================
--- james/project/trunk/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java (original)
+++ james/project/trunk/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java Mon Jan 25 15:22:10 2016
@@ -74,6 +74,7 @@ public abstract class GetMailboxesMethod
         .around(jmapServer);
 
     private AccessToken accessToken;
+    private String username;
 
     @Before
     public void setup() throws Exception {
@@ -84,7 +85,7 @@ public abstract class GetMailboxesMethod
             .build());
 
         String domain = "domain.tld";
-        String username = "username@" + domain;
+        username = "username@" + domain;
         String password = "password";
         jmapServer.serverProbe().addDomain(domain);
         jmapServer.serverProbe().addUser(username, password);
@@ -202,10 +203,9 @@ public abstract class GetMailboxesMethod
 
     @Test
     public void getMailboxesShouldReturnMailboxesWhenAvailable() throws Exception {
-        String user = "user";
-        jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, user, "name");
+        jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "name");
 
-        jmapServer.serverProbe().appendMessage(user, new MailboxPath(MailboxConstants.USER_NAMESPACE, user, "name"), 
+        jmapServer.serverProbe().appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "name"), 
                 new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
 
         String response = given()
@@ -240,8 +240,7 @@ public abstract class GetMailboxesMethod
 
     @Test
     public void getMailboxesShouldReturnFilteredMailboxesPropertiesWhenRequestContainsFilterProperties() throws Exception {
-        String user = "user";
-        jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, user, "name");
+        jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "name");
 
         String response = given()
             .accept(ContentType.JSON)
@@ -276,8 +275,7 @@ public abstract class GetMailboxesMethod
 
     @Test
     public void getMailboxesShouldReturnIdWhenRequestContainsEmptyPropertyListFilter() throws Exception {
-        String user = "user";
-        jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, user, "name");
+        jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "name");
 
         String response = given()
             .accept(ContentType.JSON)
@@ -299,8 +297,7 @@ public abstract class GetMailboxesMethod
 
     @Test
     public void getMailboxesShouldIgnoreUnknownPropertiesWhenRequestContainsUnknownPropertyListFilter() throws Exception {
-        String user = "user";
-        jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, user, "name");
+        jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "name");
 
         String response = given()
             .accept(ContentType.JSON)
@@ -323,9 +320,8 @@ public abstract class GetMailboxesMethod
     @SuppressWarnings("unchecked")
     @Test
     public void getMailboxesShouldReturnMailboxesWithSortOrder() throws Exception {
-        String user = "user";
-        jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, user, "inbox");
-        jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, user, "trash");
+        jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "inbox");
+        jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "trash");
 
         String response = given()
                 .accept(ContentType.JSON)



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