This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 88ae89daadb872b0b51317e4541fcc3b764e6ffa
Author: Benoit Tellier <btell...@linagora.com>
AuthorDate: Sat Feb 13 07:30:27 2021 +0700

    JAMES-3500 Fix instable test in GetMailboxesMethodTest
    
    Quota update is asynchronous for the distributed
    server hence needs to be awaited.
---
 .../integration/GetMailboxesMethodTest.java        | 24 ++++++++++++----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git 
a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMailboxesMethodTest.java
 
b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMailboxesMethodTest.java
index 332be1e..1261e75 100644
--- 
a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMailboxesMethodTest.java
+++ 
b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMailboxesMethodTest.java
@@ -31,6 +31,7 @@ import static 
org.apache.james.jmap.JMAPTestingConstants.DOMAIN;
 import static org.apache.james.jmap.JMAPTestingConstants.FIRST_MAILBOX;
 import static org.apache.james.jmap.JMAPTestingConstants.NAME;
 import static org.apache.james.jmap.JMAPTestingConstants.SECOND_MAILBOX;
+import static org.apache.james.jmap.JMAPTestingConstants.calmlyAwait;
 import static 
org.apache.james.jmap.JMAPTestingConstants.jmapRequestSpecBuilder;
 import static org.apache.james.jmap.JmapURIBuilder.baseUri;
 import static org.assertj.core.api.Assertions.assertThat;
@@ -899,16 +900,17 @@ public abstract class GetMailboxesMethodTest {
 
         mailboxProbe.appendMessage(ALICE.asString(), 
MailboxPath.forUser(ALICE, DefaultMailboxes.INBOX), 
AppendCommand.from(message));
 
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + mailboxId + "\"]}, 
\"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(1))
-            .body(FIRST_MAILBOX + 
".quotas['#private&al...@domain.tld']['STORAGE'].used", equalTo(85))
-            .body(FIRST_MAILBOX + 
".quotas['#private&al...@domain.tld']['MESSAGE'].used", equalTo(1));
+        calmlyAwait.untilAsserted(() ->
+            given()
+                .header("Authorization", accessToken.asString())
+                .body("[[\"getMailboxes\", {\"ids\": [\"" + mailboxId + "\"]}, 
\"#0\"]]")
+            .when()
+                .post("/jmap")
+            .then()
+                .statusCode(200)
+                .body(NAME, equalTo("mailboxes"))
+                .body(ARGUMENTS + ".list", hasSize(1))
+                .body(FIRST_MAILBOX + 
".quotas['#private&al...@domain.tld']['STORAGE'].used", equalTo(85))
+                .body(FIRST_MAILBOX + 
".quotas['#private&al...@domain.tld']['MESSAGE'].used", equalTo(1)));
     }
 }


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

Reply via email to