Convert clamp-models unit tests to JUnit 5 14/122414/1
authorliamfallon <liam.fallon@est.tech>
Fri, 2 Jul 2021 10:24:51 +0000 (11:24 +0100)
committerliamfallon <liam.fallon@est.tech>
Fri, 2 Jul 2021 10:25:00 +0000 (11:25 +0100)
JUnit 4 tests do not fire when JUnit 5 is activated.

Issue-ID: POLICY-3452
Change-Id: I5efb8ee996b06dc7f57107b8f77408adc1a4f22f
Signed-off-by: liamfallon <liam.fallon@est.tech>
28 files changed:
models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ClElementStatisticsTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoopConceptPojosTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoopElementTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoopTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ParticipantStatisticsTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ParticipantTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaClElementStatisticsTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaControlLoopElementTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaControlLoopTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaParticipantStatisticsTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaParticipantTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/PojosTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ClElementStatisticsProviderTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProviderTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantProviderTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantStatisticsProviderTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/notification/ControlLoopNotificationTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/notification/ControlLoopStatusTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/notification/NotificationPojosTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantControlLoopStateChangeTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantControlLoopUpdateTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantHealthCheckTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantMessageTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantPojosTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantStateChangeTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantStatusTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/rest/MessagesRestPojosTest.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/rest/instantiation/InstantiationCommandTest.java

index 0addc25..3bb0050 100644 (file)
@@ -28,12 +28,12 @@ import static org.junit.Assert.assertNotNull;
 
 import java.time.Instant;
 import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 
