http://git-wip-us.apache.org/repos/asf/james-project/blob/f15ff20b/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 dea3316..789d4f7 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 @@ -128,7 +128,7 @@ public abstract class GetMessageListMethodTest { MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); MailboxId mailboxId2 = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox2"); - ComposedMessageId message = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); await(); @@ -150,9 +150,9 @@ public abstract class GetMessageListMethodTest { public void getMessageListSetFlaggedFilterShouldResultFlaggedMessages() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.FLAGGED)); await(); @@ -174,9 +174,9 @@ public abstract class GetMessageListMethodTest { public void getMessageListUnsetFlaggedFilterShouldReturnNotFlaggedMessages() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.FLAGGED)); await(); @@ -198,9 +198,9 @@ public abstract class GetMessageListMethodTest { public void getMessageListReadFilterShouldReturnOnlyReadMessages() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId messageNotRead = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotRead = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageRead = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageRead = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.SEEN)); await(); @@ -222,9 +222,9 @@ public abstract class GetMessageListMethodTest { public void getMessageListUnreadFilterShouldReturnOnlyUnreadMessages() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId messageNotRead = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotRead = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageRead = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageRead = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.SEEN)); await(); @@ -246,9 +246,9 @@ public abstract class GetMessageListMethodTest { public void getMessageListSetDraftFilterShouldReturnOnlyDraftMessages() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId messageNotDraft = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotDraft = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageDraft = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageDraft = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.DRAFT)); await(); @@ -270,9 +270,9 @@ public abstract class GetMessageListMethodTest { public void getMessageListUnsetDraftFilterShouldReturnOnlyNonDraftMessages() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId messageNotDraft = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotDraft = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageDraft = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageDraft = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.DRAFT)); await(); @@ -294,9 +294,9 @@ public abstract class GetMessageListMethodTest { public void getMessageListSetAnsweredFilterShouldReturnOnlyAnsweredMessages() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId messageNotAnswered = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotAnswered = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageAnswered = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageAnswered = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.ANSWERED)); await(); @@ -318,9 +318,9 @@ public abstract class GetMessageListMethodTest { public void getMessageListUnsetAnsweredFilterShouldReturnOnlyNotAnsweredMessages() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId messageNotAnswered = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotAnswered = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageAnswered = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageAnswered = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.ANSWERED)); await(); @@ -342,13 +342,13 @@ public abstract class GetMessageListMethodTest { public void getMessageListANDOperatorShouldReturnMessagesWhichMatchAllConditions() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId messageNotSeenNotFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotSeenNotFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageNotSeenFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotSeenFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.FLAGGED)); - ComposedMessageId messageSeenNotFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageSeenNotFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, new Flags(Flags.Flag.SEEN)); - ComposedMessageId messageSeenFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageSeenFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, FlagsBuilder.builder().add(Flags.Flag.SEEN, Flags.Flag.FLAGGED).build()); await(); @@ -372,13 +372,13 @@ public abstract class GetMessageListMethodTest { public void getMessageListOROperatorShouldReturnMessagesWhichMatchOneOfAllConditions() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId messageNotSeenNotFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotSeenNotFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageNotSeenFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotSeenFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.FLAGGED)); - ComposedMessageId messageSeenNotFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageSeenNotFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, new Flags(Flags.Flag.SEEN)); - ComposedMessageId messageSeenFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageSeenFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, FlagsBuilder.builder().add(Flags.Flag.SEEN, Flags.Flag.FLAGGED).build()); await(); @@ -402,13 +402,13 @@ public abstract class GetMessageListMethodTest { public void getMessageListNOTOperatorShouldReturnMessagesWhichNotMatchAnyCondition() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId messageNotSeenNotFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotSeenNotFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageNotSeenFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotSeenFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.FLAGGED)); - ComposedMessageId messageSeenNotFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageSeenNotFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, new Flags(Flags.Flag.SEEN)); - ComposedMessageId messageSeenFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageSeenFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, FlagsBuilder.builder().add(Flags.Flag.SEEN, Flags.Flag.FLAGGED).build()); await(); @@ -432,13 +432,13 @@ public abstract class GetMessageListMethodTest { public void getMessageListNestedOperatorsShouldReturnMessagesWhichMatchConditions() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId messageNotSeenNotFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotSeenNotFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageNotSeenFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotSeenFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.FLAGGED)); - ComposedMessageId messageSeenNotFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageSeenNotFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, new Flags(Flags.Flag.SEEN)); - ComposedMessageId messageSeenFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageSeenFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, FlagsBuilder.builder().add(Flags.Flag.SEEN, Flags.Flag.FLAGGED).build()); await(); @@ -491,11 +491,11 @@ public abstract class GetMessageListMethodTest { public void getMessageListShouldSupportHasAttachmentSetToTrue() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags()); - mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, new Flags()); await(); @@ -514,11 +514,11 @@ public abstract class GetMessageListMethodTest { public void getMessageListShouldSupportHasAttachmentSetToFalse() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags()); - ComposedMessageId message3 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message3 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, new Flags()); await(); @@ -549,9 +549,9 @@ public abstract class GetMessageListMethodTest { public void getMessageListShouldReturnAllMessagesWhenSingleMailboxNoParameters() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); await(); @@ -569,11 +569,11 @@ public abstract class GetMessageListMethodTest { @Test public void getMessageListShouldReturnAllMessagesWhenMultipleMailboxesAndNoParameters() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox2"); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox2"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox2"), new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); await(); @@ -595,16 +595,16 @@ public abstract class GetMessageListMethodTest { dataProbe.addUser(otherUser, password); mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox2"); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox2"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox2"), new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); await(); mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, otherUser, "mailbox"); - mailboxProbe.appendMessage(otherUser, new MailboxPath(MailboxConstants.USER_NAMESPACE, otherUser, "mailbox"), + mailboxProbe.appendMessage(otherUser, MailboxPath.forUser(otherUser, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); await(); @@ -622,7 +622,7 @@ public abstract class GetMessageListMethodTest { @Test public void getMessageListShouldFilterMessagesWhenInMailboxesFilterMatches() throws Exception { MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId message = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); await(); @@ -640,7 +640,7 @@ public abstract class GetMessageListMethodTest { @Test public void getMessageListShouldFilterMessagesWhenMultipleInMailboxesFilterMatches() throws Exception { MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId message = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); MailboxId mailboxId2 = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox2"); @@ -660,7 +660,7 @@ public abstract class GetMessageListMethodTest { @Test public void getMessageListShouldFilterMessagesWhenNotInMailboxesFilterMatches() throws Exception { MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); await(); @@ -679,11 +679,11 @@ public abstract class GetMessageListMethodTest { @Test public void getMessageListShouldFilterMessagesWhenNotInMailboxesFilterMatchesTwice() throws Exception { MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); MailboxId mailbox2Id = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox2"); - mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox2"), + mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox2"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); await(); @@ -701,7 +701,7 @@ public abstract class GetMessageListMethodTest { @Test public void getMessageListShouldFilterMessagesWhenIdenticalNotInMailboxesAndInmailboxesFilterMatch() throws Exception { MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); await(); @@ -719,7 +719,7 @@ public abstract class GetMessageListMethodTest { @Test public void getMessageListShouldNotFilterMessagesWhenNotInMailboxesFilterDoesNotMatch() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId message = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); MailboxId mailbox2Id = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox2"); @@ -739,7 +739,7 @@ public abstract class GetMessageListMethodTest { @Test public void getMessageListShouldNotFilterMessagesWhenEmptyNotInMailboxesFilter() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId message = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox2"); @@ -761,7 +761,7 @@ public abstract class GetMessageListMethodTest { MailboxId emptyMailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "emptyMailbox"); mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); await(); @@ -778,7 +778,7 @@ public abstract class GetMessageListMethodTest { @Test public void getMessageListShouldFilterMessagesWhenTextFilterDoesntMatches() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); await(); @@ -795,7 +795,7 @@ public abstract class GetMessageListMethodTest { @Test public void getMessageListShouldNotFilterMessagesWhenTextFilterMatchesBody() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId message = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags()); await(); @@ -828,7 +828,7 @@ public abstract class GetMessageListMethodTest { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); MessageWriter writer = new DefaultMessageWriter(); writer.writeMessage(message, outputStream); - mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream(outputStream.toByteArray()), new Date(), false, new Flags()); await(); @@ -861,7 +861,7 @@ public abstract class GetMessageListMethodTest { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); MessageWriter writer = new DefaultMessageWriter(); writer.writeMessage(message, outputStream); - ComposedMessageId composedMessageId = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId composedMessageId = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream(outputStream.toByteArray()), new Date(), false, new Flags()); await(); @@ -880,9 +880,9 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); await(); @@ -902,10 +902,10 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.parse("Wed, 28 Jun 17 09:23:01 +0200", ImapDateTimeFormatter.rfc5322()); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags()); LocalDate date2 = LocalDate.parse("Tue, 27 Jun 2017 09:23:01 +0200", ImapDateTimeFormatter.rfc5322()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date2), false, new Flags()); await(); @@ -925,9 +925,9 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); await(); @@ -947,9 +947,9 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: a subject\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject: b subject\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); await(); @@ -969,9 +969,9 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: a subject\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject: b subject\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); await(); @@ -991,9 +991,9 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: subject\r\nFrom: bbb\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject: subject\r\nFrom: aaa\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); await(); @@ -1013,9 +1013,9 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: subject\r\nFrom: aaa\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject: subject\r\nFrom: bbb\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); await(); @@ -1035,9 +1035,9 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: subject\r\nTo: bbb\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject: subject\r\nTo: aaa\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); await(); @@ -1057,9 +1057,9 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: subject\r\nTo: aaa\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject: subject\r\nTo: bbb\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); await(); @@ -1080,9 +1080,9 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: subject\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject: subject\r\n\r\ntestmail bigger".getBytes()), convertToDate(date), false, new Flags()); await(); @@ -1102,9 +1102,9 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: subject\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject: subject\r\n\r\ntestmail bigger".getBytes()), convertToDate(date), false, new Flags()); await(); @@ -1124,11 +1124,11 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: test\r\n\r\ntestmail really bigger".getBytes()), convertToDate(date.plusDays(1)), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject: test\r\n\r\ntestmail smaller".getBytes()), convertToDate(date), false, new Flags()); - ComposedMessageId message3 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message3 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 15:54:59 +0200\r\nSubject: test\r\n\r\ntestmail really bigger".getBytes()), convertToDate(date.plusDays(1)), false, new Flags()); await(); @@ -1149,11 +1149,11 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: test\r\n\r\ntestmail really bigger".getBytes()), convertToDate(date), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: test\r\n\r\ntestmail smaller".getBytes()), convertToDate(date), false, new Flags()); - ComposedMessageId message3 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message3 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Date: Fri, 02 Jun 2017 15:54:59 +0200\r\nSubject: test\r\n\r\ntestmail really bigger".getBytes()), convertToDate(date), false, new Flags()); await(); @@ -1174,9 +1174,9 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); await(); @@ -1196,9 +1196,9 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); await(); @@ -1242,9 +1242,9 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); await(); @@ -1264,9 +1264,9 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); await(); @@ -1286,11 +1286,11 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(2)), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags()); - mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test3\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); await(); @@ -1310,9 +1310,9 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); await(); @@ -1332,9 +1332,9 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - ComposedMessageId message = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags()); - mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); await(); @@ -1354,13 +1354,13 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); - ComposedMessageId message3 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message3 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test3\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); - mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test4\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); await(); @@ -1380,7 +1380,7 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - ComposedMessageId message = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags()); await(); @@ -1408,7 +1408,7 @@ public abstract class GetMessageListMethodTest { + "\r\n" + "Hello <b>someone</b>, and thank you for joining example.com!"; LocalDate date = LocalDate.now(); - mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream(mailContent.getBytes()), convertToDate(date.plusDays(1)), false, new Flags()); await(); @@ -1431,9 +1431,9 @@ public abstract class GetMessageListMethodTest { public void getMessageListHasKeywordFilterShouldReturnMessagesWithKeywords() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags(Flags.Flag.FLAGGED)); await(); @@ -1460,9 +1460,9 @@ public abstract class GetMessageListMethodTest { .add(FORWARDED) .build(); - ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, flags); await(); @@ -1484,9 +1484,9 @@ public abstract class GetMessageListMethodTest { public void getMessageListNotKeywordFilterShouldReturnMessagesWithoutKeywords() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags(Flags.Flag.FLAGGED)); await(); @@ -1513,9 +1513,9 @@ public abstract class GetMessageListMethodTest { .add(FORWARDED) .build(); - ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, flags); await(); @@ -1542,9 +1542,9 @@ public abstract class GetMessageListMethodTest { .add(Flags.Flag.DRAFT) .build(); - ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags(Flags.Flag.FLAGGED)); - ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, flags); await(); @@ -1565,9 +1565,9 @@ public abstract class GetMessageListMethodTest { public void getMessageListHasKeywordAndNotKeywordFilterShouldReturnMessagesWithAndWithoutKeywords() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags(Flags.Flag.FLAGGED)); await(); @@ -1589,9 +1589,9 @@ public abstract class GetMessageListMethodTest { public void getMessageListHasKeywordShouldIgnoreDeleted() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags(Flags.Flag.DELETED)); await(); @@ -1612,9 +1612,9 @@ public abstract class GetMessageListMethodTest { public void getMessageListHasKeywordShouldIgnoreRecent() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags(Flags.Flag.RECENT)); await(); @@ -1635,9 +1635,9 @@ public abstract class GetMessageListMethodTest { public void getMessageListNotKeywordShouldIgnoreDeleted() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags(Flags.Flag.DELETED)); await(); @@ -1658,9 +1658,9 @@ public abstract class GetMessageListMethodTest { public void getMessageListNotKeywordShouldIgnoreRecent() throws Exception { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); - ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags()); - ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId messageFlagged = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags(Flags.Flag.RECENT)); await(); @@ -1682,9 +1682,9 @@ public abstract class GetMessageListMethodTest { mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username, "mailbox"); LocalDate date = LocalDate.now(); - ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message1 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags()); - ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE, username, "mailbox"), + ComposedMessageId message2 = mailboxProbe.appendMessage(username, MailboxPath.forUser(username, "mailbox"), new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags()); await();
http://git-wip-us.apache.org/repos/asf/james-project/blob/f15ff20b/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 ebed0a4..1bc5731 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 @@ -118,7 +118,7 @@ public abstract class SetMessagesMethodTest { private static final String USERS_DOMAIN = "domain.tld"; private static final String USERNAME = "username@" + USERS_DOMAIN; private static final String PASSWORD = "password"; - private static final MailboxPath USER_MAILBOX = new MailboxPath(MailboxConstants.USER_NAMESPACE, USERNAME, "mailbox"); + private static final MailboxPath USER_MAILBOX = MailboxPath.forUser(USERNAME, "mailbox"); private static final String NOT_UPDATED = ARGUMENTS + ".notUpdated"; private ConditionFactory calmlyAwait; @@ -1330,7 +1330,7 @@ public abstract class SetMessagesMethodTest { return false; } EventFactory.AddedImpl added = (EventFactory.AddedImpl) event; - return added.getMailboxPath().equals(new MailboxPath(MailboxConstants.USER_NAMESPACE, USERNAME, DefaultMailboxes.OUTBOX)) + return added.getMailboxPath().equals(MailboxPath.forUser(USERNAME, DefaultMailboxes.OUTBOX)) && added.getUids().size() == 1 && added.getMetaData(added.getUids().get(0)).getMessageId().serialize().equals(messageId); } @@ -2077,7 +2077,7 @@ public abstract class SetMessagesMethodTest { @Test public void mailboxIdsShouldReturnUpdatedWhenNoChange() throws Exception { ZonedDateTime dateTime = ZonedDateTime.parse("2014-10-30T14:12:00Z"); - ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, new MailboxPath(MailboxConstants.USER_NAMESPACE, USERNAME, MailboxConstants.INBOX), + ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, MailboxPath.forUser(USERNAME, MailboxConstants.INBOX), new ByteArrayInputStream("Subject: my test subject\r\n\r\ntestmail".getBytes(Charsets.UTF_8)), Date.from(dateTime.toInstant()), false, new Flags()); String messageToMoveId = message.getMessageId().serialize(); @@ -2110,7 +2110,7 @@ public abstract class SetMessagesMethodTest { String heartFolderId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, USERNAME, newMailboxName).serialize(); ZonedDateTime dateTime = ZonedDateTime.parse("2014-10-30T14:12:00Z"); - ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, new MailboxPath(MailboxConstants.USER_NAMESPACE, USERNAME, MailboxConstants.INBOX), + ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, MailboxPath.forUser(USERNAME, MailboxConstants.INBOX), new ByteArrayInputStream("Subject: my test subject\r\n\r\ntestmail".getBytes(Charsets.UTF_8)), Date.from(dateTime.toInstant()), false, new Flags()); String messageToMoveId = message.getMessageId().serialize(); @@ -2154,7 +2154,7 @@ public abstract class SetMessagesMethodTest { String heartFolderId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, USERNAME, newMailboxName).serialize(); ZonedDateTime dateTime = ZonedDateTime.parse("2014-10-30T14:12:00Z"); - ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, new MailboxPath(MailboxConstants.USER_NAMESPACE, USERNAME, MailboxConstants.INBOX), + ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, MailboxPath.forUser(USERNAME, MailboxConstants.INBOX), new ByteArrayInputStream("Subject: my test subject\r\n\r\ntestmail".getBytes(Charsets.UTF_8)), Date.from(dateTime.toInstant()), false, new Flags()); String messageToMoveId = message.getMessageId().serialize(); @@ -2196,7 +2196,7 @@ public abstract class SetMessagesMethodTest { String heartFolderId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, USERNAME, newMailboxName).serialize(); ZonedDateTime dateTime = ZonedDateTime.parse("2014-10-30T14:12:00Z"); - ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, new MailboxPath(MailboxConstants.USER_NAMESPACE, USERNAME, MailboxConstants.INBOX), + ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, MailboxPath.forUser(USERNAME, MailboxConstants.INBOX), new ByteArrayInputStream("Subject: my test subject\r\n\r\ntestmail".getBytes(Charsets.UTF_8)), Date.from(dateTime.toInstant()), false, new Flags()); String messageToMoveId = message.getMessageId().serialize(); @@ -2239,7 +2239,7 @@ public abstract class SetMessagesMethodTest { String heartFolderId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, USERNAME, newMailboxName).serialize(); ZonedDateTime dateTime = ZonedDateTime.parse("2014-10-30T14:12:00Z"); - ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, new MailboxPath(MailboxConstants.USER_NAMESPACE, USERNAME, MailboxConstants.INBOX), + ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, MailboxPath.forUser(USERNAME, MailboxConstants.INBOX), new ByteArrayInputStream("Subject: my test subject\r\n\r\ntestmail".getBytes(Charsets.UTF_8)), Date.from(dateTime.toInstant()), false, new Flags()); String messageToMoveId = message.getMessageId().serialize(); @@ -2279,7 +2279,7 @@ public abstract class SetMessagesMethodTest { @Test public void mailboxIdsShouldBeInOriginalMailboxWhenNoChange() throws Exception { ZonedDateTime dateTime = ZonedDateTime.parse("2014-10-30T14:12:00Z"); - ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, new MailboxPath(MailboxConstants.USER_NAMESPACE, USERNAME, MailboxConstants.INBOX), + ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, MailboxPath.forUser(USERNAME, MailboxConstants.INBOX), new ByteArrayInputStream("Subject: my test subject\r\n\r\ntestmail".getBytes(Charsets.UTF_8)), Date.from(dateTime.toInstant()), false, new Flags()); String messageToMoveId = message.getMessageId().serialize(); @@ -2319,7 +2319,7 @@ public abstract class SetMessagesMethodTest { @Test public void mailboxIdsShouldReturnErrorWhenMovingToADeletedMailbox() throws Exception { ZonedDateTime dateTime = ZonedDateTime.parse("2014-10-30T14:12:00Z"); - ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, new MailboxPath(MailboxConstants.USER_NAMESPACE, USERNAME, MailboxConstants.INBOX), + ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, MailboxPath.forUser(USERNAME, MailboxConstants.INBOX), new ByteArrayInputStream("Subject: my test subject\r\n\r\ntestmail".getBytes(Charsets.UTF_8)), Date.from(dateTime.toInstant()), false, new Flags()); mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, USERNAME, "any"); @@ -2358,7 +2358,7 @@ public abstract class SetMessagesMethodTest { @Test public void mailboxIdsShouldReturnErrorWhenSetToEmpty() throws Exception { ZonedDateTime dateTime = ZonedDateTime.parse("2014-10-30T14:12:00Z"); - ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, new MailboxPath(MailboxConstants.USER_NAMESPACE, USERNAME, MailboxConstants.INBOX), + ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, MailboxPath.forUser(USERNAME, MailboxConstants.INBOX), new ByteArrayInputStream("Subject: my test subject\r\n\r\ntestmail".getBytes(Charsets.UTF_8)), Date.from(dateTime.toInstant()), false, new Flags()); String messageToMoveId = message.getMessageId().serialize(); @@ -2396,7 +2396,7 @@ public abstract class SetMessagesMethodTest { String heartFolderId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, USERNAME, newMailboxName).serialize(); ZonedDateTime dateTime = ZonedDateTime.parse("2014-10-30T14:12:00Z"); - ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, new MailboxPath(MailboxConstants.USER_NAMESPACE, USERNAME, MailboxConstants.INBOX), + ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, MailboxPath.forUser(USERNAME, MailboxConstants.INBOX), new ByteArrayInputStream("Subject: my test subject\r\n\r\ntestmail".getBytes(Charsets.UTF_8)), Date.from(dateTime.toInstant()), false, new Flags()); String messageToMoveId = message.getMessageId().serialize(); @@ -2429,7 +2429,7 @@ public abstract class SetMessagesMethodTest { String heartFolderId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, USERNAME, newMailboxName).serialize(); ZonedDateTime dateTime = ZonedDateTime.parse("2014-10-30T14:12:00Z"); - ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, new MailboxPath(MailboxConstants.USER_NAMESPACE, USERNAME, MailboxConstants.INBOX), + ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, MailboxPath.forUser(USERNAME, MailboxConstants.INBOX), new ByteArrayInputStream("Subject: my test subject\r\n\r\ntestmail".getBytes(Charsets.UTF_8)), Date.from(dateTime.toInstant()), false, new Flags()); String messageToMoveId = message.getMessageId().serialize(); @@ -2472,7 +2472,7 @@ public abstract class SetMessagesMethodTest { String trashId = mailboxProbe.getMailbox(MailboxConstants.USER_NAMESPACE, USERNAME, DefaultMailboxes.TRASH).getMailboxId().serialize(); ZonedDateTime dateTime = ZonedDateTime.parse("2014-10-30T14:12:00Z"); - ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, new MailboxPath(MailboxConstants.USER_NAMESPACE, USERNAME, MailboxConstants.INBOX), + ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, MailboxPath.forUser(USERNAME, MailboxConstants.INBOX), new ByteArrayInputStream("Subject: my test subject\r\n\r\ntestmail".getBytes(Charsets.UTF_8)), Date.from(dateTime.toInstant()), false, new Flags()); String messageToMoveId = message.getMessageId().serialize(); @@ -2508,7 +2508,7 @@ public abstract class SetMessagesMethodTest { String trashId = mailboxProbe.getMailbox(MailboxConstants.USER_NAMESPACE, USERNAME, DefaultMailboxes.TRASH).getMailboxId().serialize(); ZonedDateTime dateTime = ZonedDateTime.parse("2014-10-30T14:12:00Z"); - ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, new MailboxPath(MailboxConstants.USER_NAMESPACE, USERNAME, MailboxConstants.INBOX), + ComposedMessageId message = mailboxProbe.appendMessage(USERNAME, MailboxPath.forUser(USERNAME, MailboxConstants.INBOX), new ByteArrayInputStream("Subject: my test subject\r\n\r\ntestmail".getBytes(Charsets.UTF_8)), Date.from(dateTime.toInstant()), false, new Flags()); String messageToMoveId = message.getMessageId().serialize(); http://git-wip-us.apache.org/repos/asf/james-project/blob/f15ff20b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java index d619806..48e0615 100644 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java @@ -93,7 +93,7 @@ public class DownloadStepdefs { @Given("^\"([^\"]*)\" mailbox \"([^\"]*)\" contains a message \"([^\"]*)\"$") public void appendMessageToMailbox(String user, String mailbox, String messageId) throws Throwable { - MailboxPath mailboxPath = new MailboxPath(MailboxConstants.USER_NAMESPACE, user, mailbox); + MailboxPath mailboxPath = MailboxPath.forUser(user, mailbox); ComposedMessageId composedMessageId = mainStepdefs.mailboxProbe.appendMessage(user, mailboxPath, ClassLoader.getSystemResourceAsStream("eml/oneAttachment.eml"), new Date(), false, new Flags()); @@ -103,7 +103,7 @@ public class DownloadStepdefs { @Given("^\"([^\"]*)\" mailbox \"([^\"]*)\" contains a message \"([^\"]*)\" with an attachment \"([^\"]*)\"$") public void appendMessageWithAttachmentToMailbox(String user, String mailbox, String messageId, String attachmentId) throws Throwable { - MailboxPath mailboxPath = new MailboxPath(MailboxConstants.USER_NAMESPACE, user, mailbox); + MailboxPath mailboxPath = MailboxPath.forUser(user, mailbox); mainStepdefs.mailboxProbe.appendMessage(user, mailboxPath, ClassLoader.getSystemResourceAsStream("eml/oneAttachment.eml"), new Date(), false, new Flags()); @@ -114,7 +114,7 @@ public class DownloadStepdefs { @Given("^\"([^\"]*)\" mailbox \"([^\"]*)\" contains a message \"([^\"]*)\" with an inlined attachment \"([^\"]*)\"$") public void appendMessageWithInlinedAttachmentToMailbox(String user, String mailbox, String messageId, String attachmentId) throws Throwable { - MailboxPath mailboxPath = new MailboxPath(MailboxConstants.USER_NAMESPACE, user, mailbox); + MailboxPath mailboxPath = MailboxPath.forUser(user, mailbox); mainStepdefs.mailboxProbe.appendMessage(user, mailboxPath, ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, new Flags()); @@ -124,7 +124,7 @@ public class DownloadStepdefs { @Given("^\"([^\"]*)\" mailbox \"([^\"]*)\" contains a message \"([^\"]*)\" with multiple same inlined attachments \"([^\"]*)\"$") public void appendMessageWithSameInlinedAttachmentsToMailbox(String user, String mailbox, String messageName, String attachmentId) throws Throwable { - MailboxPath mailboxPath = new MailboxPath(MailboxConstants.USER_NAMESPACE, user, mailbox); + MailboxPath mailboxPath = MailboxPath.forUser(user, mailbox); mainStepdefs.mailboxProbe.appendMessage(user, mailboxPath, ClassLoader.getSystemResourceAsStream("eml/sameInlinedImages.eml"), new Date(), false, new Flags()); http://git-wip-us.apache.org/repos/asf/james-project/blob/f15ff20b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java index 1c3da93..05657a2 100644 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java @@ -139,7 +139,7 @@ public class GetMessagesMethodStepdefs { public void appendMessageFromFileInlinedMultipart(String messageName, String mailbox) throws Exception { ZonedDateTime dateTime = ZonedDateTime.parse("2014-10-30T14:12:00Z"); MessageId id = mainStepdefs.mailboxProbe.appendMessage(userStepdefs.lastConnectedUser, - new MailboxPath(MailboxConstants.USER_NAMESPACE, userStepdefs.lastConnectedUser, mailbox), + MailboxPath.forUser(userStepdefs.lastConnectedUser, mailbox), ClassLoader.getSystemResourceAsStream("eml/inlinedMultipart.eml"), Date.from(dateTime.toInstant()), false, new Flags()) .getMessageId(); @@ -149,7 +149,7 @@ public class GetMessagesMethodStepdefs { private MessageId appendMessage(String mailbox, ContentType contentType, String subject, String content, Optional<Map<String, String>> headers) throws Exception { ZonedDateTime dateTime = ZonedDateTime.parse("2014-10-30T14:12:00Z"); return mainStepdefs.mailboxProbe.appendMessage(userStepdefs.lastConnectedUser, - new MailboxPath(MailboxConstants.USER_NAMESPACE, userStepdefs.lastConnectedUser, mailbox), + MailboxPath.forUser(userStepdefs.lastConnectedUser, mailbox), new ByteArrayInputStream(message(contentType, subject, content, headers).getBytes(Charsets.UTF_8)), Date.from(dateTime.toInstant()), false, new Flags()).getMessageId(); } @@ -259,7 +259,7 @@ public class GetMessagesMethodStepdefs { ZonedDateTime dateTime = ZonedDateTime.parse("2014-10-30T14:12:00Z"); boolean isRecent = flags.contains(Flags.Flag.RECENT); MessageId id = mainStepdefs.mailboxProbe.appendMessage(userStepdefs.lastConnectedUser, - new MailboxPath(MailboxConstants.USER_NAMESPACE, userStepdefs.lastConnectedUser, DefaultMailboxes.INBOX), + MailboxPath.forUser(userStepdefs.lastConnectedUser, DefaultMailboxes.INBOX), new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), Date.from(dateTime.toInstant()), isRecent, flags) .getMessageId(); @@ -269,7 +269,7 @@ public class GetMessagesMethodStepdefs { private void appendMessage(String messageName, String emlFileName) throws Exception { ZonedDateTime dateTime = ZonedDateTime.parse("2014-10-30T14:12:00Z"); MessageId id = mainStepdefs.mailboxProbe.appendMessage(userStepdefs.lastConnectedUser, - new MailboxPath(MailboxConstants.USER_NAMESPACE, userStepdefs.lastConnectedUser, DefaultMailboxes.INBOX), + MailboxPath.forUser(userStepdefs.lastConnectedUser, DefaultMailboxes.INBOX), ClassLoader.getSystemResourceAsStream(emlFileName), Date.from(dateTime.toInstant()), false, new Flags()) .getMessageId(); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
