james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [james-project] 03/05: JAMES-2694 Add unit tests backup mailbox with annotation
Date Mon, 15 Apr 2019 07:42:20 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 4a3253710ee358d6e83338eebe9582d92a5075bf
Author: RĂ©mi Kowalski <rkowalski@linagora.com>
AuthorDate: Tue Mar 26 17:41:50 2019 +0100

    JAMES-2694 Add unit tests backup mailbox with annotation
---
 .../james/mailbox/backup/DefaultMailboxBackupTest.java   | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/DefaultMailboxBackupTest.java
b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/DefaultMailboxBackupTest.java
index 98582a4..81f5dc3 100644
--- a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/DefaultMailboxBackupTest.java
+++ b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/DefaultMailboxBackupTest.java
@@ -85,6 +85,22 @@ class DefaultMailboxBackupTest implements MailboxMessageFixture {
     }
 
     @Test
+    void doBackupMailboxWithAnnotationShouldStoreAnArchiveWithMailboxAndAnnotation() throws
Exception {
+        ByteArrayOutputStream destination = new ByteArrayOutputStream(BUFFER_SIZE);
+        MailboxSession session = mailboxManager.createSystemSession(USER);
+        createMailBoxWithMessage(session, MAILBOX_PATH_USER1_MAILBOX1);
+        mailboxManager.updateAnnotations(MAILBOX_PATH_USER1_MAILBOX1, session, WITH_ANNOTATION_1);
+
+        backup.backupAccount(USER1, destination);
+        try (ZipAssert zipAssert = ZipAssert.assertThatZip(destination)) {
+            zipAssert.containsOnlyEntriesMatching(EntryChecks.hasName(MAILBOX_1_NAME + "/").isDirectory(),
+                EntryChecks.hasName(MAILBOX_1_NAME + "/" + "annotations" + "/").isDirectory(),
+                EntryChecks.hasName(MAILBOX_1_NAME + "/" + "annotations" + "/" + ANNOTATION_1_KEY.asString()).hasStringContent(ANNOTATION_1_CONTENT)
+            );
+        }
+    }
+
+    @Test
     void doBackupWithOneMessageShouldStoreAnArchiveWithTwoEntries() throws Exception {
         ByteArrayOutputStream destination = new ByteArrayOutputStream(BUFFER_SIZE);
         MailboxSession session = mailboxManager.createSystemSession(USER);


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


Mime
View raw message