-public class ClElementStatisticsTest {
+class ClElementStatisticsTest {
     @Test
-    public void testClElementStatisticsLombok() {
+    void testClElementStatisticsLombok() {
         assertNotNull(new ClElementStatistics());
         ClElementStatistics cles0 = new ClElementStatistics();
 
index 908c914..daade4d 100644 (file)
@@ -31,16 +31,16 @@ import com.openpojo.validation.rule.impl.SetterMustExistRule;
 import com.openpojo.validation.test.impl.GetterTester;
 import com.openpojo.validation.test.impl.SetterTester;
 import java.util.List;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.utils.test.ToStringTester;
 
 /**
  * Class to perform unit tests of all pojos.
  */
-public class ControlLoopConceptPojosTest {
+class ControlLoopConceptPojosTest {
 
     @Test
-    public void testPojos() {
+    void testPojos() {
         List<PojoClass> pojoClasses =
                 PojoClassFactory.getPojoClasses(ControlLoopConceptPojosTest.class.getPackageName());
 
index 2264f6d..9e285a4 100644 (file)
@@ -27,12 +27,12 @@ import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNotNull;
 
 import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 
-public class ControlLoopElementTest {
+class ControlLoopElementTest {
     @Test
-    public void testControlLoopElement() {
+    void testControlLoopElement() {
 
         ControlLoopElement cle0 = new ControlLoopElement();
 
@@ -41,7 +41,7 @@ public class ControlLoopElementTest {
     }
 
     @Test
-    public void testControlLoopElementLombok() {
+    void testControlLoopElementLombok() {
         assertNotNull(new ControlLoopElement());
         ControlLoopElement cle0 = new ControlLoopElement();
 
index c865b76..243d8dc 100644 (file)
@@ -29,13 +29,13 @@ import static org.junit.Assert.assertNull;
 
 import java.util.LinkedHashMap;
 import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.base.PfKey;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 
-public class ControlLoopTest {
+class ControlLoopTest {
     @Test
-    public void testControlLoop() {
+    void testControlLoop() {
         ControlLoop cl0 = new ControlLoop();
         cl0.setDefinition(new ToscaConceptIdentifier("dfName", "1.2.3"));
         assertEquals("dfName", cl0.getType());
@@ -48,7 +48,7 @@ public class ControlLoopTest {
     }
 
     @Test
-    public void testControlLoopLombok() {
+    void testControlLoopLombok() {
         assertNotNull(new ControlLoop());
         ControlLoop cl0 = new ControlLoop();
         cl0.setElements(new LinkedHashMap<>());
index 54eaca0..f55f624 100644 (file)
@@ -27,12 +27,12 @@ import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNotNull;
 
 import java.time.Instant;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 
-public class ParticipantStatisticsTest {
+class ParticipantStatisticsTest {
     @Test
-    public void testParticipantStatisticsLombok() {
+    void testParticipantStatisticsLombok() {
         assertNotNull(new ParticipantStatistics());
         ParticipantStatistics ps0 = new ParticipantStatistics();
 
index 1eb80db..5c429b9 100644 (file)
@@ -26,12 +26,12 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNotNull;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 
-public class ParticipantTest {
+class ParticipantTest {
     @Test
-    public void testParticipant() {
+    void testParticipant() {
 
         Participant p0 = new Participant();
         p0.setDefinition(new ToscaConceptIdentifier("dfName", "1.2.3"));
@@ -45,7 +45,7 @@ public class ParticipantTest {
     }
 
     @Test
-    public void testParticipantLombok() {
+    void testParticipantLombok() {
         assertNotNull(new Participant());
         Participant p0 = new Participant();
 
index 16c302f..0e6fb83 100644 (file)
@@ -29,7 +29,7 @@ import static org.junit.Assert.assertTrue;
 
 import java.time.Instant;
 import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ClElementStatistics;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopState;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.Participant;
@@ -40,12 +40,12 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 /**
  * Test the {@link JpaClElementStatistics} class.
  */
-public class JpaClElementStatisticsTest {
+class JpaClElementStatisticsTest {
 
     private static final String NULL_KEY_ERROR = "key is marked .*ull but is null";
 
     @Test
-    public void testJpaClElementStatisticsConstructor() {
+    void testJpaClElementStatisticsConstructor() {
         assertThatThrownBy(() -> {
             new JpaClElementStatistics((JpaClElementStatistics) null);
         }).hasMessageMatching("copyConcept is marked .*ull but is null");
@@ -72,7 +72,7 @@ public class JpaClElementStatisticsTest {
     }
 
     @Test
-    public void testJpaClElementStatistics() {
+    void testJpaClElementStatistics() {
         JpaClElementStatistics testJpaClElementStatistics = createJpaClElementStatisticsInstance();
 
         ClElementStatistics cles = createClElementStatisticsInstance();
@@ -112,7 +112,7 @@ public class JpaClElementStatisticsTest {
     }
 
     @Test
-    public void testJpaClElementStatisticsValidation() {
+    void testJpaClElementStatisticsValidation() {
         JpaClElementStatistics testJpaClElementStatistics = createJpaClElementStatisticsInstance();
 
         assertThatThrownBy(() -> {
@@ -123,7 +123,7 @@ public class JpaClElementStatisticsTest {
     }
 
     @Test
-    public void testJpaClElementStatisticsCompareTo() {
+    void testJpaClElementStatisticsCompareTo() {
         JpaClElementStatistics testJpaClElementStatistics = createJpaClElementStatisticsInstance();
 
         JpaClElementStatistics otherJpaClElementStatistics = new JpaClElementStatistics(testJpaClElementStatistics);
@@ -141,7 +141,7 @@ public class JpaClElementStatisticsTest {
     }
 
     @Test
-    public void testJpaClElementStatisticsLombok() {
+    void testJpaClElementStatisticsLombok() {
         assertNotNull(new Participant());
         JpaClElementStatistics cles0 = new JpaClElementStatistics();
 
index 032d655..63c5ea3 100644 (file)
@@ -30,7 +30,7 @@ import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopElement;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopOrderedState;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopState;
@@ -45,12 +45,12 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 /**
  * Test the {@link JpaControlLoopElement} class.
  */
-public class JpaControlLoopElementTest {
+class JpaControlLoopElementTest {
 
     private static final String NULL_KEY_ERROR = "key is marked .*ull but is null";
 
     @Test
-    public void testJpaControlLoopElementConstructor() {
+    void testJpaControlLoopElementConstructor() {
         assertThatThrownBy(() -> {
             new JpaControlLoopElement((JpaControlLoopElement) null);
         }).hasMessageMatching("copyConcept is marked .*ull but is null");
@@ -130,7 +130,7 @@ public class JpaControlLoopElementTest {
     }
 
     @Test
-    public void testJpaControlLoopElement() {
+    void testJpaControlLoopElement() {
         JpaControlLoopElement testJpaControlLoopElement = createJpaControlLoopElementInstance();
 
         ControlLoopElement cle = createControlLoopElementInstance();
@@ -174,7 +174,7 @@ public class JpaControlLoopElementTest {
     }
 
     @Test
-    public void testJpaControlLoopElementOrderedState() throws CoderException {
+    void testJpaControlLoopElementOrderedState() throws CoderException {
         ControlLoopElement testControlLoopElement = createControlLoopElementInstance();
         JpaControlLoopElement testJpaControlLoopElement = createJpaControlLoopElementInstance();
 
@@ -193,7 +193,7 @@ public class JpaControlLoopElementTest {
     }
 
     @Test
-    public void testJpaControlLoopElementValidation() {
+    void testJpaControlLoopElementValidation() {
         JpaControlLoopElement testJpaControlLoopElement = createJpaControlLoopElementInstance();
 
         assertThatThrownBy(() -> {
@@ -204,7 +204,7 @@ public class JpaControlLoopElementTest {
     }
 
     @Test
-    public void testJpaControlLoopElementCompareTo() {
+    void testJpaControlLoopElementCompareTo() {
         JpaControlLoopElement testJpaControlLoopElement = createJpaControlLoopElementInstance();
 
         JpaControlLoopElement otherJpaControlLoopElement = new JpaControlLoopElement(testJpaControlLoopElement);
@@ -249,7 +249,7 @@ public class JpaControlLoopElementTest {
     }
 
     @Test
-    public void testJpaControlLoopElementLombok() {
+    void testJpaControlLoopElementLombok() {
         assertNotNull(new Participant());
         JpaControlLoopElement cle0 = new JpaControlLoopElement();
 
index 01062b0..ff6cc76 100644 (file)
@@ -31,7 +31,7 @@ import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 import java.util.LinkedHashMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoop;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopOrderedState;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopState;
@@ -44,12 +44,12 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 /**
  * Test the {@link JpaControlLoopTest} class.
  */
-public class JpaControlLoopTest {
+class JpaControlLoopTest {
 
     private static final String NULL_KEY_ERROR = "key is marked .*ull but is null";
 
     @Test
-    public void testJpaControlLoopConstructor() {
+    void testJpaControlLoopConstructor() {
         assertThatThrownBy(() -> {
             new JpaControlLoop((JpaControlLoop) null);
         }).hasMessageMatching("copyConcept is marked .*ull but is null");
@@ -125,7 +125,7 @@ public class JpaControlLoopTest {
     }
 
     @Test
-    public void testJpaControlLoop() {
+    void testJpaControlLoop() {
         JpaControlLoop testJpaControlLoop = createJpaControlLoopInstance();
 
         ControlLoop participant = createControlLoopInstance();
@@ -165,7 +165,7 @@ public class JpaControlLoopTest {
     }
 
     @Test
-    public void testJpaControlLoopElementOrderedState() throws CoderException {
+    void testJpaControlLoopElementOrderedState() throws CoderException {
         ControlLoop testControlLoop = createControlLoopInstance();
         JpaControlLoop testJpaControlLoop = createJpaControlLoopInstance();
 
@@ -195,7 +195,7 @@ public class JpaControlLoopTest {
     }
 
     @Test
-    public void testJpaControlLoopValidation() {
+    void testJpaControlLoopValidation() {
         JpaControlLoop testJpaControlLoop = createJpaControlLoopInstance();
 
         assertThatThrownBy(() -> {
@@ -206,7 +206,7 @@ public class JpaControlLoopTest {
     }
 
     @Test
-    public void testJpaControlLoopCompareTo() {
+    void testJpaControlLoopCompareTo() {
         JpaControlLoop testJpaControlLoop = createJpaControlLoopInstance();
 
         JpaControlLoop otherJpaControlLoop = new JpaControlLoop(testJpaControlLoop);
@@ -244,7 +244,7 @@ public class JpaControlLoopTest {
     }
 
     @Test
-    public void testJpaControlLoopLombok() {
+    void testJpaControlLoopLombok() {
         assertNotNull(new ControlLoop());
         JpaControlLoop cl0 = new JpaControlLoop();
 
index 7eedd24..aff3655 100644 (file)
@@ -28,7 +28,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 import java.time.Instant;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.Participant;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantHealthStatus;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantState;
@@ -41,12 +41,12 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 /**
  * Test the {@link JpaParticipantStatistics} class.
  */
-public class JpaParticipantStatisticsTest {
+class JpaParticipantStatisticsTest {
 
     private static final String NULL_KEY_ERROR = "key is marked .*ull but is null";
 
     @Test
-    public void testJpaParticipantStatisticsConstructor() {
+    void testJpaParticipantStatisticsConstructor() {
         assertThatThrownBy(() -> {
             new JpaParticipantStatistics((JpaParticipantStatistics) null);
         }).hasMessageMatching("copyConcept is marked .*ull but is null");
@@ -73,7 +73,7 @@ public class JpaParticipantStatisticsTest {
     }
 
     @Test
-    public void testJpaParticipantStatistics() {
+    void testJpaParticipantStatistics() {
         JpaParticipantStatistics testJpaParticipantStatistics = createJpaParticipantStatisticsInstance();
 
         ParticipantStatistics cles = createParticipantStatisticsInstance();
@@ -114,7 +114,7 @@ public class JpaParticipantStatisticsTest {
     }
 
     @Test
-    public void testJpaParticipantStatisticsValidation() {
+    void testJpaParticipantStatisticsValidation() {
         JpaParticipantStatistics testJpaParticipantStatistics = createJpaParticipantStatisticsInstance();
 
         assertThatThrownBy(() -> {
@@ -126,7 +126,7 @@ public class JpaParticipantStatisticsTest {
     }
 
     @Test
-    public void testJpaParticipantStatisticsConmpareTo() {
+    void testJpaParticipantStatisticsConmpareTo() {
         JpaParticipantStatistics testJpaParticipantStatistics = createJpaParticipantStatisticsInstance();
 
         JpaParticipantStatistics otherJpaParticipantStatistics =
@@ -145,7 +145,7 @@ public class JpaParticipantStatisticsTest {
     }
 
     @Test
-    public void testJpaParticipantStatisticsLombok() {
+    void testJpaParticipantStatisticsLombok() {
         assertNotNull(new Participant());
         JpaParticipantStatistics ps0 = new JpaParticipantStatistics();
 
index 5c96df6..e2eb515 100644 (file)
@@ -27,7 +27,7 @@ import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.Participant;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantHealthStatus;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantState;
@@ -37,12 +37,12 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 /**
  * Test the {@link JpaParticiant} class.
  */
-public class JpaParticipantTest {
+class JpaParticipantTest {
 
     private static final String NULL_KEY_ERROR = "key is marked .*ull but is null";
 
     @Test
-    public void testJpaParticipantConstructor() {
+    void testJpaParticipantConstructor() {
         assertThatThrownBy(() -> {
             new JpaParticipant((JpaParticipant) null);
         }).hasMessageMatching("copyConcept is marked .*ull but is null");
@@ -118,7 +118,7 @@ public class JpaParticipantTest {
     }
 
     @Test
-    public void testJpaParticipant() {
+    void testJpaParticipant() {
         JpaParticipant testJpaParticipant = createJpaParticipantInstance();
 
         Participant participant = createParticipantInstance();
@@ -158,7 +158,7 @@ public class JpaParticipantTest {
     }
 
     @Test
-    public void testJpaParticipantValidation() {
+    void testJpaParticipantValidation() {
         JpaParticipant testJpaParticipant = createJpaParticipantInstance();
 
         assertThatThrownBy(() -> {
@@ -169,7 +169,7 @@ public class JpaParticipantTest {
     }
 
     @Test
-    public void testJpaParticipantCompareTo() {
+    void testJpaParticipantCompareTo() {
         JpaParticipant testJpaParticipant = createJpaParticipantInstance();
 
         JpaParticipant otherJpaParticipant = new JpaParticipant(testJpaParticipant);
@@ -202,7 +202,7 @@ public class JpaParticipantTest {
     }
 
     @Test
-    public void testJpaParticipantLombok() {
+    void testJpaParticipantLombok() {
         assertNotNull(new Participant());
         JpaParticipant p0 = new JpaParticipant();
 
index 9e21b21..c877f96 100644 (file)
@@ -31,16 +31,16 @@ import com.openpojo.validation.rule.impl.SetterMustExistRule;
 import com.openpojo.validation.test.impl.GetterTester;
 import com.openpojo.validation.test.impl.SetterTester;
 import java.util.List;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.utils.test.ToStringTester;
 
 /**
  * Class to perform unit tests of all pojos.
  */
-public class PojosTest {
+class PojosTest {
 
     @Test
-    public void testPojos() {
+    void testPojos() {
         List<PojoClass> pojoClasses =
                 PojoClassFactory.getPojoClasses(PojosTest.class.getPackageName());
 
index eb6a028..a9ef914 100644 (file)
@@ -27,9 +27,9 @@ import static org.junit.Assert.assertEquals;
 import java.time.Instant;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
-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;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ClElementStatistics;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ClElementStatisticsList;
 import org.onap.policy.common.utils.coder.Coder;
@@ -38,7 +38,7 @@ import org.onap.policy.common.utils.resources.ResourceUtils;
 import org.onap.policy.models.provider.PolicyModelsProviderParameters;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 
-public class ClElementStatisticsProviderTest {
+class ClElementStatisticsProviderTest {
     private static final String LIST_IS_NULL = ".*. is marked .*ull but is null";
     private static final Coder CODER = new StandardCoder();
     private static final String CL_ELEMENT_STATS_JSON = "src/test/resources/providers/TestClElementStatistics.json";
@@ -55,8 +55,8 @@ public class ClElementStatisticsProviderTest {
      *
      * @throws Exception on errors
      */
-    @Before
-    public void beforeSetupDao() throws Exception {
+    @BeforeEach
+    void beforeSetupDao() throws Exception {
 
         parameters = new PolicyModelsProviderParameters();
         parameters.setDatabaseDriver("org.h2.Driver");
@@ -71,13 +71,13 @@ public class ClElementStatisticsProviderTest {
         inputClElementStats = CODER.decode(originalJson, ClElementStatisticsList.class);
     }
 
-    @After
-    public void teardown() {
+    @AfterEach
+    void teardown() {
         clElementStatisticsProvider.close();
     }
 
     @Test
-    public void testClElementStatisticsCreate() throws Exception {
+    void testClElementStatisticsCreate() throws Exception {
         assertThatThrownBy(() -> {
             clElementStatisticsProvider.createClElementStatistics(null);
         }).hasMessageMatching(LIST_IS_NULL);
@@ -91,7 +91,7 @@ public class ClElementStatisticsProviderTest {
     }
 
     @Test
-    public void testGetClElementStatistics() throws Exception {
+    void testGetClElementStatistics() throws Exception {
 
         List<ClElementStatistics> getResponse;
 
index d362c27..8aec568 100644 (file)
@@ -27,9 +27,9 @@ import static org.junit.Assert.assertNull;
 
 import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
-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;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoop;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopOrderedState;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoops;
@@ -40,7 +40,7 @@ import org.onap.policy.models.provider.PolicyModelsProviderParameters;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaTypedEntityFilter;
 
-public class ControlLoopProviderTest {
+class ControlLoopProviderTest {
 
     private static final String LIST_IS_NULL = "controlLoops is marked .*ull but is null";
     private static final Coder CODER = new StandardCoder();
@@ -56,8 +56,8 @@ public class ControlLoopProviderTest {
     private String originalJson = ResourceUtils.getResourceAsString(CONTROL_LOOP_JSON);
     private String updateClJson = ResourceUtils.getResourceAsString(UPDATE_CL_JSON);
 
-    @Before
-    public void beforeSetupDao() throws Exception {
+    @BeforeEach
+    void beforeSetupDao() throws Exception {
 
         parameters = new PolicyModelsProviderParameters();
         parameters.setDatabaseDriver("org.h2.Driver");
@@ -74,13 +74,13 @@ public class ControlLoopProviderTest {
         updateControlLoops = CODER.decode(updateClJson, ControlLoops.class);
     }
 
-    @After
-    public void teardown() {
+    @AfterEach
+    void teardown() {
         controlLoopProvider.close();
     }
 
     @Test
-    public void testControlLoopCreate() throws Exception {
+    void testControlLoopCreate() throws Exception {
         assertThatThrownBy(() -> {
             controlLoopProvider.createControlLoops(null);
         }).hasMessageMatching(LIST_IS_NULL);
@@ -93,7 +93,7 @@ public class ControlLoopProviderTest {
     }
 
     @Test
-    public void testGetControlLoops() throws Exception {
+    void testGetControlLoops() throws Exception {
 
         List<ControlLoop> getResponse;
 
@@ -122,7 +122,7 @@ public class ControlLoopProviderTest {
     }
 
     @Test
-    public void testUpdateControlLoops() throws Exception {
+    void testUpdateControlLoops() throws Exception {
         assertThatThrownBy(() -> {
             controlLoopProvider.updateControlLoops(null);
         }).hasMessageMatching("controlLoops is marked .*ull but is null");
@@ -137,7 +137,7 @@ public class ControlLoopProviderTest {
     }
 
     @Test
-    public void testDeleteControlLoop() throws Exception {
+    void testDeleteControlLoop() throws Exception {
         assertThatThrownBy(() -> {
             controlLoopProvider.deleteControlLoop("Invalid_name", "1.0.1");
         }).hasMessageMatching(".*.failed, control loop does not exist");
index 41c1065..681ca96 100644 (file)
@@ -27,9 +27,9 @@ import static org.junit.Assert.assertEquals;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
-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;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.Participant;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantState;
 import org.onap.policy.common.utils.coder.Coder;
@@ -38,7 +38,7 @@ import org.onap.policy.common.utils.resources.ResourceUtils;
 import org.onap.policy.models.provider.PolicyModelsProviderParameters;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaTypedEntityFilter;
 
-public class ParticipantProviderTest {
+class ParticipantProviderTest {
 
     private static final Coder CODER = new StandardCoder();
     private static final String PARTICIPANT_JSON =
@@ -53,8 +53,8 @@ public class ParticipantProviderTest {
     private Participant updateParticipants;
     private String originalJson = ResourceUtils.getResourceAsString(PARTICIPANT_JSON);
 
-    @Before
-    public void beforeSetupDao() throws Exception {
+    @BeforeEach
+    void beforeSetupDao() throws Exception {
 
         parameters = new PolicyModelsProviderParameters();
         parameters.setDatabaseDriver("org.h2.Driver");
@@ -70,13 +70,13 @@ public class ParticipantProviderTest {
 
     }
 
-    @After
-    public void teardown() {
+    @AfterEach
+    void teardown() {
         participantProvider.close();
     }
 
     @Test
-    public void testParticipantCreate() throws Exception {
+    void testParticipantCreate() throws Exception {
         assertThatThrownBy(() -> {
             participantProvider.createParticipants(null);
         }).hasMessageMatching(LIST_IS_NULL);
@@ -91,7 +91,7 @@ public class ParticipantProviderTest {
 
 
     @Test
-    public void testGetControlLoops() throws Exception {
+    void testGetControlLoops() throws Exception {
 
         List<Participant> getResponse;
 
@@ -117,7 +117,7 @@ public class ParticipantProviderTest {
     }
 
     @Test
-    public void testUpdateParticipant() throws Exception {
+    void testUpdateParticipant() throws Exception {
         assertThatThrownBy(() -> {
             participantProvider.updateParticipants(null);
         }).hasMessageMatching("participants is marked .*ull but is null");
@@ -134,7 +134,7 @@ public class ParticipantProviderTest {
     }
 
     @Test
-    public void testDeleteParticipant() throws Exception {
+    void testDeleteParticipant() throws Exception {
         assertThatThrownBy(() -> {
             participantProvider.deleteParticipant("Invalid_name", "1.0.1");
         }).hasMessageMatching(".*.failed, participant does not exist");
index 0fd3693..8191dd6 100644 (file)
@@ -27,9 +27,9 @@ import static org.junit.Assert.assertEquals;
 import java.time.Instant;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
-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;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantStatistics;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantStatisticsList;
 import org.onap.policy.common.utils.coder.Coder;
@@ -38,7 +38,7 @@ import org.onap.policy.common.utils.resources.ResourceUtils;
 import org.onap.policy.models.provider.PolicyModelsProviderParameters;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 
-public class ParticipantStatisticsProviderTest {
+class ParticipantStatisticsProviderTest {
 
     private static final String LIST_IS_NULL = ".*. is marked .*ull but is null";
     private static final Coder CODER = new StandardCoder();
@@ -51,8 +51,8 @@ public class ParticipantStatisticsProviderTest {
     private ParticipantStatisticsList inputParticipantStatistics;
     private String originalJson = ResourceUtils.getResourceAsString(PARTICIPANT_STATS_JSON);
 
-    @Before
-    public void beforeSetupDao() throws Exception {
+    @BeforeEach
+    void beforeSetupDao() throws Exception {
 
         parameters = new PolicyModelsProviderParameters();
         parameters.setDatabaseDriver("org.h2.Driver");
@@ -67,13 +67,13 @@ public class ParticipantStatisticsProviderTest {
         inputParticipantStatistics = CODER.decode(originalJson, ParticipantStatisticsList.class);
     }
 
-    @After
-    public void teardown() {
+    @AfterEach
+    void teardown() {
         participantStatisticsProvider.close();
     }
 
     @Test
-    public void testParticipantStatisticsCreate() throws Exception {
+    void testParticipantStatisticsCreate() throws Exception {
         assertThatThrownBy(() -> {
             participantStatisticsProvider.createParticipantStatistics(null);
         }).hasMessageMatching(LIST_IS_NULL);
@@ -87,7 +87,7 @@ public class ParticipantStatisticsProviderTest {
     }
 
     @Test
-    public void testGetControlLoops() throws Exception {
+    void testGetControlLoops() throws Exception {
         List<ParticipantStatistics> getResponse;
 
         // Return empty list when no data present in db
index d1e3dcf..bf2e2fa 100644 (file)
@@ -26,12 +26,12 @@ import static org.junit.Assert.assertNotNull;
 
 import java.util.ArrayList;
 import java.util.List;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-public class ControlLoopNotificationTest {
+class ControlLoopNotificationTest {
 
     @Test
-    public void testControlLoopNotification() {
+    void testControlLoopNotification() {
         ControlLoopNotification cln0 = new ControlLoopNotification();
 
         List<ControlLoopStatus> addedList = new ArrayList<>();
@@ -61,7 +61,7 @@ public class ControlLoopNotificationTest {
     }
 
     @Test
-    public void testControlLoopNotificationLombok() {
+    void testControlLoopNotificationLombok() {
         assertNotNull(new ControlLoopNotification());
         assertNotNull(new ControlLoopNotification(new ArrayList<>(), new ArrayList<>()));
 
index d1ddbf4..cca5e85 100644 (file)
@@ -25,13 +25,13 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
 import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 
-public class ControlLoopStatusTest {
+class ControlLoopStatusTest {
 
     @Test
-    public void testControlLoopStatusLombok() {
+    void testControlLoopStatusLombok() {
         assertNotNull(new ControlLoopStatus());
         assertNotNull(new ControlLoopStatus(UUID.randomUUID(), new ToscaConceptIdentifier()));
 
index 6ea07be..1a89a1b 100644 (file)
@@ -29,16 +29,16 @@ import com.openpojo.validation.rule.impl.SetterMustExistRule;
 import com.openpojo.validation.test.impl.GetterTester;
 import com.openpojo.validation.test.impl.SetterTester;
 import java.util.List;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.utils.test.ToStringTester;
 
 /**
  * Class to perform unit tests of all pojos.
  */
-public class NotificationPojosTest {
+class NotificationPojosTest {
 
     @Test
-    public void testPojos() {
+    void testPojos() {
         List<PojoClass> pojoClasses =
                 PojoClassFactory.getPojoClasses(NotificationPojosTest.class.getPackageName());
 
index 06d6ecf..c37268a 100644 (file)
@@ -26,17 +26,17 @@ import static org.onap.policy.clamp.controlloop.models.messages.dmaap.participan
 
 import java.time.Instant;
 import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopOrderedState;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 
 /**
  * Test the copy constructor and other methods.
  */
-public class ParticipantControlLoopStateChangeTest {
+class ParticipantControlLoopStateChangeTest {
 
     @Test
-    public void testCopyConstructor() {
+    void testCopyConstructor() {
         assertThatThrownBy(() -> new ParticipantStateChange(null)).isInstanceOf(NullPointerException.class);
 
         ParticipantControlLoopStateChange orig = new ParticipantControlLoopStateChange();
index 4397bf1..5d87095 100644 (file)
@@ -27,7 +27,7 @@ import static org.onap.policy.clamp.controlloop.models.messages.dmaap.participan
 
 import java.time.Instant;
 import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoop;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
@@ -35,9 +35,9 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
 /**
  * Test the copy constructor.
  */
-public class ParticipantControlLoopUpdateTest {
+class ParticipantControlLoopUpdateTest {
     @Test
-    public void testCopyConstructor() {
+    void testCopyConstructor() {
         assertThatThrownBy(() -> new ParticipantControlLoopUpdate(null)).isInstanceOf(NullPointerException.class);
 
         ParticipantControlLoopUpdate orig = new ParticipantControlLoopUpdate();
index 1cc3566..7f595fb 100644 (file)
@@ -26,17 +26,17 @@ import static org.onap.policy.clamp.controlloop.models.messages.dmaap.participan
 
 import java.time.Instant;
 import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantState;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 
 /**
  * Test the copy constructor and other methods.
  */
-public class ParticipantHealthCheckTest {
+class ParticipantHealthCheckTest {
 
     @Test
-    public void testCopyConstructor() {
+    void testCopyConstructor() {
         assertThatThrownBy(() -> new ParticipantStateChange(null)).isInstanceOf(NullPointerException.class);
 
         ParticipantHealthCheck orig = new ParticipantHealthCheck();
index d27d3a2..8d644f1 100644 (file)
@@ -27,14 +27,14 @@ import static org.junit.Assert.assertTrue;
 
 import java.time.Instant;
 import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 
-public class ParticipantMessageTest {
+class ParticipantMessageTest {
     private ParticipantMessage message;
 
     @Test
-    public void testCopyConstructor() {
+    void testCopyConstructor() {
         assertThatThrownBy(() -> new ParticipantMessage((ParticipantMessage) null))
                 .isInstanceOf(NullPointerException.class);
 
@@ -54,7 +54,7 @@ public class ParticipantMessageTest {
     }
 
     @Test
-    public void testAppliesTo_NullParticipantId() {
+    void testAppliesTo_NullParticipantId() {
         message = makeMessage();
 
         assertThatThrownBy(() -> message.appliesTo(null, null)).isInstanceOf(NullPointerException.class);
@@ -65,7 +65,7 @@ public class ParticipantMessageTest {
     }
 
     @Test
-    public void testAppliesTo_ParticipantIdMatches() {
+    void testAppliesTo_ParticipantIdMatches() {
         message = makeMessage();
 
         // ParticipantId matches
@@ -78,7 +78,7 @@ public class ParticipantMessageTest {
     }
 
     @Test
-    public void testAppliesTo_ParticipantIdNoMatch() {
+    void testAppliesTo_ParticipantIdNoMatch() {
         message = makeMessage();
 
         // ParticipantId does not match
index 301f9ac..af8eaa8 100644 (file)
@@ -29,16 +29,16 @@ import com.openpojo.validation.rule.impl.SetterMustExistRule;
 import com.openpojo.validation.test.impl.GetterTester;
 import com.openpojo.validation.test.impl.SetterTester;
 import java.util.List;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.utils.test.ToStringTester;
 
 /**
  * Class to perform unit tests of all pojos.
  */
-public class ParticipantPojosTest {
+class ParticipantPojosTest {
 
     @Test
-    public void testPojos() {
+    void testPojos() {
         List<PojoClass> pojoClasses =
                 PojoClassFactory.getPojoClasses(ParticipantPojosTest.class.getPackageName());
 
index 2355326..6c73c6d 100644 (file)
@@ -26,17 +26,17 @@ import static org.onap.policy.clamp.controlloop.models.messages.dmaap.participan
 
 import java.time.Instant;
 import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantState;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 
 /**
  * Test the copy constructor and the other methods.
  */
-public class ParticipantStateChangeTest {
+class ParticipantStateChangeTest {
 
     @Test
-    public void testCopyConstructor() {
+    void testCopyConstructor() {
         assertThatThrownBy(() -> new ParticipantStateChange(null)).isInstanceOf(NullPointerException.class);
 
         ParticipantStateChange orig = new ParticipantStateChange();
index 9b5722b..706e58b 100644 (file)
@@ -26,14 +26,14 @@ import static org.onap.policy.clamp.controlloop.models.messages.dmaap.participan
 
 import java.time.Instant;
 import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantState;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 
-public class ParticipantStatusTest {
+class ParticipantStatusTest {
 
     @Test
-    public void testCopyConstructor() {
+    void testCopyConstructor() {
         assertThatThrownBy(() -> new ParticipantStatus(null)).isInstanceOf(NullPointerException.class);
 
         final ParticipantStatus orig = new ParticipantStatus();
index 299a580..435cce8 100644 (file)
@@ -29,16 +29,16 @@ import com.openpojo.validation.rule.impl.SetterMustExistRule;
 import com.openpojo.validation.test.impl.GetterTester;
 import com.openpojo.validation.test.impl.SetterTester;
 import java.util.List;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.utils.test.ToStringTester;
 
 /**
  * Class to perform unit tests of all pojos.
  */
-public class MessagesRestPojosTest {
+class MessagesRestPojosTest {
 
     @Test
-    public void testPojos() {
+    void testPojos() {
         List<PojoClass> pojoClasses =
                 PojoClassFactory.getPojoClassesRecursively(MessagesRestPojosTest.class.getPackageName(), null);
 
index 6bda3b7..c990275 100644 (file)
@@ -26,12 +26,12 @@ import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNotNull;
 
 import java.util.ArrayList;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopOrderedState;
 
-public class InstantiationCommandTest {
+class InstantiationCommandTest {
     @Test
-    public void testInstantiationCommandLombok() {
+    void testInstantiationCommandLombok() {
         assertNotNull(new InstantiationCommand());
         InstantiationCommand ic0 = new InstantiationCommand();