Repository: james-project Updated Branches: refs/heads/master 4dc1d61b5 -> 724af21b5
JAMES-1717 Attachements are now supported - reading HTML mail with JMAP is now supported Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/724af21b Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/724af21b Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/724af21b Branch: refs/heads/master Commit: 724af21b5a4be2d9d42a153df10405740cd206fe Parents: 4dc1d61 Author: Benoit Tellier <btell...@linagora.com> Authored: Mon Jun 6 09:36:00 2016 +0700 Committer: Benoit Tellier <btell...@linagora.com> Committed: Mon Jun 6 14:05:07 2016 +0700 ---------------------------------------------------------------------- .../apache/james/jmap/VacationIntegrationTest.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/724af21b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java index a720a7e..3e7c155 100644 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java @@ -26,6 +26,7 @@ import static com.jayway.restassured.config.RestAssuredConfig.newConfig; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.nullValue; import java.util.List; import java.util.Map; @@ -47,7 +48,6 @@ import com.jayway.restassured.http.ContentType; public abstract class VacationIntegrationTest { - private static final String NAME = "[0][0]"; private static final String ARGUMENTS = "[0][1]"; private static final String SECOND_NAME = "[1][0]"; private static final String SECOND_ARGUMENTS = "[1][1]"; @@ -137,7 +137,7 @@ public abstract class VacationIntegrationTest { calmlyAwait.atMost(10, TimeUnit.SECONDS) .until(() -> isTextMessageReceived(user1AccessToken, getInboxId(user1AccessToken), ORIGINAL_MESSAGE_TEXT_BODY, USER_2, USER_1)); calmlyAwait.atMost(10, TimeUnit.SECONDS) - .until( () -> assertNotYetImplemented(user2AccessToken, getInboxId(user2AccessToken))); + .until( () -> assertOneMessageWithNullTextBodyReceived(user2AccessToken, getInboxId(user2AccessToken), USER_1, USER_2)); } @Test @@ -376,7 +376,7 @@ public abstract class VacationIntegrationTest { .body(SECOND_ARGUMENTS + ".list[0].to.email[0]", equalTo(expectedTo)); } - private boolean assertNotYetImplemented(AccessToken recipientToken, String mailboxId) { + private boolean assertOneMessageWithNullTextBodyReceived(AccessToken recipientToken, String mailboxId, String expectedFrom, String expectedTo) { try { with() .accept(ContentType.JSON) @@ -393,8 +393,12 @@ public abstract class VacationIntegrationTest { .post("/jmap") .then() .statusCode(200) - .body(NAME, equalTo("error")) - .body(ARGUMENTS + ".type", equalTo("Not yet implemented")); + .body(SECOND_NAME, equalTo("messages")) + .body(SECOND_ARGUMENTS + ".list", hasSize(1)) + .body(SECOND_ARGUMENTS + ".list[0].textBody", nullValue()) + .body(SECOND_ARGUMENTS + ".list[0].from.email", equalTo(expectedFrom)) + .body(SECOND_ARGUMENTS + ".list[0].to.email", hasSize(1)) + .body(SECOND_ARGUMENTS + ".list[0].to.email[0]", equalTo(expectedTo)); return true; } catch (AssertionError e) { return false; --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org