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 42fdad9ab8b465f9e48ce1bb2569b330dba48299
Author: Rene Cordier <rcord...@linagora.com>
AuthorDate: Thu Dec 5 16:49:38 2019 +0700

    [Refactoring] Move QuotaCheckerTest to JUnit 5
---
 .../mailbox/store/quota/QuotaCheckerTest.java      | 30 +++++++++++-----------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git 
a/mailbox/store/src/test/java/org/apache/james/mailbox/store/quota/QuotaCheckerTest.java
 
b/mailbox/store/src/test/java/org/apache/james/mailbox/store/quota/QuotaCheckerTest.java
index 5473b66..c2b14f3 100644
--- 
a/mailbox/store/src/test/java/org/apache/james/mailbox/store/quota/QuotaCheckerTest.java
+++ 
b/mailbox/store/src/test/java/org/apache/james/mailbox/store/quota/QuotaCheckerTest.java
@@ -38,26 +38,26 @@ import org.apache.james.mailbox.model.Quota;
 import org.apache.james.mailbox.model.QuotaRoot;
 import org.apache.james.mailbox.quota.QuotaManager;
 import org.apache.james.mailbox.quota.QuotaRootResolver;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
-public class QuotaCheckerTest {
+class QuotaCheckerTest {
 
-    public static final QuotaRoot QUOTA_ROOT = QuotaRoot.quotaRoot("benwa", 
Optional.empty());
-    public static final MailboxPath MAILBOX_PATH = 
MailboxPath.inbox(Username.of("benwa"));
-    public static final Mailbox MAILBOX = new Mailbox(MAILBOX_PATH, 10);
+    static final QuotaRoot QUOTA_ROOT = QuotaRoot.quotaRoot("benwa", 
Optional.empty());
+    static final MailboxPath MAILBOX_PATH = 
MailboxPath.inbox(Username.of("benwa"));
+    static final Mailbox MAILBOX = new Mailbox(MAILBOX_PATH, 10);
 
-    private QuotaRootResolver mockedQuotaRootResolver;
-    private QuotaManager mockedQuotaManager;
+    QuotaRootResolver mockedQuotaRootResolver;
+    QuotaManager mockedQuotaManager;
 
-    @Before
-    public void setUp() {
+    @BeforeEach
+    void setUp() {
         mockedQuotaManager = mock(QuotaManager.class);
         mockedQuotaRootResolver = mock(QuotaRootResolver.class);
     }
 
     @Test
-    public void quotaCheckerShouldNotThrowOnRegularQuotas() throws 
MailboxException {
+    void quotaCheckerShouldNotThrowOnRegularQuotas() throws MailboxException {
         
when(mockedQuotaRootResolver.getQuotaRoot(MAILBOX_PATH)).thenReturn(QUOTA_ROOT);
         when(mockedQuotaManager.getMessageQuota(QUOTA_ROOT)).thenReturn(
             Quota.<QuotaCountLimit, 
QuotaCountUsage>builder().used(QuotaCountUsage.count(10)).computedLimit(QuotaCountLimit.count(100)).build());
@@ -69,7 +69,7 @@ public class QuotaCheckerTest {
     }
 
     @Test
-    public void quotaCheckerShouldNotThrowOnRegularModifiedQuotas() throws 
MailboxException {
+    void quotaCheckerShouldNotThrowOnRegularModifiedQuotas() throws 
MailboxException {
         
when(mockedQuotaRootResolver.getQuotaRoot(MAILBOX_PATH)).thenReturn(QUOTA_ROOT);
         when(mockedQuotaManager.getMessageQuota(QUOTA_ROOT)).thenReturn(
             Quota.<QuotaCountLimit, 
QuotaCountUsage>builder().used(QuotaCountUsage.count(10)).computedLimit(QuotaCountLimit.count(100)).build());
@@ -81,7 +81,7 @@ public class QuotaCheckerTest {
     }
 
     @Test
-    public void quotaCheckerShouldNotThrowOnReachedMaximumQuotas() throws 
MailboxException {
+    void quotaCheckerShouldNotThrowOnReachedMaximumQuotas() throws 
MailboxException {
         
when(mockedQuotaRootResolver.getQuotaRoot(MAILBOX_PATH)).thenReturn(QUOTA_ROOT);
         when(mockedQuotaManager.getMessageQuota(QUOTA_ROOT)).thenReturn(
             Quota.<QuotaCountLimit, 
QuotaCountUsage>builder().used(QuotaCountUsage.count(10)).computedLimit(QuotaCountLimit.count(100)).build());
@@ -93,7 +93,7 @@ public class QuotaCheckerTest {
     }
 
     @Test
-    public void quotaCheckerShouldThrowOnExceededMessages() throws 
MailboxException {
+    void quotaCheckerShouldThrowOnExceededMessages() throws MailboxException {
         
when(mockedQuotaRootResolver.getQuotaRoot(MAILBOX_PATH)).thenReturn(QUOTA_ROOT);
         when(mockedQuotaManager.getMessageQuota(QUOTA_ROOT)).thenReturn(
             Quota.<QuotaCountLimit, 
QuotaCountUsage>builder().used(QuotaCountUsage.count(10)).computedLimit(QuotaCountLimit.count(100)).build());
@@ -106,7 +106,7 @@ public class QuotaCheckerTest {
     }
 
     @Test
-    public void quotaCheckerShouldThrowOnExceededStorage() throws 
MailboxException {
+    void quotaCheckerShouldThrowOnExceededStorage() throws MailboxException {
         
when(mockedQuotaRootResolver.getQuotaRoot(MAILBOX_PATH)).thenReturn(QUOTA_ROOT);
         when(mockedQuotaManager.getMessageQuota(QUOTA_ROOT)).thenReturn(
             Quota.<QuotaCountLimit, 
QuotaCountUsage>builder().used(QuotaCountUsage.count(10)).computedLimit(QuotaCountLimit.count(100)).build());


---------------------------------------------------------------------
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