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:01 UTC

[james-project] 33/33: [REFACTORING] Convert server/app 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 b8e6943778aa1d7887cc326fdf4d74474a6f17cc
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon Feb 8 11:49:54 2021 +0700

    [REFACTORING] Convert server/app tests to JUNIT 5
---
 .../james/app/spring/JamesAppSpringMainTest.java       |  8 +++-----
 .../james/app/spring/JamesSpringContextTest.java       | 18 +++++++++---------
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/server/app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java b/server/app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
index 411e66e..3acc3a5 100644
--- a/server/app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
+++ b/server/app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
@@ -18,13 +18,11 @@
  ****************************************************************/
 package org.apache.james.app.spring;
 
-import org.junit.Test;
-
-public class JamesAppSpringMainTest {
+import org.junit.jupiter.api.Test;
 
+class JamesAppSpringMainTest {
     @Test
-    public void testServer() throws Exception {
+    void testServer() throws Exception {
         JamesAppSpringMain.main(null);
     }
-
 }
diff --git a/server/app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java b/server/app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
index 56fd185..8d2560a 100644
--- a/server/app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
+++ b/server/app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
@@ -26,28 +26,28 @@ import org.apache.james.events.InVMEventBus;
 import org.apache.james.mailbox.lucene.search.LuceneMessageSearchIndex;
 import org.apache.james.mailbox.store.event.MailboxAnnotationListener;
 import org.apache.james.mailbox.store.quota.ListeningCurrentQuotaUpdater;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
-public class JamesSpringContextTest {
+class JamesSpringContextTest {
     private JamesServerApplicationContext context;
 
-    @Before
-    public void setup() {
+    @BeforeEach
+    void setup() {
         context = new JamesServerApplicationContext(new String[] { "META-INF/org/apache/james/spring-server.xml" });
         context.registerShutdownHook();
         context.start();
     }
 
-    @After
-    public void tearDown() {
+    @AfterEach
+    void tearDown() {
         context.stop();
         context.destroy();
     }
 
     @Test
-    public void springShouldLoadAndAddOnlyOneQuotaUpdaterListener() {
+    void springShouldLoadAndAddOnlyOneQuotaUpdaterListener() {
         InVMEventBus eventBus = context.getBean(InVMEventBus.class);
 
         assertThat(eventBus.registeredGroups())


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