You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2020/04/29 01:14:49 UTC

[james-project] 15/27: JAMES-3138 Task for recomputing current quotas

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

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

commit 7f5a6944c169e9dd6205a53ca5c1c9e8f259e88c
Author: Rene Cordier <rc...@linagora.com>
AuthorDate: Fri Apr 24 11:05:54 2020 +0700

    JAMES-3138 Task for recomputing current quotas
---
 .../apache/james/mailbox/model/QuotaRootTest.java  | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/mailbox/api/src/test/java/org/apache/james/mailbox/model/QuotaRootTest.java b/mailbox/api/src/test/java/org/apache/james/mailbox/model/QuotaRootTest.java
index b9b80fb..76dd31e 100644
--- a/mailbox/api/src/test/java/org/apache/james/mailbox/model/QuotaRootTest.java
+++ b/mailbox/api/src/test/java/org/apache/james/mailbox/model/QuotaRootTest.java
@@ -19,6 +19,11 @@
 
 package org.apache.james.mailbox.model;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.Optional;
+
+import org.apache.james.core.Domain;
 import org.junit.jupiter.api.Test;
 
 import nl.jqno.equalsverifier.EqualsVerifier;
@@ -28,4 +33,23 @@ class QuotaRootTest {
     void shouldMatchBeanContract() {
         EqualsVerifier.forClass(QuotaRoot.class).verify();
     }
+
+    @Test
+    void asStringShouldReturnValueWhenNoDomain() {
+        String value = "#private&bob";
+        QuotaRoot quotaRoot = QuotaRoot.quotaRoot(value, Optional.empty());
+
+        assertThat(quotaRoot.asString()).isEqualTo(value);
+    }
+
+    @Test
+    void asStringShouldReturnValueWithDomainWhenHasDomain() {
+        String value = "#private&bob";
+        Domain domain = Domain.of("apache.org");
+        QuotaRoot quotaRoot = QuotaRoot.quotaRoot(value, Optional.of(domain));
+
+        String expectedValue = "#private&bob@apache.org";
+
+        assertThat(quotaRoot.asString()).isEqualTo(expectedValue);
+    }
 }
\ No newline at end of file


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