JAMES-2257 Correct JMAP integration tests

Allow reseting draft at the same time of other flags using is\* properties


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

Branch: refs/heads/master
Commit: 9d2f656168ab095efb5d39923826b564e4f3d959
Parents: fb047aa
Author: benwa <btell...@linagora.com>
Authored: Tue Dec 12 10:48:17 2017 +0700
Committer: benwa <btell...@linagora.com>
Committed: Fri Dec 15 14:00:36 2017 +0700

----------------------------------------------------------------------
 .../integration/SetMessagesMethodTest.java       | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/9d2f6561/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
----------------------------------------------------------------------
diff --git 
a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
 
b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
index 196fb6a..2083038 100644
--- 
a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
+++ 
b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
@@ -5192,8 +5192,9 @@ public abstract class SetMessagesMethodTest {
             .body(ARGUMENTS + ".list[0].isForwarded", equalTo(true));
     }
 
+    @Ignore("JAMES-2257 isDraft is rejected during message creation")
     @Test
-    public void 
setMessagesShouldReturnErrorWhenTryingToChangeDraftFlagAmongOthers() {
+    public void 
setMessagesShouldNotReturnAnErrorWhenTryingToChangeDraftFlagAmongOthers() {
         String messageCreationId = "creationId1337";
         String fromAddress = USERNAME;
         String requestBody = "[" +
@@ -5248,11 +5249,15 @@ public abstract class SetMessagesMethodTest {
         .when()
             .post("/jmap")
         .then()
-            .statusCode(400);
+            .statusCode(200)
+            .body(ARGUMENTS + ".updated", hasSize(1))
+            .body(ARGUMENTS + ".updated", contains(messageId));
+
     }
 
+    @Ignore("JAMES-2257 isDraft is rejected during message creation")
     @Test
-    public void 
setMessagesShouldNotModifyTheMessageWhenTryingToChangeDraftFlagAmongOthers() {
+    public void 
setMessagesShouldModifyTheMessageWhenTryingToChangeDraftFlagAmongOthers() {
         String messageCreationId = "creationId1337";
         String fromAddress = USERNAME;
         String requestBody = "[" +
@@ -5315,10 +5320,10 @@ public abstract class SetMessagesMethodTest {
             .log().ifValidationFails()
             .body(NAME, equalTo("messages"))
             .body(ARGUMENTS + ".list", hasSize(1))
-            .body(ARGUMENTS + ".list[0].isUnread", equalTo(true))
-            .body(ARGUMENTS + ".list[0].isFlagged", equalTo(true))
-            .body(ARGUMENTS + ".list[0].isAnswered", equalTo(true))
-            .body(ARGUMENTS + ".list[0].isDraft", equalTo(true))
+            .body(ARGUMENTS + ".list[0].isUnread", equalTo(false))
+            .body(ARGUMENTS + ".list[0].isFlagged", equalTo(false))
+            .body(ARGUMENTS + ".list[0].isAnswered", equalTo(false))
+            .body(ARGUMENTS + ".list[0].isDraft", equalTo(false))
             .body(ARGUMENTS + ".list[0].isForwarded", equalTo(true));
     }
 }


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

Reply via email to