Skip to content

Commit

Permalink
Fix Google gmail itest to wait for deletion of mail
Browse files Browse the repository at this point in the history
  • Loading branch information
llowinge authored and ppalaga committed Sep 2, 2020
1 parent f9ea1b7 commit 3d70a48
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,18 @@ public void testGoogleMailComponent() {
.body(is(message));

// Delete
RestAssured.given()
.queryParam("messageId", messageId)
.delete("/google-mail/delete")
.then()
.statusCode(204);
Awaitility.await()
.pollDelay(500, TimeUnit.MILLISECONDS)
.pollInterval(100, TimeUnit.MILLISECONDS)
.atMost(10, TimeUnit.SECONDS).until(() -> {
final int code = RestAssured.given()
.queryParam("messageId", messageId)
.delete("/google-mail/delete")
.then()
.extract()
.statusCode();
return code == 204;
});

RestAssured.given()
.queryParam("messageId", messageId)
Expand Down

0 comments on commit 3d70a48

Please sign in to comment.