From 3ec3c4ab17a52022e04535ddbaf66b6373bb9492 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Fri, 2 Jul 2021 11:08:47 +0100 Subject: Convert clamp-common unit tests to JUnit 5 JUnit 4 tests do not fire when JUnit 5 is activated. Issue-ID: POLICY-3452 Change-Id: I82396f918c69d9c27d0a00fa0e97b3e6b138e951 Signed-off-by: liamfallon --- .../policy/clamp/controlloop/common/exception/ExceptionsTest.java | 6 +++--- .../clamp/controlloop/common/handler/ControlLoopHandlerTest.java | 6 +++--- .../common/startstop/CommonCommandLineArgumentsTest.java | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/src/test/java/org/onap/policy/clamp/controlloop/common/exception/ExceptionsTest.java b/common/src/test/java/org/onap/policy/clamp/controlloop/common/exception/ExceptionsTest.java index 3c1688582..6d39337f7 100644 --- a/common/src/test/java/org/onap/policy/clamp/controlloop/common/exception/ExceptionsTest.java +++ b/common/src/test/java/org/onap/policy/clamp/controlloop/common/exception/ExceptionsTest.java @@ -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())); diff --git a/common/src/test/java/org/onap/policy/clamp/controlloop/common/handler/ControlLoopHandlerTest.java b/common/src/test/java/org/onap/policy/clamp/controlloop/common/handler/ControlLoopHandlerTest.java index 845bc8df0..7a0479d29 100644 --- a/common/src/test/java/org/onap/policy/clamp/controlloop/common/handler/ControlLoopHandlerTest.java +++ b/common/src/test/java/org/onap/policy/clamp/controlloop/common/handler/ControlLoopHandlerTest.java @@ -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())); diff --git a/common/src/test/java/org/onap/policy/clamp/controlloop/common/startstop/CommonCommandLineArgumentsTest.java b/common/src/test/java/org/onap/policy/clamp/controlloop/common/startstop/CommonCommandLineArgumentsTest.java index 2d30592e4..715232f58 100644 --- a/common/src/test/java/org/onap/policy/clamp/controlloop/common/startstop/CommonCommandLineArgumentsTest.java +++ b/common/src/test/java/org/onap/policy/clamp/controlloop/common/startstop/CommonCommandLineArgumentsTest.java @@ -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; -- cgit 1.2.3-korg