You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by rc...@apache.org on 2021/05/25 08:58:34 UTC

[james-project] 05/05: JAMES-3516 Add threadId unit tests following MessageResult and MailboxMessage POJOs changes

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

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

commit ff7c60836bd7a58f4d41e4663b131886cce5588e
Author: quanth <hq...@linagora.com>
AuthorDate: Mon May 24 11:43:40 2021 +0700

    JAMES-3516 Add threadId unit tests following MessageResult and MailboxMessage POJOs changes
---
 .../src/test/java/org/apache/james/mailbox/MailboxManagerTest.java | 7 +++++++
 .../mailbox/store/mail/model/impl/SimpleMailboxMessageTest.java    | 5 +++++
 2 files changed, 12 insertions(+)

diff --git a/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java b/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java
index 7a23c69..4cce073 100644
--- a/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java
+++ b/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java
@@ -2855,6 +2855,13 @@ public abstract class MailboxManagerTest<T extends MailboxManager> {
                     .collectList().block())
                 .isEmpty();
         }
+
+        @Test
+        void shouldBeAbleToAccessThreadIdOfAMessageAndThatThreadIdShouldWrapsMessageId() throws Exception {
+            ComposedMessageId composeId1 = inboxManager.appendMessage(AppendCommand.builder().build(message), session).getId();
+            MessageResult messageResult = inboxManager.getMessages(MessageRange.one(composeId1.getUid()), FetchGroup.MINIMAL, session).next();
+            assertThat(messageResult.getThreadId().getBaseMessageId()).isInstanceOf(MessageId.class);
+        }
     }
 
     @Nested
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailboxMessageTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailboxMessageTest.java
index 6082fc4..910ff8d 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailboxMessageTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailboxMessageTest.java
@@ -334,4 +334,9 @@ class SimpleMailboxMessageTest {
             .isInstanceOf(NullPointerException.class);
     }
 
+    @Test
+    void simpleMessageShouldReturnThreadIdWhichWrapsMessageId() {
+        assertThat(message.getThreadId().getBaseMessageId()).isEqualTo(message.getMessageId());
+    }
+
 }

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