MAILBOX-333 Add a test for subject rendering

Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/5ee21fec
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/5ee21fec
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/5ee21fec

Branch: refs/heads/master
Commit: 5ee21fec00d5e9f2f2372e3b1f04330671137e8a
Parents: 08e7d4b
Author: benwa <btell...@linagora.com>
Authored: Wed May 9 10:33:25 2018 +0700
Committer: benwa <btell...@linagora.com>
Committed: Thu May 10 09:24:28 2018 +0700

----------------------------------------------------------------------
 .../subscribers/QuotaThresholdNoticeTest.java        | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/5ee21fec/mailbox/plugin/quota-mailing/src/test/java/org/apache/james/mailbox/quota/mailing/subscribers/QuotaThresholdNoticeTest.java
----------------------------------------------------------------------
diff --git 
a/mailbox/plugin/quota-mailing/src/test/java/org/apache/james/mailbox/quota/mailing/subscribers/QuotaThresholdNoticeTest.java
 
b/mailbox/plugin/quota-mailing/src/test/java/org/apache/james/mailbox/quota/mailing/subscribers/QuotaThresholdNoticeTest.java
index 20ccaaa..e47adc2 100644
--- 
a/mailbox/plugin/quota-mailing/src/test/java/org/apache/james/mailbox/quota/mailing/subscribers/QuotaThresholdNoticeTest.java
+++ 
b/mailbox/plugin/quota-mailing/src/test/java/org/apache/james/mailbox/quota/mailing/subscribers/QuotaThresholdNoticeTest.java
@@ -242,4 +242,19 @@ class QuotaThresholdNoticeTest {
                 "You need to be aware that actions leading to exceeded quotas 
will be denied. This will result in a degraded service.\n" +
                 "To mitigate this issue you might reach your administrator in 
order to increase your configured quota. You might also delete some non 
important emails.");
     }
+
+    @Test
+    void generateSubjectShouldRenderMustacheTemplate() throws Exception {
+        QuotaThresholdChange countThresholdChange = new 
QuotaThresholdChange(_80, NOW);
+
+        assertThat(QuotaThresholdNotice.builder()
+            .withConfiguration(DEFAULT_CONFIGURATION)
+            .sizeQuota(Sizes._82_PERCENT)
+            .countQuota(Counts._UNLIMITED)
+            
.countThreshold(HistoryEvolution.higherThresholdReached(countThresholdChange, 
NotAlreadyReachedDuringGracePeriod))
+            .build()
+            .get()
+            .generateSubject(fileSystem))
+            .isEqualTo("Warning: Your email usage just exceeded a configured 
threshold");
+    }
 }
\ No newline at end of file


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

Reply via email to