You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2021/02/09 04:30:00 UTC

[james-project] 32/33: [REFACTORING] Convert AbstractMailQueueFactoryTest tests to JUNIT 5

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 4871ffb028c1d7e420e07137b37c63ae88f72890
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon Feb 8 11:48:13 2021 +0700

    [REFACTORING] Convert AbstractMailQueueFactoryTest tests to JUNIT 5
---
 .../queue/library/AbstractMailQueueFactoryTest.java      | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/server/queue/queue-jms/src/test/java/org/apache/james/queue/library/AbstractMailQueueFactoryTest.java b/server/queue/queue-jms/src/test/java/org/apache/james/queue/library/AbstractMailQueueFactoryTest.java
index ff6f8fc..521e16e 100644
--- a/server/queue/queue-jms/src/test/java/org/apache/james/queue/library/AbstractMailQueueFactoryTest.java
+++ b/server/queue/queue-jms/src/test/java/org/apache/james/queue/library/AbstractMailQueueFactoryTest.java
@@ -31,8 +31,8 @@ import javax.management.ObjectName;
 
 import org.apache.james.queue.api.MailQueueName;
 import org.apache.james.queue.api.ManageableMailQueue;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public class AbstractMailQueueFactoryTest {
     private static final MailQueueName QUEUE_1 = MailQueueName.of("queue1");
@@ -42,8 +42,8 @@ public class AbstractMailQueueFactoryTest {
     private AbstractMailQueueFactory<?> abstractMailQueueFactory;
     private MBeanServer mBeanServer;
 
-    @Before
-    public void setUp() {
+    @BeforeEach
+    void setUp() {
         mBeanServer = mock(MBeanServer.class);
         abstractMailQueueFactory = new AbstractMailQueueFactory<ManageableMailQueue>() {
             @Override
@@ -55,13 +55,13 @@ public class AbstractMailQueueFactoryTest {
     }
 
     @Test
-    public void destroyShouldRegisterManageableQueues() throws Exception {
+    void destroyShouldRegisterManageableQueues() throws Exception {
         abstractMailQueueFactory.createQueue(QUEUE_1);
         verify(mBeanServer).registerMBean(any(MailQueueManagement.class), eq(new ObjectName(AbstractMailQueueFactory.MBEAN_NAME_QUEUE_PREFIX + QUEUE_1.asString())));
     }
 
     @Test
-    public void destroyShouldUnregisterAllRegisterQueue() throws Exception {
+    void destroyShouldUnregisterAllRegisterQueue() throws Exception {
         abstractMailQueueFactory.createQueue(QUEUE_1);
         abstractMailQueueFactory.createQueue(QUEUE_2);
         abstractMailQueueFactory.createQueue(QUEUE_3);
@@ -72,14 +72,14 @@ public class AbstractMailQueueFactoryTest {
     }
 
     @Test
-    public void unregisterMBeanShouldWork() throws Exception {
+    void unregisterMBeanShouldWork() throws Exception {
         abstractMailQueueFactory.createQueue(QUEUE_1);
         abstractMailQueueFactory.unregisterMBean(AbstractMailQueueFactory.MBEAN_NAME_QUEUE_PREFIX + QUEUE_1.asString());
         verify(mBeanServer).unregisterMBean(eq(new ObjectName(AbstractMailQueueFactory.MBEAN_NAME_QUEUE_PREFIX + QUEUE_1.asString())));
     }
 
     @Test
-    public void destroyShouldNotBeStoppedByExceptions() throws Exception {
+    void destroyShouldNotBeStoppedByExceptions() throws Exception {
         abstractMailQueueFactory.createQueue(QUEUE_1);
         abstractMailQueueFactory.createQueue(QUEUE_2);
         abstractMailQueueFactory.createQueue(QUEUE_3);


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