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 bt...@apache.org on 2019/03/04 11:43:45 UTC
[james-project] 11/16: JAMES-2664 JUNIT 5 for mailbox-guice MVN
module
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 0f52ddd0b935d58efc18f10aae86426f303ac9d9
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon Mar 4 10:47:12 2019 +0700
JAMES-2664 JUNIT 5 for mailbox-guice MVN module
---
server/container/guice/mailbox/pom.xml | 4 ++--
.../modules/mailbox/ListenerConfigurationTest.java | 16 +++++++--------
.../mailbox/MailboxListenersLoaderImplTest.java | 24 +++++++++++-----------
3 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/server/container/guice/mailbox/pom.xml b/server/container/guice/mailbox/pom.xml
index 145b0c7..04ef31d 100644
--- a/server/container/guice/mailbox/pom.xml
+++ b/server/container/guice/mailbox/pom.xml
@@ -61,8 +61,8 @@
<artifactId>guice-multibindings</artifactId>
</dependency>
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/server/container/guice/mailbox/src/test/java/org/apache/james/modules/mailbox/ListenerConfigurationTest.java b/server/container/guice/mailbox/src/test/java/org/apache/james/modules/mailbox/ListenerConfigurationTest.java
index 5184717..c766053 100644
--- a/server/container/guice/mailbox/src/test/java/org/apache/james/modules/mailbox/ListenerConfigurationTest.java
+++ b/server/container/guice/mailbox/src/test/java/org/apache/james/modules/mailbox/ListenerConfigurationTest.java
@@ -22,12 +22,12 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import org.apache.commons.configuration.DefaultConfigurationBuilder;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class ListenerConfigurationTest {
+class ListenerConfigurationTest {
@Test
- public void fromShouldThrowWhenClassIsNotInTheConfiguration() {
+ void fromShouldThrowWhenClassIsNotInTheConfiguration() {
DefaultConfigurationBuilder configuration = new DefaultConfigurationBuilder();
assertThatThrownBy(() -> ListenerConfiguration.from(configuration))
@@ -35,7 +35,7 @@ public class ListenerConfigurationTest {
}
@Test
- public void fromShouldThrowWhenClassIsEmpty() {
+ void fromShouldThrowWhenClassIsEmpty() {
DefaultConfigurationBuilder configuration = new DefaultConfigurationBuilder();
configuration.addProperty("class", "");
@@ -44,7 +44,7 @@ public class ListenerConfigurationTest {
}
@Test
- public void getClazzShouldReturnTheClassNameFromTheConfiguration() {
+ void getClazzShouldReturnTheClassNameFromTheConfiguration() {
DefaultConfigurationBuilder configuration = new DefaultConfigurationBuilder();
String expectedClazz = "MyClassName";
configuration.addProperty("class", expectedClazz);
@@ -55,7 +55,7 @@ public class ListenerConfigurationTest {
}
@Test
- public void isAsyncShouldReturnConfiguredValue() {
+ void isAsyncShouldReturnConfiguredValue() {
DefaultConfigurationBuilder configuration = new DefaultConfigurationBuilder();
configuration.addProperty("class", "MyClassName");
configuration.addProperty("async", "false");
@@ -66,7 +66,7 @@ public class ListenerConfigurationTest {
}
@Test
- public void getGroupShouldBeEmptyByDefault() {
+ void getGroupShouldBeEmptyByDefault() {
DefaultConfigurationBuilder configuration = new DefaultConfigurationBuilder();
configuration.addProperty("class", "MyClassName");
@@ -76,7 +76,7 @@ public class ListenerConfigurationTest {
}
@Test
- public void getGroupShouldContainsConfiguredValue() {
+ void getGroupShouldContainsConfiguredValue() {
String groupName = "Avengers";
DefaultConfigurationBuilder configuration = new DefaultConfigurationBuilder();
configuration.addProperty("class", "MyClassName");
diff --git a/server/container/guice/mailbox/src/test/java/org/apache/james/modules/mailbox/MailboxListenersLoaderImplTest.java b/server/container/guice/mailbox/src/test/java/org/apache/james/modules/mailbox/MailboxListenersLoaderImplTest.java
index 58ce295..722b603 100644
--- a/server/container/guice/mailbox/src/test/java/org/apache/james/modules/mailbox/MailboxListenersLoaderImplTest.java
+++ b/server/container/guice/mailbox/src/test/java/org/apache/james/modules/mailbox/MailboxListenersLoaderImplTest.java
@@ -39,19 +39,19 @@ import org.apache.james.mailbox.events.MailboxListener;
import org.apache.james.mailbox.events.delivery.InVmEventDelivery;
import org.apache.james.metrics.api.NoopMetricFactory;
import org.apache.james.utils.ExtendedClassLoader;
-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.ImmutableSet;
import com.google.inject.Guice;
-public class MailboxListenersLoaderImplTest {
+class MailboxListenersLoaderImplTest {
private InVMEventBus eventBus;
private MailboxListenersLoaderImpl testee;
- @Before
- public void setup() throws Exception {
+ @BeforeEach
+ void setup() throws Exception {
FileSystem fileSystem = mock(FileSystem.class);
when(fileSystem.getFile(anyString()))
.thenThrow(new FileNotFoundException());
@@ -62,7 +62,7 @@ public class MailboxListenersLoaderImplTest {
}
@Test
- public void createListenerShouldThrowWhenClassCantBeLoaded() {
+ void createListenerShouldThrowWhenClassCantBeLoaded() {
ListenerConfiguration configuration = ListenerConfiguration.forClass("MyUnknownClass");
assertThatThrownBy(() -> testee.createListener(configuration))
@@ -70,7 +70,7 @@ public class MailboxListenersLoaderImplTest {
}
@Test
- public void createListenerShouldThrowWhenClassCantBeCastToMailboxListener() {
+ void createListenerShouldThrowWhenClassCantBeCastToMailboxListener() {
ListenerConfiguration configuration = ListenerConfiguration.forClass("java.lang.String");
assertThatThrownBy(() -> testee.createListener(configuration))
@@ -78,7 +78,7 @@ public class MailboxListenersLoaderImplTest {
}
@Test
- public void createListenerShouldThrowWhenNotFullClassName() {
+ void createListenerShouldThrowWhenNotFullClassName() {
ListenerConfiguration configuration = ListenerConfiguration.forClass("NoopMailboxListener");
assertThatThrownBy(() -> testee.createListener(configuration))
@@ -86,7 +86,7 @@ public class MailboxListenersLoaderImplTest {
}
@Test
- public void createListenerShouldReturnMailboxListenerWhenConfigurationIsGood() {
+ void createListenerShouldReturnMailboxListenerWhenConfigurationIsGood() {
ListenerConfiguration configuration = ListenerConfiguration.forClass("org.apache.james.modules.mailbox.NoopMailboxListener");
Pair<Group, MailboxListener> listener = testee.createListener(configuration);
@@ -95,7 +95,7 @@ public class MailboxListenersLoaderImplTest {
}
@Test
- public void configureShouldAddMailboxListenersWhenConfigurationIsGood() throws ConfigurationException {
+ void configureShouldAddMailboxListenersWhenConfigurationIsGood() throws ConfigurationException {
DefaultConfigurationBuilder configuration = toConfigutation("<listeners>" +
"<listener>" +
"<class>org.apache.james.modules.mailbox.NoopMailboxListener</class>" +
@@ -108,7 +108,7 @@ public class MailboxListenersLoaderImplTest {
}
@Test
- public void customGroupCanBePassed() throws ConfigurationException {
+ void customGroupCanBePassed() throws ConfigurationException {
DefaultConfigurationBuilder configuration = toConfigutation("<listeners>" +
"<listener>" +
"<class>org.apache.james.modules.mailbox.NoopMailboxListener</class>" +
@@ -122,7 +122,7 @@ public class MailboxListenersLoaderImplTest {
}
@Test
- public void aListenerCanBeRegisteredOnSeveralGroups() throws ConfigurationException {
+ void aListenerCanBeRegisteredOnSeveralGroups() throws ConfigurationException {
DefaultConfigurationBuilder configuration = toConfigutation("<listeners>" +
"<listener>" +
"<class>org.apache.james.modules.mailbox.NoopMailboxListener</class>" +
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org