james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [2/2] james-project git commit: JAMES-1682 In getMessageListRequest, collapseThreads=true should be accepted as every message has a unique threadId
Date Thu, 04 Feb 2016 08:59:23 GMT
JAMES-1682 In getMessageListRequest, collapseThreads=true should be accepted as every message
has a unique threadId


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

Branch: refs/heads/master
Commit: 5693353c081fd87b29236c19ba83b51967a9f27f
Parents: 5cde56f
Author: Raphael Ouazana <raphael.ouazana@linagora.com>
Authored: Wed Feb 3 11:37:11 2016 +0100
Committer: Raphael Ouazana <raphael.ouazana@linagora.com>
Committed: Thu Feb 4 09:52:26 2016 +0100

----------------------------------------------------------------------
 .../apache/james/jmap/methods/GetMessageListMethodTest.java | 6 +++---
 .../org/apache/james/jmap/model/GetMessageListRequest.java  | 7 ++-----
 .../apache/james/jmap/model/GetMessageListRequestTest.java  | 9 ++-------
 3 files changed, 7 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/5693353c/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/GetMessageListMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/GetMessageListMethodTest.java
b/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/GetMessageListMethodTest.java
index 5d20456..ddfbf30 100644
--- a/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/GetMessageListMethodTest.java
+++ b/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/GetMessageListMethodTest.java
@@ -340,11 +340,11 @@ public abstract class GetMessageListMethodTest {
             .post("/jmap")
         .then()
             .statusCode(200)
-            .content(startsWith("[[\"messageList\","));
+            .body("[0][0]", equalTo("messageList"));
     }
     
     @Test
-    public void getMessageListShouldReturnErrorWhenCollapseThreadIsTrue() {
+    public void getMessageListShouldWorkWhenCollapseThreadIsTrue() {
         given()
             .accept(ContentType.JSON)
             .contentType(ContentType.JSON)
@@ -354,7 +354,7 @@ public abstract class GetMessageListMethodTest {
             .post("/jmap")
         .then()
             .statusCode(200)
-            .content(equalTo("[[\"error\",{\"type\":\"Not yet implemented\"},\"#0\"]]"));
+            .body("[0][0]", equalTo("messageList"));
     }
     
     @Test

http://git-wip-us.apache.org/repos/asf/james-project/blob/5693353c/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/GetMessageListRequest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/GetMessageListRequest.java
b/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/GetMessageListRequest.java
index 9beee33..e056d66 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/GetMessageListRequest.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/GetMessageListRequest.java
@@ -74,11 +74,8 @@ public class GetMessageListRequest implements JmapRequest {
         }
 
         public Builder collapseThreads(boolean collapseThreads) {
-            if (collapseThreads == false) {
-                this.collapseThreads = collapseThreads;
-                return this;
-            }
-            throw new NotImplementedException();
+            this.collapseThreads = collapseThreads;
+            return this;
         }
 
         public Builder position(int position) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/5693353c/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/GetMessageListRequestTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/GetMessageListRequestTest.java
b/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/GetMessageListRequestTest.java
index 029600d..80557c5 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/GetMessageListRequestTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/GetMessageListRequestTest.java
@@ -47,11 +47,6 @@ public class GetMessageListRequestTest {
     }
 
     @Test(expected=NotImplementedException.class)
-    public void builderShouldThrowWhenCollapseThreadsIsTrue() {
-        GetMessageListRequest.builder().collapseThreads(true);
-    }
-
-    @Test(expected=NotImplementedException.class)
     public void builderShouldThrowWhenAnchor() {
         GetMessageListRequest.builder().anchor(null);
     }
@@ -83,13 +78,13 @@ public class GetMessageListRequestTest {
                 .build();
         List<String> sort = ImmutableList.of("date desc");
         List<String> fetchMessageProperties = ImmutableList.of("id", "blobId");
-        GetMessageListRequest expectedGetMessageListRequest = new GetMessageListRequest(Optional.empty(),
Optional.of(filterCondition), sort, Optional.of(false), 1, Optional.empty(), Optional.empty(),
Optional.of(2),
+        GetMessageListRequest expectedGetMessageListRequest = new GetMessageListRequest(Optional.empty(),
Optional.of(filterCondition), sort, Optional.of(true), 1, Optional.empty(), Optional.empty(),
Optional.of(2),
                 Optional.empty(), Optional.empty(), fetchMessageProperties, Optional.empty());
 
         GetMessageListRequest getMessageListRequest = GetMessageListRequest.builder()
             .filter(filterCondition)
             .sort(sort)
-            .collapseThreads(false)
+            .collapseThreads(true)
             .position(1)
             .limit(2)
             .fetchMessageProperties(fetchMessageProperties)


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


Mime
View raw message