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 rc...@apache.org on 2019/12/09 03:10:07 UTC
[james-project] 42/42: [Refactoring] Move
SystemMailboxesProviderImplTest to JUnit 5
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 8ae9166e1e944d23b359dda5b81d054dd96f3af0
Author: Rene Cordier <rc...@linagora.com>
AuthorDate: Thu Dec 5 17:22:29 2019 +0700
[Refactoring] Move SystemMailboxesProviderImplTest to JUnit 5
---
.../store/SystemMailboxesProviderImplTest.java | 27 +++++++++-------------
1 file changed, 11 insertions(+), 16 deletions(-)
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/SystemMailboxesProviderImplTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/SystemMailboxesProviderImplTest.java
index c83f1b1..48b16f6 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/SystemMailboxesProviderImplTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/SystemMailboxesProviderImplTest.java
@@ -31,25 +31,20 @@ import org.apache.james.mailbox.MessageManager;
import org.apache.james.mailbox.Role;
import org.apache.james.mailbox.exception.MailboxNotFoundException;
import org.apache.james.mailbox.fixture.MailboxFixture;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
-public class SystemMailboxesProviderImplTest {
+class SystemMailboxesProviderImplTest {
- private MailboxSession mailboxSession = MailboxSessionUtil.create(MailboxFixture.ALICE);
- private SystemMailboxesProviderImpl systemMailboxProvider;
+ MailboxSession mailboxSession = MailboxSessionUtil.create(MailboxFixture.ALICE);
+ SystemMailboxesProviderImpl systemMailboxProvider;
- private MailboxManager mailboxManager;
+ MailboxManager mailboxManager;
- private MessageManager inboxMessageManager;
+ MessageManager inboxMessageManager;
- @Rule
- public ExpectedException expectedException = ExpectedException.none();
-
- @Before
- public void setUp() throws Exception {
+ @BeforeEach
+ void setUp() {
mailboxManager = mock(MailboxManager.class);
inboxMessageManager = mock(MessageManager.class);
@@ -57,7 +52,7 @@ public class SystemMailboxesProviderImplTest {
}
@Test
- public void getMailboxByRoleShouldReturnEmptyWhenNoMailbox() throws Exception {
+ void getMailboxByRoleShouldReturnEmptyWhenNoMailbox() throws Exception {
when(mailboxManager.createSystemSession(MailboxFixture.ALICE)).thenReturn(mailboxSession);
when(mailboxManager.getMailbox(eq(MailboxFixture.INBOX_ALICE), eq(mailboxSession))).thenThrow(MailboxNotFoundException.class);
@@ -65,7 +60,7 @@ public class SystemMailboxesProviderImplTest {
}
@Test
- public void getMailboxByRoleShouldReturnMailboxByRole() throws Exception {
+ void getMailboxByRoleShouldReturnMailboxByRole() throws Exception {
when(mailboxManager.createSystemSession(MailboxFixture.ALICE)).thenReturn(mailboxSession);
when(mailboxManager.getMailbox(eq(MailboxFixture.INBOX_ALICE), eq(mailboxSession))).thenReturn(inboxMessageManager);
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org