X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=main%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fmain%2Fstartstop%2FTestPapActivator.java;fp=main%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fmain%2Fstartstop%2FTestPapActivator.java;h=a49f3c588b508e90a85201393349cc0a0e964b21;hb=42c18ef1c6506e63151b55a96d90362da9fbda63;hp=04ef2b662659e4083f42b00e609e0e61c37f3e76;hpb=eb4cf2ad5d004cbfda90a752d10fbc6e91ef8fb4;p=policy%2Fpap.git diff --git a/main/src/test/java/org/onap/policy/pap/main/startstop/TestPapActivator.java b/main/src/test/java/org/onap/policy/pap/main/startstop/TestPapActivator.java index 04ef2b66..a49f3c58 100644 --- a/main/src/test/java/org/onap/policy/pap/main/startstop/TestPapActivator.java +++ b/main/src/test/java/org/onap/policy/pap/main/startstop/TestPapActivator.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019, 2022 Nordix Foundation. + * Copyright (C) 2019, 2022-2023 Nordix Foundation. * Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. * Modifications Copyright (C) 2021-2023 Bell Canada. All rights reserved. * ================================================================================ @@ -23,21 +23,21 @@ package org.onap.policy.pap.main.startstop; import static org.assertj.core.api.Assertions.assertThatIllegalStateException; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import io.micrometer.core.instrument.simple.SimpleMeterRegistry; import java.io.File; import java.io.FileOutputStream; import java.nio.charset.StandardCharsets; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager; import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance; import org.onap.policy.common.utils.network.NetworkUtil; @@ -63,8 +63,9 @@ public class TestPapActivator { /** * Allocates a new DB name, server port, and creates a config file. */ - @BeforeClass + @BeforeAll public static void setUpBeforeClass() { + Registry.newRegistry(); CommonTestData.newDb(); } @@ -73,7 +74,7 @@ public class TestPapActivator { * * @throws Exception if an error occurs */ - @Before + @BeforeEach public void setUp() throws Exception { Registry.newRegistry(); TopicEndpointManager.getManager().shutdown(); @@ -102,20 +103,20 @@ public class TestPapActivator { * * @throws Exception if an error occurs */ - @After + @AfterEach public void teardown() throws Exception { if (activator != null && activator.isAlive()) { activator.stop(); } } - @AfterClass + @AfterAll public static void afterClass() { Registry.newRegistry(); } @Test - public void testPapActivator() { + void testPapActivator() { assertFalse(activator.isAlive()); activator.start(); assertTrue(activator.isAlive()); @@ -133,7 +134,7 @@ public class TestPapActivator { } @Test - public void testTerminate() { + void testTerminate() { activator.start(); activator.stop(); assertFalse(activator.isAlive());