JAMES-2248 add JMAP#getMessageList filtering on subject integration test
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/c2ea1ac0 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/c2ea1ac0 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/c2ea1ac0 Branch: refs/heads/master Commit: c2ea1ac04bf808120e06fdda2493669101a57399 Parents: 82a6786 Author: Luc DUZAN <ldu...@linagora.com> Authored: Wed Dec 6 17:13:42 2017 +0100 Committer: benwa <btell...@linagora.com> Committed: Mon Dec 11 10:11:02 2017 +0700 ---------------------------------------------------------------------- .../integration/GetMessageListMethodTest.java | 17 +++++++++++++++++ .../src/test/resources/eml/twoAttachments.eml | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/c2ea1ac0/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java index 8fd5e78..46a9d96 100644 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java @@ -988,6 +988,23 @@ public abstract class GetMessageListMethodTest { } @Test + public void getMessageListShouldNotFilterMessagesWhenSubjectFilterMatchesSubject() throws Exception { + mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, alice, "mailbox"); + ComposedMessageId message = mailboxProbe.appendMessage(alice, MailboxPath.forUser(alice, "mailbox"), + ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags()); + await(); + + given() + .header("Authorization", aliceAccessToken.serialize()) + .body(String.format("[[\"getMessageList\", {\"filter\":{\"subject\":\"Image\"}}, \"#0\"]]")) + .when() + .post("/jmap") + .then() + .statusCode(200) + .body(ARGUMENTS + ".messageIds", contains(message.getMessageId().serialize())); + } + + @Test public void getMessageListShouldFilterMessagesWhenAttachmentFilterDoesntMatches() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, alice, "mailbox"); byte[] attachmentContent = IOUtils.toByteArray(ClassLoader.getSystemResourceAsStream("eml/attachment.pdf")); http://git-wip-us.apache.org/repos/asf/james-project/blob/c2ea1ac0/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/eml/twoAttachments.eml ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/eml/twoAttachments.eml b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/eml/twoAttachments.eml index 7269376..c6aa6fd 100644 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/eml/twoAttachments.eml +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/eml/twoAttachments.eml @@ -18,8 +18,8 @@ Date: Fri, 27 Mar 2015 21:48:38 +0100 Message-Id: <20150227203838.0011.canontxno.4...@canondir.par.lng> Mime-Version: 1.0 Content-Type: multipart/mixed; - boundary="AHNPACBLDCDIDAGGGDDFAABECGCA" - + boundary="AHNPACBLDCDIDAGGGDDFAABECGCA" + --AHNPACBLDCDIDAGGGDDFAABECGCA Content-Type: text/html; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org