Convert clamp-common unit tests to JUnit 5 13/122413/2
authorliamfallon <liam.fallon@est.tech>
Fri, 2 Jul 2021 10:08:47 +0000 (11:08 +0100)
committerliamfallon <liam.fallon@est.tech>
Fri, 2 Jul 2021 10:15:22 +0000 (11:15 +0100)
JUnit 4 tests do not fire when JUnit 5 is activated.

Issue-ID: POLICY-3452
Change-Id: I82396f918c69d9c27d0a00fa0e97b3e6b138e951
Signed-off-by: liamfallon <liam.fallon@est.tech>
common/src/test/java/org/onap/policy/clamp/controlloop/common/exception/ExceptionsTest.java
common/src/test/java/org/onap/policy/clamp/controlloop/common/handler/ControlLoopHandlerTest.java
common/src/test/java/org/onap/policy/clamp/controlloop/common/startstop/CommonCommandLineArgumentsTest.java

index 3c16885..6d39337 100644 (file)
@@ -27,16 +27,16 @@ import static org.junit.Assert.assertNotNull;
 import java.io.IOException;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.errors.concepts.ErrorResponse;
 
-public class ExceptionsTest {
+class ExceptionsTest {
 
     private static final String STRING_TEXT = "String";
     private static final String MESSAGE = "Message";
 
     @Test
-    public void testExceptions() {
+    void testExceptions() {
         assertNotNull(new ControlLoopException(Response.Status.OK, MESSAGE));
         assertNotNull(new ControlLoopException(Response.Status.OK, MESSAGE, STRING_TEXT));
         assertNotNull(new ControlLoopException(Response.Status.OK, MESSAGE, new IOException()));
index 845bc8d..7a0479d 100644 (file)
@@ -24,14 +24,14 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.utils.services.Registry;
 import org.onap.policy.models.provider.PolicyModelsProviderParameters;
 
-public class ControlLoopHandlerTest {
+class ControlLoopHandlerTest {
 
     @Test
-    public void testControlLoopHandler() {
+    void testControlLoopHandler() {
         assertThatThrownBy(() -> new DummyControlLoopHandler(null)).isInstanceOf(NullPointerException.class);
 
         assertNotNull(new DummyControlLoopHandler(new PolicyModelsProviderParameters()));
index 2d30592..715232f 100644 (file)
@@ -28,7 +28,7 @@ import org.apache.commons.cli.Options;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
 
-public class CommonCommandLineArgumentsTest {
+class CommonCommandLineArgumentsTest {
 
     public static CommonCommandLineArguments cli;