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 90fd15454d028a59f15b9b798e36b1fca7967167
Author: Rene Cordier <rcord...@linagora.com>
AuthorDate: Thu Dec 5 16:48:52 2019 +0700

    [Refactoring] Move ListeningCurrentQuotaUpdaterTest to JUnit 5
---
 .../quota/ListeningCurrentQuotaUpdaterTest.java    | 40 +++++++++++-----------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git 
a/mailbox/store/src/test/java/org/apache/james/mailbox/store/quota/ListeningCurrentQuotaUpdaterTest.java
 
b/mailbox/store/src/test/java/org/apache/james/mailbox/store/quota/ListeningCurrentQuotaUpdaterTest.java
index 3dff2d7..ccfcc9d 100644
--- 
a/mailbox/store/src/test/java/org/apache/james/mailbox/store/quota/ListeningCurrentQuotaUpdaterTest.java
+++ 
b/mailbox/store/src/test/java/org/apache/james/mailbox/store/quota/ListeningCurrentQuotaUpdaterTest.java
@@ -50,27 +50,27 @@ import org.apache.james.mailbox.model.TestId;
 import org.apache.james.mailbox.quota.QuotaManager;
 import org.apache.james.mailbox.quota.QuotaRootResolver;
 import org.apache.james.mailbox.store.mail.model.DefaultMessageId;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import com.google.common.collect.Lists;
 
 import reactor.core.publisher.Mono;
 
-public class ListeningCurrentQuotaUpdaterTest {
+class ListeningCurrentQuotaUpdaterTest {
 
-    private static final int SIZE = 45;
-    private static final MailboxId MAILBOX_ID = TestId.of(42);
-    private static final String BENWA = "benwa";
-    private static final Username USERNAME_BENWA = Username.of(BENWA);
-    private static final QuotaRoot QUOTA_ROOT = QuotaRoot.quotaRoot(BENWA, 
Optional.empty());
+    static final int SIZE = 45;
+    static final MailboxId MAILBOX_ID = TestId.of(42);
+    static final String BENWA = "benwa";
+    static final Username USERNAME_BENWA = Username.of(BENWA);
+    static final QuotaRoot QUOTA_ROOT = QuotaRoot.quotaRoot(BENWA, 
Optional.empty());
 
-    private StoreCurrentQuotaManager mockedCurrentQuotaManager;
-    private QuotaRootResolver mockedQuotaRootResolver;
-    private ListeningCurrentQuotaUpdater testee;
+    StoreCurrentQuotaManager mockedCurrentQuotaManager;
+    QuotaRootResolver mockedQuotaRootResolver;
+    ListeningCurrentQuotaUpdater testee;
 
-    @Before
-    public void setUp() throws Exception {
+    @BeforeEach
+    void setUp() {
         mockedQuotaRootResolver = mock(QuotaRootResolver.class);
         mockedCurrentQuotaManager = mock(StoreCurrentQuotaManager.class);
         EventBus eventBus = mock(EventBus.class);
@@ -80,13 +80,13 @@ public class ListeningCurrentQuotaUpdaterTest {
     }
 
     @Test
-    public void deserializeListeningCurrentQuotaUpdaterGroup() throws 
Exception {
+    void deserializeListeningCurrentQuotaUpdaterGroup() throws Exception {
         
assertThat(Group.deserialize("org.apache.james.mailbox.store.quota.ListeningCurrentQuotaUpdater$ListeningCurrentQuotaUpdaterGroup"))
             .isEqualTo(new 
ListeningCurrentQuotaUpdater.ListeningCurrentQuotaUpdaterGroup());
     }
 
     @Test
-    public void addedEventShouldIncreaseCurrentQuotaValues() throws Exception {
+    void addedEventShouldIncreaseCurrentQuotaValues() throws Exception {
         MailboxListener.Added added = mock(MailboxListener.Added.class);
         when(added.getMailboxId()).thenReturn(MAILBOX_ID);
         when(added.getMetaData(MessageUid.of(36))).thenReturn(new 
MessageMetaData(MessageUid.of(36), ModSeq.first(),new Flags(), SIZE, new 
Date(), new DefaultMessageId()));
@@ -101,7 +101,7 @@ public class ListeningCurrentQuotaUpdaterTest {
     }
 
     @Test
-    public void expungedEventShouldDecreaseCurrentQuotaValues() throws 
Exception {
+    void expungedEventShouldDecreaseCurrentQuotaValues() throws Exception {
         MailboxListener.Expunged expunged = 
mock(MailboxListener.Expunged.class);
         when(expunged.getMetaData(MessageUid.of(36))).thenReturn(new 
MessageMetaData(MessageUid.of(36), ModSeq.first(), new Flags(), SIZE, new 
Date(), new DefaultMessageId()));
         when(expunged.getMetaData(MessageUid.of(38))).thenReturn(new 
MessageMetaData(MessageUid.of(38), ModSeq.first(), new Flags(), SIZE, new 
Date(), new DefaultMessageId()));
@@ -116,7 +116,7 @@ public class ListeningCurrentQuotaUpdaterTest {
     }
     
     @Test
-    public void emptyExpungedEventShouldNotTriggerDecrease() throws Exception {
+    void emptyExpungedEventShouldNotTriggerDecrease() throws Exception {
         MailboxListener.Expunged expunged = 
mock(MailboxListener.Expunged.class);
         when(expunged.getUids()).thenReturn(Lists.<MessageUid>newArrayList());
         when(expunged.getMailboxId()).thenReturn(MAILBOX_ID);
@@ -129,7 +129,7 @@ public class ListeningCurrentQuotaUpdaterTest {
     }
 
     @Test
-    public void emptyAddedEventShouldNotTriggerDecrease() throws Exception {
+    void emptyAddedEventShouldNotTriggerDecrease() throws Exception {
         MailboxListener.Added added = mock(MailboxListener.Added.class);
         when(added.getUids()).thenReturn(Lists.<MessageUid>newArrayList());
         when(added.getMailboxId()).thenReturn(MAILBOX_ID);
@@ -142,7 +142,7 @@ public class ListeningCurrentQuotaUpdaterTest {
     }
 
     @Test
-    public void mailboxDeletionEventShouldDecreaseCurrentQuotaValues() throws 
Exception {
+    void mailboxDeletionEventShouldDecreaseCurrentQuotaValues() throws 
Exception {
         MailboxListener.MailboxDeletion deletion = 
mock(MailboxListener.MailboxDeletion.class);
         when(deletion.getQuotaRoot()).thenReturn(QUOTA_ROOT);
         
when(deletion.getDeletedMessageCount()).thenReturn(QuotaCountUsage.count(10));
@@ -157,7 +157,7 @@ public class ListeningCurrentQuotaUpdaterTest {
     }
 
     @Test
-    public void mailboxDeletionEventShouldDoNothingWhenEmptyMailbox() throws 
Exception {
+    void mailboxDeletionEventShouldDoNothingWhenEmptyMailbox() throws 
Exception {
         MailboxListener.MailboxDeletion deletion = 
mock(MailboxListener.MailboxDeletion.class);
         when(deletion.getQuotaRoot()).thenReturn(QUOTA_ROOT);
         
when(deletion.getDeletedMessageCount()).thenReturn(QuotaCountUsage.count(0));


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