Convert models to JUnit 5 98/138298/1
authorwaynedunican <wayne.dunican@est.tech>
Thu, 13 Jun 2024 08:29:20 +0000 (09:29 +0100)
committerwaynedunican <wayne.dunican@est.tech>
Thu, 20 Jun 2024 15:46:07 +0000 (16:46 +0100)
Review for models-sim and models-tosca

Issue-ID: POLICY-5042
Change-Id: I72533933b34df145e1ff4eb40ebafa93f85cca9a
Signed-off-by: waynedunican <wayne.dunican@est.tech>
60 files changed:
models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/TestPdpSimulatorActivator.java
models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/TestPdpSimulatorConstants.java
models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/TestPdpSimulatorMain.java
models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/comm/TestPdpStateChangeListener.java
models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/comm/TestPdpUpdateListener.java
models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/exception/TestExceptions.java
models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/parameters/TestPdpSimulatorParameterGroup.java
models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/parameters/TestPdpSimulatorParameterHandler.java
models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/parameters/TestPdpStatusParameters.java
models-sim/policy-models-simulators/src/test/java/org/onap/policy/models/simulators/CdsServerParametersTest.java
models-sim/policy-models-simulators/src/test/java/org/onap/policy/models/simulators/ClassRestServerParametersTest.java
models-sim/policy-models-simulators/src/test/java/org/onap/policy/models/simulators/MainTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/PojosTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaConceptIdentifierOptVersionTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaConceptIdentifierTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaEntityFilterTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaIdentifierTestBase.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaNameVersionTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaNodeTemplateTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTypeTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPropertyTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaServiceTemplateTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaTopologyTemplateTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaTypedEntityFilterTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaWithToscaPropertiesTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaWithTypeAndObjectPropertiesTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderGenericTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderNodeTemplateTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTypeTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/ToscaServiceTemplateMappingTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaCapabilityAssignmentTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintLogicalTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataTypeTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataTypesTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEventFilterTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaModelTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPoliciesTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTypeTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTypesTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPropertyTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaSchemaDefinitionTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplateTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplatesTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTimeIntervalTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTopologyTemplateTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTriggerTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaWithStringPropertiesTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaWithToscaPropertiesTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/TestPojos.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProviderTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaServiceTemplateProviderTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicySerializationTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicyTypeSerializationTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/OptimizationPolicyTypeSerializationTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/utils/ToscaServiceTemplateUtilsTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/utils/ToscaUtilsTest.java

index 1ebd2a0..1d58a33 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
  *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.sim.pdp;
 
 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 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.common.utils.services.Registry;
 import org.onap.policy.models.pdp.concepts.PdpStatus;
 import org.onap.policy.models.sim.pdp.exception.PdpSimulatorException;
@@ -43,7 +44,7 @@ import org.onap.policy.models.sim.pdp.parameters.PdpSimulatorParameterHandler;
  *
  * @author Ajith Sreekumar (ajith.sreekumar@est.tech)
  */
-public class TestPdpSimulatorActivator {
+class TestPdpSimulatorActivator {
 
     private PdpSimulatorActivator activator;
 
@@ -52,8 +53,8 @@ public class TestPdpSimulatorActivator {
      *
      * @throws Exception if an error occurs
      */
-    @Before
-    public void setUp() throws Exception {
+    @BeforeEach
+    void setUp() throws Exception {
         Registry.newRegistry();
         final String[] pdpSimulatorConfigParameters = { "-c", "src/test/resources/PdpSimulatorConfigParameters.json" };
         final PdpSimulatorCommandLineArguments arguments =
@@ -68,15 +69,15 @@ public class TestPdpSimulatorActivator {
      *
      * @throws Exception if an error occurs
      */
-    @After
-    public void teardown() throws Exception {
+    @AfterEach
+    void teardown() throws Exception {
         if (activator != null && activator.isAlive()) {
             activator.terminate();
         }
     }
 
     @Test
-    public void testPdpSimulatorActivator() throws PdpSimulatorException {
+    void testPdpSimulatorActivator() throws PdpSimulatorException {
         assertFalse(activator.isAlive());
         activator.initialize();
         assertTrue(activator.isAlive());
@@ -93,7 +94,7 @@ public class TestPdpSimulatorActivator {
     }
 
     @Test
-    public void testTerminate() throws Exception {
+    void testTerminate() throws Exception {
         activator.initialize();
         activator.terminate();
         assertFalse(activator.isAlive());
index 10d7d9f..ca65623 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019,2023 Nordix Foundation.
  *  Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,16 +25,16 @@ package org.onap.policy.models.sim.pdp;
 import static org.assertj.core.api.Assertions.assertThatCode;
 
 import java.lang.reflect.Constructor;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Class to perform unit test of {@link PdpSimulatorConstants}}.
  *
  * @author Ajith Sreekumar (ajith.sreekumar@est.tech)
  */
-public class TestPdpSimulatorConstants {
+class TestPdpSimulatorConstants {
     @Test
-    public void test() throws Exception {
+    void test() throws Exception {
         // verify that constructor does not throw an exception
         assertThatCode(() -> {
             Constructor<PdpSimulatorConstants> c = PdpSimulatorConstants.class.getDeclaredConstructor();
index 0f82e66..e02f599 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
  *  Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.sim.pdp;
 
 import static org.assertj.core.api.Assertions.assertThatCode;
-import static org.junit.Assert.assertEquals;
-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.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-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.common.utils.services.Registry;
 import org.onap.policy.models.sim.pdp.exception.PdpSimulatorException;
 import org.onap.policy.models.sim.pdp.parameters.CommonTestData;
@@ -39,14 +40,14 @@ import org.onap.policy.models.sim.pdp.parameters.CommonTestData;
  *
  * @author Ajith Sreekumar (ajith.sreekumar@est.tech)
  */
-public class TestPdpSimulatorMain {
+class TestPdpSimulatorMain {
     private PdpSimulatorMain pdpSimulator;
 
     /**
      * Set up.
      */
-    @Before
-    public void setUp() {
+    @BeforeEach
+    void setUp() {
         Registry.newRegistry();
     }
 
@@ -55,8 +56,8 @@ public class TestPdpSimulatorMain {
      *
      * @throws Exception if an error occurs
      */
-    @After
-    public void tearDown() throws Exception {
+    @AfterEach
+    void tearDown() throws Exception {
         // shut down activator
         final PdpSimulatorActivator activator = Registry.getOrDefault(PdpSimulatorConstants.REG_PDP_SIMULATOR_ACTIVATOR,
                 PdpSimulatorActivator.class, null);
@@ -66,7 +67,7 @@ public class TestPdpSimulatorMain {
     }
 
     @Test
-    public void testPdpSimulator() throws PdpSimulatorException {
+    void testPdpSimulator() throws PdpSimulatorException {
         final String[] pdpSimulatorConfigParameters = { "-c", "src/test/resources/PdpSimulatorConfigParameters.json" };
         pdpSimulator = new PdpSimulatorMain(pdpSimulatorConfigParameters);
         assertTrue(pdpSimulator.getParameters().isValid());
@@ -79,27 +80,27 @@ public class TestPdpSimulatorMain {
     }
 
     @Test
-    public void testPdpSimulator_NoArguments() {
+    void testPdpSimulator_NoArguments() {
         final String[] pdpSimulatorConfigParameters = {};
         pdpSimulator = new PdpSimulatorMain(pdpSimulatorConfigParameters);
         assertNull(pdpSimulator.getParameters());
     }
 
     @Test
-    public void testPdpSimulator_InvalidArguments() {
+    void testPdpSimulator_InvalidArguments() {
         final String[] pdpSimulatorConfigParameters = { "src/test/resourcesPdpSimulatorConfigParameters.json" };
         pdpSimulator = new PdpSimulatorMain(pdpSimulatorConfigParameters);
         assertNull(pdpSimulator.getParameters());
     }
 
     @Test
-    public void testPdpSimulator_Help() {
+    void testPdpSimulator_Help() {
         final String[] pdpSimulatorConfigParameters = { "-h" };
         assertThatCode(() -> PdpSimulatorMain.main(pdpSimulatorConfigParameters)).doesNotThrowAnyException();
     }
 
     @Test
-    public void testPdpSimulator_InvalidParameters() {
+    void testPdpSimulator_InvalidParameters() {
         final String[] pdpSimulatorConfigParameters =
             { "-c", "src/test/resources/PdpSimulatorConfigParameters_InvalidName.json" };
         pdpSimulator = new PdpSimulatorMain(pdpSimulatorConfigParameters);
index 20c9cc1..c0e933f 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
  *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,7 +22,7 @@
 
 package org.onap.policy.models.sim.pdp.comm;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
@@ -31,9 +32,9 @@ import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-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.common.endpoints.event.comm.Topic.CommInfrastructure;
 import org.onap.policy.common.utils.services.Registry;
 import org.onap.policy.models.pdp.concepts.PdpStateChange;
@@ -52,7 +53,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
  *
  * @author Ajith Sreekumar (ajith.sreekumar@est.tech)
  */
-public class TestPdpStateChangeListener {
+class TestPdpStateChangeListener {
     private static final String PDP_SUBGROUP = "pdpSubgroup";
     private static final String PDP_GROUP = "pdpGroup";
     private PdpUpdateListener pdpUpdateMessageListener;
@@ -66,8 +67,8 @@ public class TestPdpStateChangeListener {
      *
      * @throws Exception if an error occurs
      */
-    @Before
-    public void setUp() throws Exception {
+    @BeforeEach
+    void setUp() throws Exception {
         pdpUpdateMessageListener = new PdpUpdateListener();
         pdpStateChangeListener = new PdpStateChangeListener();
         Registry.newRegistry();
@@ -96,8 +97,8 @@ public class TestPdpStateChangeListener {
      *
      * @throws Exception if an error occurs
      */
-    @After
-    public void teardown() throws Exception {
+    @AfterEach
+    void teardown() throws Exception {
 
         // clear the pdp simulator activator
         if (activator != null && activator.isAlive()) {
@@ -139,7 +140,7 @@ public class TestPdpStateChangeListener {
     }
 
     @Test
-    public void testPdpStateChangeMessageListener_passivetopassive() {
+    void testPdpStateChangeMessageListener_passivetopassive() {
         final PdpStatus pdpStatus = Registry.get(PdpSimulatorConstants.REG_PDP_STATUS_OBJECT);
         performPdpUpdate(pdpStatus.getName());
         final PdpStateChange pdpStateChangeMsg = new PdpStateChange();
@@ -149,11 +150,11 @@ public class TestPdpStateChangeListener {
         pdpStateChangeMsg.setName(pdpStatus.getName());
         pdpStateChangeListener.onTopicEvent(INFRA, TOPIC, null, pdpStateChangeMsg);
 
-        assertEquals(pdpStatus.getState(), pdpStateChangeMsg.getState());
+        assertEquals(pdpStateChangeMsg.getState(), pdpStatus.getState());
     }
 
     @Test
-    public void testPdpStateChangeMessageListener_activetoactive() {
+    void testPdpStateChangeMessageListener_activetoactive() {
         final PdpStatus pdpStatus = Registry.get(PdpSimulatorConstants.REG_PDP_STATUS_OBJECT);
         performPdpUpdate(pdpStatus.getName());
         pdpStatus.setState(PdpState.ACTIVE);
index 0827f26..b63fd15 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
  *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,7 +22,7 @@
 
 package org.onap.policy.models.sim.pdp.comm;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
@@ -31,9 +32,9 @@ import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-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.common.endpoints.event.comm.Topic.CommInfrastructure;
 import org.onap.policy.common.utils.services.Registry;
 import org.onap.policy.models.pdp.concepts.PdpStatus;
@@ -51,7 +52,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
  *
  * @author Ajith Sreekumar (ajith.sreekumar@est.tech)
  */
-public class TestPdpUpdateListener {
+class TestPdpUpdateListener {
     private PdpUpdateListener pdpUpdateMessageListener;
     private static final CommInfrastructure INFRA = CommInfrastructure.NOOP;
     private static final String TOPIC = "my-topic";
@@ -62,8 +63,8 @@ public class TestPdpUpdateListener {
      *
      * @throws Exception if an error occurs
      */
-    @Before
-    public void setUp() throws Exception {
+    @BeforeEach
+    void setUp() throws Exception {
         Registry.newRegistry();
         final String[] pdpSimulatorConfigParameters = { "-c", "src/test/resources/PdpSimulatorConfigParameters.json" };
         final PdpSimulatorCommandLineArguments arguments = new PdpSimulatorCommandLineArguments();
@@ -91,8 +92,8 @@ public class TestPdpUpdateListener {
      *
      * @throws Exception if an error occurs
      */
-    @After
-    public void teardown() throws Exception {
+    @AfterEach
+    void teardown() throws Exception {
 
         // clear the pdp simulator activator
         if (activator != null && activator.isAlive()) {
@@ -101,7 +102,7 @@ public class TestPdpUpdateListener {
     }
 
     @Test
-    public void testPdpUpdateMssageListener() {
+    void testPdpUpdateMssageListener() {
         final PdpStatus pdpStatus = Registry.get(PdpSimulatorConstants.REG_PDP_STATUS_OBJECT);
         final PdpUpdate pdpUpdateMsg = new PdpUpdate();
         pdpUpdateMsg.setDescription("dummy pdp status for test");
index 45845a9..ab5ae89 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,7 +21,7 @@
 
 package org.onap.policy.models.sim.pdp.exception;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.utils.test.ExceptionsTester;
 
 /**
@@ -28,10 +29,10 @@ import org.onap.policy.common.utils.test.ExceptionsTester;
  *
  * @author Ajith Sreekumar (ajith.sreekumar@est.tech)
  */
-public class TestExceptions {
+class TestExceptions {
 
     @Test
-    public void test() {
+    void test() {
         new ExceptionsTester().test(PdpSimulatorException.class);
         new ExceptionsTester().test(PdpSimulatorRunTimeException.class);
     }
index b7d13ef..2b5eed4 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.sim.pdp.parameters;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-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.assertTrue;
 
 import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
 import org.onap.policy.common.parameters.ValidationResult;
 
@@ -36,17 +37,17 @@ import org.onap.policy.common.parameters.ValidationResult;
  *
  * @author Ajith Sreekumar (ajith.sreekumar@est.tech)
  */
-public class TestPdpSimulatorParameterGroup {
+class TestPdpSimulatorParameterGroup {
     CommonTestData commonTestData = new CommonTestData();
 
     @Test
-    public void testPdpSimulatorParameterGroup_Named() {
+    void testPdpSimulatorParameterGroup_Named() {
         final PdpSimulatorParameterGroup pdpSimulatorParameters = new PdpSimulatorParameterGroup("my-name");
         assertEquals("my-name", pdpSimulatorParameters.getName());
     }
 
     @Test
-    public void testPdpSimulatorParameterGroup() {
+    void testPdpSimulatorParameterGroup() {
         final PdpSimulatorParameterGroup pdpSimulatorParameters = commonTestData.toObject(
                 commonTestData.getPdpSimulatorParameterGroupMap(CommonTestData.PDP_SIMULATOR_GROUP_NAME),
                 PdpSimulatorParameterGroup.class);
@@ -64,7 +65,7 @@ public class TestPdpSimulatorParameterGroup {
     }
 
     @Test
-    public void testPdpSimulatorParameterGroup_NullName() {
+    void testPdpSimulatorParameterGroup_NullName() {
         final PdpSimulatorParameterGroup pdpSimulatorParameters = commonTestData
                 .toObject(commonTestData.getPdpSimulatorParameterGroupMap(null), PdpSimulatorParameterGroup.class);
         final ValidationResult validationResult = pdpSimulatorParameters.validate();
@@ -74,7 +75,7 @@ public class TestPdpSimulatorParameterGroup {
     }
 
     @Test
-    public void testPdpSimulatorParameterGroup_EmptyName() {
+    void testPdpSimulatorParameterGroup_EmptyName() {
         final PdpSimulatorParameterGroup pdpSimulatorParameters = commonTestData
                 .toObject(commonTestData.getPdpSimulatorParameterGroupMap(""), PdpSimulatorParameterGroup.class);
         final ValidationResult validationResult = pdpSimulatorParameters.validate();
@@ -85,7 +86,7 @@ public class TestPdpSimulatorParameterGroup {
     }
 
     @Test
-    public void testPdpSimulatorParameterGroup_SetName() {
+    void testPdpSimulatorParameterGroup_SetName() {
         final PdpSimulatorParameterGroup pdpSimulatorParameters = commonTestData.toObject(
                 commonTestData.getPdpSimulatorParameterGroupMap(CommonTestData.PDP_SIMULATOR_GROUP_NAME),
                 PdpSimulatorParameterGroup.class);
@@ -96,7 +97,7 @@ public class TestPdpSimulatorParameterGroup {
     }
 
     @Test
-    public void testPdpSimulatorParameterGroup_EmptyPdpStatusParameters() {
+    void testPdpSimulatorParameterGroup_EmptyPdpStatusParameters() {
         final Map<String, Object> map =
                 commonTestData.getPdpSimulatorParameterGroupMap(CommonTestData.PDP_SIMULATOR_GROUP_NAME);
         map.put("pdpStatusParameters", commonTestData.getPdpStatusParametersMap(true));
@@ -109,7 +110,7 @@ public class TestPdpSimulatorParameterGroup {
     }
 
     @Test
-    public void testApexStarterParameterGroupp_EmptyTopicParameters() {
+    void testApexStarterParameterGroupp_EmptyTopicParameters() {
         final Map<String, Object> map =
                 commonTestData.getPdpSimulatorParameterGroupMap(CommonTestData.PDP_SIMULATOR_GROUP_NAME);
         map.put("topicParameterGroup", commonTestData.getTopicParametersMap(true));
index 84c7b0d..41d5e86 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2021, 2024 Nordix Foundation.
  *  Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.sim.pdp.parameters;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.io.FileNotFoundException;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.utils.cmd.CommandLineException;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.models.sim.pdp.PdpSimulatorCommandLineArguments;
@@ -38,10 +39,10 @@ import org.onap.policy.models.sim.pdp.exception.PdpSimulatorException;
  *
  * @author Ajith Sreekumar (ajith.sreekumar@est.tech)
  */
-public class TestPdpSimulatorParameterHandler {
+class TestPdpSimulatorParameterHandler {
 
     @Test
-    public void testParameterHandlerNoParameterFile() throws CommandLineException {
+    void testParameterHandlerNoParameterFile() throws CommandLineException {
         final String[] emptyArgumentString = { "-c", "src/test/resources/NoParametersFile.json" };
 
         final PdpSimulatorCommandLineArguments emptyArguments = new PdpSimulatorCommandLineArguments();
@@ -57,7 +58,7 @@ public class TestPdpSimulatorParameterHandler {
     }
 
     @Test
-    public void testParameterHandlerEmptyParameters() throws CommandLineException {
+    void testParameterHandlerEmptyParameters() throws CommandLineException {
         final String[] noArgumentString = { "-c", "src/test/resources/NoParameters.json" };
 
         final PdpSimulatorCommandLineArguments noArguments = new PdpSimulatorCommandLineArguments();
@@ -68,7 +69,7 @@ public class TestPdpSimulatorParameterHandler {
     }
 
     @Test
-    public void testParameterHandlerInvalidParameters() throws CommandLineException {
+    void testParameterHandlerInvalidParameters() throws CommandLineException {
         final String[] invalidArgumentString = { "-c", "src/test/resources/InvalidParameters.json" };
 
         final PdpSimulatorCommandLineArguments invalidArguments = new PdpSimulatorCommandLineArguments();
@@ -80,7 +81,7 @@ public class TestPdpSimulatorParameterHandler {
     }
 
     @Test
-    public void testParameterHandlerNoParameters() throws CommandLineException {
+    void testParameterHandlerNoParameters() throws CommandLineException {
         final String[] noArgumentString = { "-c", "src/test/resources/EmptyConfigParameters.json" };
 
         final PdpSimulatorCommandLineArguments noArguments = new PdpSimulatorCommandLineArguments();
@@ -91,7 +92,7 @@ public class TestPdpSimulatorParameterHandler {
     }
 
     @Test
-    public void testPdpSimulatorParameterGroup() throws PdpSimulatorException, CommandLineException {
+    void testPdpSimulatorParameterGroup() throws PdpSimulatorException, CommandLineException {
         final String[] pdpSimulatorConfigParameters = { "-c", "src/test/resources/PdpSimulatorConfigParameters.json" };
 
         final PdpSimulatorCommandLineArguments arguments = new PdpSimulatorCommandLineArguments();
@@ -103,7 +104,7 @@ public class TestPdpSimulatorParameterHandler {
     }
 
     @Test
-    public void testPdpSimulatorParameterGroup_InvalidName() throws CommandLineException {
+    void testPdpSimulatorParameterGroup_InvalidName() throws CommandLineException {
         final String[] pdpSimulatorConfigParameters = {"-c",
             "src/test/resources/PdpSimulatorConfigParameters_InvalidName.json"};
 
@@ -115,7 +116,7 @@ public class TestPdpSimulatorParameterHandler {
     }
 
     @Test
-    public void testPdpSimulatorVersion() throws CommandLineException {
+    void testPdpSimulatorVersion() throws CommandLineException {
         final String[] pdpSimulatorConfigParameters = { "-v" };
         final PdpSimulatorCommandLineArguments arguments = new PdpSimulatorCommandLineArguments();
         final String version = arguments.parse(pdpSimulatorConfigParameters);
@@ -123,7 +124,7 @@ public class TestPdpSimulatorParameterHandler {
     }
 
     @Test
-    public void testPdpSimulatorHelp() throws CommandLineException {
+    void testPdpSimulatorHelp() throws CommandLineException {
         final String[] pdpSimulatorConfigParameters = { "-h" };
         final PdpSimulatorCommandLineArguments arguments = new PdpSimulatorCommandLineArguments();
         final String help = arguments.parse(pdpSimulatorConfigParameters);
@@ -131,7 +132,7 @@ public class TestPdpSimulatorParameterHandler {
     }
 
     @Test
-    public void testPdpSimulatorInvalidOption() {
+    void testPdpSimulatorInvalidOption() {
         final String[] pdpSimulatorConfigParameters = { "-d" };
         final PdpSimulatorCommandLineArguments arguments = new PdpSimulatorCommandLineArguments();
 
@@ -140,7 +141,7 @@ public class TestPdpSimulatorParameterHandler {
     }
 
     @Test
-    public void testPdpSimulatorProperty() throws CommandLineException {
+    void testPdpSimulatorProperty() throws CommandLineException {
         final String[] pdpSimulatorConfigParameters = { "-p", "dummyProperties.json" };
         final PdpSimulatorCommandLineArguments arguments = new PdpSimulatorCommandLineArguments();
         arguments.parse(pdpSimulatorConfigParameters);
index 09ad295..5adbec1 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
  *  Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 package org.onap.policy.models.sim.pdp.parameters;
 
-import static org.junit.Assert.assertEquals;
-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.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.parameters.ValidationResult;
 
 /**
@@ -33,11 +34,11 @@ import org.onap.policy.common.parameters.ValidationResult;
  *
  * @author Ajith Sreekumar (ajith.sreekumar@est.tech)
  */
-public class TestPdpStatusParameters {
+class TestPdpStatusParameters {
     private static CommonTestData testData = new CommonTestData();
 
     @Test
-    public void test() {
+    void test() {
         final PdpStatusParameters pdpStatusParameters =
                 testData.toObject(testData.getPdpStatusParametersMap(false), PdpStatusParameters.class);
         final ValidationResult validationResult = pdpStatusParameters.validate();
@@ -50,7 +51,7 @@ public class TestPdpStatusParameters {
     }
 
     @Test
-    public void testValidate() {
+    void testValidate() {
         final PdpStatusParameters pdpStatusParameters =
                 testData.toObject(testData.getPdpStatusParametersMap(false), PdpStatusParameters.class);
         final ValidationResult result = pdpStatusParameters.validate();
index 7b0ab6b..03442b9 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  * Copyright (C) 2020 Bell Canada.
  * Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 package org.onap.policy.models.simulators;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.File;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.parameters.ValidationResult;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
 
-public class CdsServerParametersTest {
+class CdsServerParametersTest {
     @Test
-    public void testValidateString() throws CoderException {
+    void testValidateString() throws CoderException {
         // some fields missing
         ValidationResult result = new CdsServerParameters().validate();
         assertFalse(result.isValid());
index 0560e85..77f6942 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 package org.onap.policy.models.simulators;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+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 java.io.File;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.parameters.ValidationResult;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
 
-public class ClassRestServerParametersTest {
+class ClassRestServerParametersTest {
 
     @Test
-    public void testValidateString() throws CoderException {
+    void testValidateString() throws CoderException {
         // some fields missing
         ValidationResult result = new ClassRestServerParameters().validate();
         assertFalse(result.isValid());
index 09064f4..67cd7d8 100644 (file)
@@ -24,9 +24,9 @@ package org.onap.policy.models.simulators;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
@@ -41,10 +41,10 @@ import java.util.Map.Entry;
 import java.util.Properties;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.TimeUnit;
-import org.junit.After;
-import org.junit.AfterClass;
-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.Test;
 import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
 import org.onap.policy.common.endpoints.http.client.HttpClient;
 import org.onap.policy.common.endpoints.http.client.HttpClientConfigException;
@@ -56,7 +56,7 @@ import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.network.NetworkUtil;
 import org.onap.policy.common.utils.security.SelfSignedKeyStore;
 
-public class MainTest {
+class MainTest {
     private static final String PARAMETER_FILE = "simParameters.json";
     private static final String HOST = "localhost";
     private static final String EXPECTED_EXCEPTION = "expected exception";
@@ -66,7 +66,7 @@ public class MainTest {
     /**
      * Saves system properties.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() throws IOException, InterruptedException {
         savedValues = new HashMap<>();
 
@@ -91,7 +91,7 @@ public class MainTest {
     /**
      * Restores system properties.
      */
-    @AfterClass
+    @AfterAll
     public static void tearDownAfterClass() {
         for (Entry<String, String> ent : savedValues.entrySet()) {
             if (ent.getValue() == null) {
@@ -105,8 +105,8 @@ public class MainTest {
     /**
      * Shuts down the simulator instance.
      */
-    @After
-    public void tearDown() {
+    @AfterEach
+    void tearDown() {
         Main main = Main.getInstance();
         if (main != null && main.isAlive()) {
             main.shutdown();
@@ -118,7 +118,7 @@ public class MainTest {
      * least one of them.
      */
     @Test
-    public void testMain() throws Exception {
+    void testMain() throws Exception {
         Main.main(new String[0]);
         assertTrue(Main.getInstance() == null || !Main.getInstance().isAlive());
 
@@ -126,7 +126,7 @@ public class MainTest {
 
         // don't need to wait long, because buildXxx() does the wait for us
         for (int port : new int[] {6666, 6667, 6668, 6669, 6670, 6680}) {
-            assertTrue("simulator on port " + port, NetworkUtil.isTcpPortOpen(HOST, port, 1, 100));
+            assertTrue(NetworkUtil.isTcpPortOpen(HOST, port, 1, 100), "simulator on port " + port);
         }
 
         // it's sufficient to verify that one of the simulators works
@@ -134,7 +134,7 @@ public class MainTest {
     }
 
     @Test
-    public void testMainMinimalParameters() {
+    void testMainMinimalParameters() {
         Main.main(new String[] {"minParameters.json"});
         assertNotNull(Main.getInstance());
         assertTrue(Main.getInstance().isAlive());
@@ -156,7 +156,7 @@ public class MainTest {
      * Tests readParameters() when the file cannot be found.
      */
     @Test
-    public void testReadParametersNoFile() {
+    void testReadParametersNoFile() {
         assertThatIllegalArgumentException().isThrownBy(() -> new Main("missing-file.json"))
                         .withCauseInstanceOf(FileNotFoundException.class);
     }
@@ -165,7 +165,7 @@ public class MainTest {
      * Tests readParameters() when the json cannot be decoded.
      */
     @Test
-    public void testReadParametersInvalidJson() throws CoderException {
+    void testReadParametersInvalidJson() throws CoderException {
         Coder coder = mock(Coder.class);
         when(coder.decode(any(String.class), any())).thenThrow(new CoderException(EXPECTED_EXCEPTION));
 
@@ -181,7 +181,7 @@ public class MainTest {
      * Tests buildRestServer() when the server port is not open.
      */
     @Test
-    public void testBuildRestServerNotOpen() {
+    void testBuildRestServerNotOpen() {
         HttpServletServer server = mock(HttpServletServer.class);
 
         Main main = new Main(PARAMETER_FILE) {
@@ -203,7 +203,7 @@ public class MainTest {
      * Tests buildRestServer() when the port checker is interrupted.
      */
     @Test
-    public void testBuildRestServerInterrupted() throws InterruptedException {
+    void testBuildRestServerInterrupted() throws InterruptedException {
         HttpServletServer server = mock(HttpServletServer.class);
 
         Main main = new Main(PARAMETER_FILE) {
index fe60a52..dc0e27b 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Policy Model
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@ import com.openpojo.validation.rule.impl.GetterMustExistRule;
 import com.openpojo.validation.rule.impl.SetterMustExistRule;
 import com.openpojo.validation.test.impl.GetterTester;
 import com.openpojo.validation.test.impl.SetterTester;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.utils.test.ToStringTester;
 
 /**
@@ -40,12 +40,12 @@ import org.onap.policy.common.utils.test.ToStringTester;
  * @author Chenfei Gao (cgao@research.att.com)
  *
  */
-public class PojosTest {
+class PojosTest {
 
     private static final String POJO_PACKAGE = "org.onap.policy.models.tosca.authorative.concepts";
 
     @Test
-    public void testPojos() {
+    void testPojos() {
         // @formatter:off
         final Validator validator = ValidatorBuilder
                 .create()
index aedf5cb..c994827 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Policy Models
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.authorative.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test the other constructors, as {@link PojosTest} tests the other methods.
  */
-public class ToscaConceptIdentifierOptVersionTest extends ToscaIdentifierTestBase<ToscaConceptIdentifierOptVersion> {
+class ToscaConceptIdentifierOptVersionTest extends ToscaIdentifierTestBase<ToscaConceptIdentifierOptVersion> {
 
     public ToscaConceptIdentifierOptVersionTest() {
         super(ToscaConceptIdentifierOptVersion.class, "name", "version");
     }
 
     @Test
-    public void testAllArgsConstructor_testIsNullVersion() {
+    void testAllArgsConstructor_testIsNullVersion() {
         assertThatThrownBy(() -> new ToscaConceptIdentifierOptVersion(null, VERSION))
                         .isInstanceOf(NullPointerException.class);
 
@@ -51,7 +51,7 @@ public class ToscaConceptIdentifierOptVersionTest extends ToscaIdentifierTestBas
     }
 
     @Test
-    public void testCopyConstructor() throws Exception {
+    void testCopyConstructor() throws Exception {
         assertThatThrownBy(() -> new ToscaConceptIdentifierOptVersion((ToscaConceptIdentifierOptVersion) null))
                         .isInstanceOf(NullPointerException.class);
 
@@ -66,7 +66,7 @@ public class ToscaConceptIdentifierOptVersionTest extends ToscaIdentifierTestBas
     }
 
     @Test
-    public void testCopyToscaPolicyIdentifierConstructor() {
+    void testCopyToscaPolicyIdentifierConstructor() {
         assertThatThrownBy(() -> new ToscaConceptIdentifierOptVersion((ToscaConceptIdentifier) null))
                         .isInstanceOf(NullPointerException.class);
 
@@ -87,7 +87,7 @@ public class ToscaConceptIdentifierOptVersionTest extends ToscaIdentifierTestBas
 
     @Test
     @Override
-    public void testCompareTo() throws Exception {
+    void testCompareTo() throws Exception {
         super.testCompareTo();
     }
 }
index 88a49db..17fbeef 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Policy Models
  * ================================================================================
  * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.authorative.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-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 org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.parameters.ValidationResult;
 import org.onap.policy.models.base.PfConceptKey;
 
 /**
  * Test methods not tested by {@link PojosTest}.
  */
-public class ToscaConceptIdentifierTest extends ToscaIdentifierTestBase<ToscaConceptIdentifier> {
+class ToscaConceptIdentifierTest extends ToscaIdentifierTestBase<ToscaConceptIdentifier> {
 
     public ToscaConceptIdentifierTest() {
         super(ToscaConceptIdentifier.class, "name", "version");
     }
 
     @Test
-    public void testAllArgsConstructor() {
+    void testAllArgsConstructor() {
         assertThatThrownBy(() -> new ToscaConceptIdentifier(null, VERSION)).isInstanceOf(NullPointerException.class);
         assertThatThrownBy(() -> new ToscaConceptIdentifier(NAME, null)).isInstanceOf(NullPointerException.class);
 
@@ -52,7 +52,7 @@ public class ToscaConceptIdentifierTest extends ToscaIdentifierTestBase<ToscaCon
     }
 
     @Test
-    public void testCopyConstructor() {
+    void testCopyConstructor() {
         assertThatThrownBy(() -> new ToscaConceptIdentifier((ToscaConceptIdentifier) null))
                 .isInstanceOf(NullPointerException.class);
 
@@ -68,7 +68,7 @@ public class ToscaConceptIdentifierTest extends ToscaIdentifierTestBase<ToscaCon
 
 
     @Test
-    public void testPfKey() {
+    void testPfKey() {
         assertThatThrownBy(() -> new ToscaConceptIdentifier((PfConceptKey) null))
                 .isInstanceOf(NullPointerException.class);
 
@@ -80,7 +80,7 @@ public class ToscaConceptIdentifierTest extends ToscaIdentifierTestBase<ToscaCon
     }
 
     @Test
-    public void testValidatePapRest() throws Exception {
+    void testValidatePapRest() throws Exception {
         ToscaConceptIdentifier ident = new ToscaConceptIdentifier(NAME, VERSION);
         ValidationResult result = ident.validatePapRest();
         assertNotNull(result);
@@ -102,7 +102,7 @@ public class ToscaConceptIdentifierTest extends ToscaIdentifierTestBase<ToscaCon
 
     @Test
     @Override
-    public void testCompareTo() throws Exception {
+    void testCompareTo() throws Exception {
         super.testCompareTo();
     }
 }
index ec2a917..b9ae31b 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2021 Nordix Foundation.
  *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.authorative.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import com.google.gson.GsonBuilder;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.common.utils.resources.ResourceUtils;
@@ -46,7 +47,7 @@ import org.yaml.snakeyaml.Yaml;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class ToscaEntityFilterTest {
+class ToscaEntityFilterTest {
     // Logger for this class
     private static final Logger LOGGER = LoggerFactory.getLogger(ToscaEntityFilterTest.class);
 
@@ -81,7 +82,7 @@ public class ToscaEntityFilterTest {
      *
      * @throws CoderException on JSON decoding errors
      */
-    @BeforeClass
+    @BeforeAll
     public static void setupTypeList() throws CoderException {
         for (String policyTypeResourceName : policyTypeResourceNames) {
             String policyTypeString = ResourceUtils.getResourceAsString(policyTypeResourceName);
@@ -116,7 +117,7 @@ public class ToscaEntityFilterTest {
     }
 
     @Test
-    public void testNullList() {
+    void testNullList() {
         ToscaEntityFilter<ToscaPolicyType> filter = ToscaEntityFilter.<ToscaPolicyType>builder().build();
 
         assertThatThrownBy(() -> {
@@ -125,7 +126,7 @@ public class ToscaEntityFilterTest {
     }
 
     @Test
-    public void testFilterNothing() {
+    void testFilterNothing() {
         ToscaEntityFilter<ToscaPolicyType> filter = ToscaEntityFilter.<ToscaPolicyType>builder().build();
 
         List<ToscaPolicyType> filteredList = filter.filter(typeList);
@@ -133,7 +134,7 @@ public class ToscaEntityFilterTest {
     }
 
     @Test
-    public void testFilterLatestVersion() {
+    void testFilterLatestVersion() {
         ToscaEntityFilter<ToscaPolicyType> filter =
                 ToscaEntityFilter.<ToscaPolicyType>builder().version(ToscaEntityFilter.LATEST_VERSION).build();
 
@@ -164,7 +165,7 @@ public class ToscaEntityFilterTest {
     }
 
     @Test
-    public void testFilterNameVersion() {
+    void testFilterNameVersion() {
         ToscaEntityFilter<ToscaPolicyType> filter =
                 ToscaEntityFilter.<ToscaPolicyType>builder().name("onap.policies.Monitoring").build();
         List<ToscaPolicyType> filteredList = filter.filter(typeList);
index 5419b21..ebd3146 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP Policy Models
  * ================================================================================
  * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,8 +21,8 @@
 
 package org.onap.policy.models.tosca.authorative.concepts;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import org.onap.policy.common.utils.coder.Coder;
 import org.onap.policy.common.utils.coder.CoderException;
@@ -32,7 +33,7 @@ import org.onap.policy.common.utils.coder.StandardCoder;
  *
  * @param <T> type of key being tested
  */
-public class ToscaIdentifierTestBase<T extends Comparable<T>> {
+class ToscaIdentifierTestBase<T extends Comparable<T>> {
     public static final String NAME = "my-name";
     public static final String VERSION = "1.2.3";
 
@@ -61,7 +62,7 @@ public class ToscaIdentifierTestBase<T extends Comparable<T>> {
      *
      * @throws Exception if an error occurs
      */
-    public void testCompareTo() throws Exception {
+    void testCompareTo() throws Exception {
         T ident = makeIdent(NAME, VERSION);
         assertEquals(0, ident.compareTo(ident));
 
index 2a3586e..2efb326 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,28 +23,28 @@ package org.onap.policy.models.tosca.authorative.concepts;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfKey;
 
-public class ToscaNameVersionTest {
+class ToscaNameVersionTest {
 
     private static final String MY_NAME = "MyName";
     private static final String MY_VERSION = "1.2.3";
 
     private ToscaNameVersion tosca;
 
-    @Before
-    public void setUp() {
+    @BeforeEach
+    void setUp() {
         tosca = new ToscaNameVersion(MY_NAME, MY_VERSION);
     }
 
     @Test
-    public void testToscaNameVersionPfKey() {
+    void testToscaNameVersionPfKey() {
         tosca = new ToscaNameVersion(new PfConceptKey(MY_NAME, MY_VERSION));
         assertEquals(MY_NAME, tosca.getName());
         assertEquals(MY_VERSION, tosca.getVersion());
@@ -53,19 +54,19 @@ public class ToscaNameVersionTest {
     }
 
     @Test
-    public void testToscaNameVersionToscaNameVersion() {
+    void testToscaNameVersionToscaNameVersion() {
         tosca = new ToscaNameVersion(tosca);
         assertEquals(MY_NAME, tosca.getName());
         assertEquals(MY_VERSION, tosca.getVersion());
     }
 
     @Test
-    public void testAsConceptKey() {
+    void testAsConceptKey() {
         assertEquals(new PfConceptKey(MY_NAME, MY_VERSION), tosca.asConceptKey());
     }
 
     @Test
-    public void testCommonCompareTo() {
+    void testCommonCompareTo() {
         assertThat(tosca.commonCompareTo(tosca)).isZero();
         assertThat(tosca.commonCompareTo(null)).isNotZero();
         assertThat(tosca.commonCompareTo(new MyNameVersion(MY_NAME, MY_VERSION))).isNotZero();
@@ -75,19 +76,19 @@ public class ToscaNameVersionTest {
     }
 
     @Test
-    public void testToString() {
+    void testToString() {
         assertEquals(MY_NAME + " " + MY_VERSION, tosca.toString());
     }
 
     @Test
-    public void testToscaNameVersion() {
+    void testToscaNameVersion() {
         tosca = new ToscaNameVersion();
         assertNull(tosca.getName());
         assertNull(tosca.getVersion());
     }
 
     @Test
-    public void testToscaNameVersionStringString() {
+    void testToscaNameVersionStringString() {
         assertEquals(MY_NAME, tosca.getName());
         assertEquals(MY_VERSION, tosca.getVersion());
     }
index 5cfc864..58474b3 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP Policy Models
  * ================================================================================
  * Copyright (C) 2021 Nordix Foundation.
+ * Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.authorative.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.util.ArrayList;
 import java.util.HashMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-public class ToscaNodeTemplateTest {
+class ToscaNodeTemplateTest {
 
     @Test
-    public void testToscaNodeTemplate() {
+    void testToscaNodeTemplate() {
         assertThatThrownBy(() -> {
             new ToscaNodeTemplate(null);
         }).hasMessageMatching("copyObject is marked .*on.*ull but is null");
index 1dc9e53..123ed93 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Policy Models
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2020-2021 Nordix Foundation.
+ * Modifications Copyright (C) 2020-2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.authorative.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import java.util.LinkedHashMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Tests methods not tested by {@link PojosTest}.
  */
-public class ToscaPolicyTest {
+class ToscaPolicyTest {
 
     @Test
-    public void testGetIdentifier_testGetTypeIdentifier() {
+    void testGetIdentifier_testGetTypeIdentifier() {
         assertThatThrownBy(() -> {
             new ToscaPolicy(null);
         }).hasMessageMatching("copyObject is marked .*on.*ull but is null");
index 81e9c4f..148cf8a 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2021 Nordix Foundation.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.authorative.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.LinkedHashMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test of the {@link ToscaPolicyType} class.
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class ToscaPolicyTypeTest {
+class ToscaPolicyTypeTest {
 
     @Test
-    public void testToscaPolicyType() {
+    void testToscaPolicyType() {
         assertThatThrownBy(() -> {
             new ToscaPolicyType(null);
         }).hasMessageMatching("copyObject is marked .*on.*ull but is null");
index 6aa2e16..342f29f 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 package org.onap.policy.models.tosca.authorative.concepts;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import java.util.ArrayList;
 import java.util.List;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.tosca.simple.concepts.JpaToscaProperty;
 
-public class ToscaPropertyTest {
+class ToscaPropertyTest {
     @Test
-    public void testToscaPropertyDefaultValue() {
+    void testToscaPropertyDefaultValue() {
         ToscaProperty property = new ToscaProperty();
         property.setName("test");
         property.setType("testType");
index 46ec090..b11b8a6 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP Policy Models
  * ================================================================================
  * Copyright (C) 2021 Nordix Foundation.
+ * Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.authorative.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.util.HashMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-public class ToscaServiceTemplateTest {
+class ToscaServiceTemplateTest {
 
     @Test
-    public void testToscServiceTemplate() {
+    void testToscServiceTemplate() {
         assertThatThrownBy(() -> {
             new ToscaServiceTemplate(null);
         }).hasMessageMatching("copyObject is marked .*on.*ull but is null");
index 55ec39d..398dfb1 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP Policy Models
  * ================================================================================
  * Copyright (C) 2021 Nordix Foundation.
+ * Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.authorative.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.util.ArrayList;
 import java.util.HashMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-public class ToscaTopologyTemplateTest {
+class ToscaTopologyTemplateTest {
 
     @Test
-    public void testToscTopologyTemplate() {
+    void testToscTopologyTemplate() {
         assertThatThrownBy(() -> {
             new ToscaTopologyTemplate(null);
         }).hasMessageMatching("copyObject is marked .*on.*ull but is null");
index b83245d..b224a44 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2021 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,17 +24,17 @@ package org.onap.policy.models.tosca.authorative.concepts;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import com.google.gson.GsonBuilder;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.common.utils.resources.ResourceUtils;
@@ -47,7 +48,7 @@ import org.yaml.snakeyaml.Yaml;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class ToscaTypedEntityFilterTest {
+class ToscaTypedEntityFilterTest {
     private static final String VERSION_100 = "1.0.0";
 
     private static final String VERSION_000 = "0.0.0";
@@ -76,7 +77,7 @@ public class ToscaTypedEntityFilterTest {
      *
      * @throws CoderException on JSON decoding errors
      */
-    @BeforeClass
+    @BeforeAll
     public static void setupTypeList() throws CoderException {
         for (String policyResourceName : policyResourceNames) {
             String policyString = ResourceUtils.getResourceAsString(policyResourceName);
@@ -120,7 +121,7 @@ public class ToscaTypedEntityFilterTest {
     }
 
     @Test
-    public void testNullList() {
+    void testNullList() {
         ToscaTypedEntityFilter<ToscaPolicy> filter = ToscaTypedEntityFilter.<ToscaPolicy>builder().build();
 
         assertThatThrownBy(() -> {
@@ -129,7 +130,7 @@ public class ToscaTypedEntityFilterTest {
     }
 
     @Test
-    public void testFilterNothing() {
+    void testFilterNothing() {
         ToscaTypedEntityFilter<ToscaPolicy> filter = ToscaTypedEntityFilter.<ToscaPolicy>builder().build();
 
         List<ToscaPolicy> filteredList = filter.filter(policyList);
@@ -137,7 +138,7 @@ public class ToscaTypedEntityFilterTest {
     }
 
     @Test
-    public void testFilterLatestVersion() {
+    void testFilterLatestVersion() {
         ToscaTypedEntityFilter<ToscaPolicy> filter =
                 ToscaTypedEntityFilter.<ToscaPolicy>builder().version(ToscaTypedEntityFilter.LATEST_VERSION).build();
 
@@ -199,7 +200,7 @@ public class ToscaTypedEntityFilterTest {
     }
 
     @Test
-    public void testFilterNameVersion() {
+    void testFilterNameVersion() {
         ToscaTypedEntityFilter<ToscaPolicy> filter =
                 ToscaTypedEntityFilter.<ToscaPolicy>builder().name("operational.modifyconfig").build();
         List<ToscaPolicy> filteredList = filter.filter(policyList);
@@ -229,7 +230,7 @@ public class ToscaTypedEntityFilterTest {
     }
 
     @Test
-    public void testFilterVersionPrefix() {
+    void testFilterVersionPrefix() {
         // null pattern
         ToscaTypedEntityFilter<ToscaPolicy> filter =
                 ToscaTypedEntityFilter.<ToscaPolicy>builder().versionPrefix(null).build();
@@ -246,7 +247,7 @@ public class ToscaTypedEntityFilterTest {
     }
 
     @Test
-    public void testFilterTypeVersion() {
+    void testFilterTypeVersion() {
         ToscaTypedEntityFilter<ToscaPolicy> filter =
                 ToscaTypedEntityFilter.<ToscaPolicy>builder().type("onap.policies.controlloop.Operational").build();
         List<ToscaPolicy> filteredList = filter.filter(policyList);
index 213f93c..5fd391a 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.authorative.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
 
 import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-public class ToscaWithToscaPropertiesTest {
+class ToscaWithToscaPropertiesTest {
 
     @Test
-    public void test() {
+    void test() {
         ToscaProperty prop1 = new ToscaProperty();
         prop1.setDescription("description A");
 
index 79fb265..9c9d5ba 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.authorative.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
 
 import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-public class ToscaWithTypeAndObjectPropertiesTest {
+class ToscaWithTypeAndObjectPropertiesTest {
 
     @Test
-    public void testCopyConstructor() {
+    void testCopyConstructor() {
         ToscaWithTypeAndObjectProperties tosca = new ToscaWithTypeAndObjectProperties();
         assertEquals(tosca, new ToscaWithTypeAndObjectProperties(tosca));
 
index d433236..78058d9 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2020-2021, 2023-2024 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.authorative.provider;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import com.google.gson.GsonBuilder;
 import java.util.List;
 import java.util.Properties;
 import org.apache.commons.lang3.ObjectUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
+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.utils.coder.StandardCoder;
 import org.onap.policy.common.utils.resources.ResourceUtils;
 import org.onap.policy.models.base.PfConceptKey;
@@ -50,7 +51,7 @@ import org.yaml.snakeyaml.Yaml;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class AuthorativeToscaProviderGenericTest {
+class AuthorativeToscaProviderGenericTest {
     private static final String POLICY_NO_VERSION_VERSION1 = "onap.policies.NoVersion:0.0.1";
     private static final String POLICY_NO_VERSION = "onap.policies.NoVersion";
     private static final String DAO_IS_NULL = "^dao is marked .*on.*ull but is null$";
@@ -64,7 +65,7 @@ public class AuthorativeToscaProviderGenericTest {
      *
      * @throws Exception on errors
      */
-    @BeforeClass
+    @BeforeAll
     public static void readPolicyDefinition() {
         String yamlString = ResourceUtils.getResourceAsString("src/test/resources/onap.policies.NoVersion.yaml");
 
@@ -77,8 +78,8 @@ public class AuthorativeToscaProviderGenericTest {
      *
      * @throws Exception on database errors
      */
-    @Before
-    public void setupDao() throws Exception {
+    @BeforeEach
+    void setupDao() throws Exception {
         final DaoParameters daoParameters = new DaoParameters();
         daoParameters.setPluginClass(DefaultPfDao.class.getName());
 
@@ -104,18 +105,18 @@ public class AuthorativeToscaProviderGenericTest {
     /**
      * Set up GSON.
      */
-    @Before
-    public void setupGson() {
+    @BeforeEach
+    void setupGson() {
         standardCoder = new StandardCoder();
     }
 
-    @After
-    public void teardown() {
+    @AfterEach
+    void teardown() {
         pfDao.close();
     }
 
     @Test
-    public void testCreateGetDelete() throws Exception {
+    void testCreateGetDelete() throws Exception {
         assertThatThrownBy(() -> {
             new AuthorativeToscaProvider().getServiceTemplateList(null, null, null);
         }).hasMessageMatching(DAO_IS_NULL);
@@ -168,7 +169,7 @@ public class AuthorativeToscaProviderGenericTest {
     }
 
     @Test
-    public void testNullParameters() throws Exception {
+    void testNullParameters() throws Exception {
         assertThatThrownBy(() -> new AuthorativeToscaProvider().getServiceTemplateList(null, null, null))
             .hasMessageMatching("^dao is marked .*on.*ull but is null$");
 
index 69c4704..95cee32 100644 (file)
@@ -22,16 +22,16 @@ package org.onap.policy.models.tosca.authorative.provider;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
-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.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.common.utils.coder.YamlJsonTranslator;
@@ -49,7 +49,7 @@ import org.yaml.snakeyaml.Yaml;
 /**
  * Test of the {@link AuthorativeToscaProvider} class.
  */
-public class AuthorativeToscaProviderNodeTemplateTest {
+class AuthorativeToscaProviderNodeTemplateTest {
 
 
     private static final String NODE_TEMPLATES_JSON = "nodetemplates/nodetemplates.metadatasets.input.tosca.json";
@@ -70,8 +70,8 @@ public class AuthorativeToscaProviderNodeTemplateTest {
      * Read policy metadataSet input json.
      * @throws Exception Coder exception
      */
-    @Before
-    public void fetchToscaNodeTemplatesJson() throws Exception {
+    @BeforeEach
+    void fetchToscaNodeTemplatesJson() throws Exception {
         standardCoder = new StandardCoder();
         toscaServiceTemplate =
             standardCoder.decode(ResourceUtils.getResourceAsString(NODE_TEMPLATES_JSON), ToscaServiceTemplate.class);
@@ -87,8 +87,8 @@ public class AuthorativeToscaProviderNodeTemplateTest {
      *
      * @throws Exception on database errors
      */
-    @Before
-    public void setupDao() throws Exception {
+    @BeforeEach
+    void setupDao() throws Exception {
         final DaoParameters daoParameters = new DaoParameters();
         daoParameters.setPluginClass(DefaultPfDao.class.getName());
 
@@ -111,13 +111,13 @@ public class AuthorativeToscaProviderNodeTemplateTest {
         pfDao.init(daoParameters);
     }
 
-    @After
-    public void teardown() {
+    @AfterEach
+    void teardown() {
         pfDao.close();
     }
 
     @Test
-    public void testPolicyMetadataSetsGet() throws Exception {
+    void testPolicyMetadataSetsGet() throws Exception {
 
         assertThatThrownBy(() -> {
             authorativeToscaProvider.getNodeTemplateMetadataSet(null, null, null);
@@ -143,7 +143,7 @@ public class AuthorativeToscaProviderNodeTemplateTest {
     }
 
     @Test
-    public void testToscaNodeTemplatesGet() throws Exception {
+    void testToscaNodeTemplatesGet() throws Exception {
 
         assertThatThrownBy(() -> {
             authorativeToscaProvider.getToscaNodeTemplate(null, null, null);
@@ -169,7 +169,7 @@ public class AuthorativeToscaProviderNodeTemplateTest {
     }
 
     @Test
-    public void testToscaNodeTemplatesCreate() throws Exception {
+    void testToscaNodeTemplatesCreate() throws Exception {
         assertThatThrownBy(() -> {
             authorativeToscaProvider.createToscaNodeTemplates(null, null);
         }).hasMessageMatching(DAO_IS_NULL);
@@ -201,7 +201,7 @@ public class AuthorativeToscaProviderNodeTemplateTest {
     }
 
     @Test
-    public void testToscaNodeTemplateUpdate() throws Exception {
+    void testToscaNodeTemplateUpdate() throws Exception {
         assertThatThrownBy(() -> {
             authorativeToscaProvider.updateToscaNodeTemplates(null, null);
         }).hasMessageMatching(DAO_IS_NULL);
@@ -230,7 +230,7 @@ public class AuthorativeToscaProviderNodeTemplateTest {
     }
 
     @Test
-    public void testToscaNodeTemplateDelete() throws Exception {
+    void testToscaNodeTemplateDelete() throws Exception {
         assertThatThrownBy(() -> {
             authorativeToscaProvider.deleteToscaNodeTemplate(null, null, null);
         }).hasMessageMatching(DAO_IS_NULL);
@@ -266,7 +266,7 @@ public class AuthorativeToscaProviderNodeTemplateTest {
     }
 
     @Test
-    public void testNodeTemplatesWithExistingPolicy() throws Exception {
+    void testNodeTemplatesWithExistingPolicy() throws Exception {
         String policyString = ResourceUtils.getResourceAsString(POLICY_WITH_METADATA_SET_REF);
         ToscaServiceTemplate policyServiceTemplate =
             yamlJsonTranslator.fromYaml(policyString, ToscaServiceTemplate.class);
index 6100397..e796645 100644 (file)
 package org.onap.policy.models.tosca.authorative.provider;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
-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.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.common.utils.resources.ResourceUtils;
@@ -54,7 +54,7 @@ import org.yaml.snakeyaml.Yaml;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class AuthorativeToscaProviderPolicyTest {
+class AuthorativeToscaProviderPolicyTest {
     private static final String VERSION = "version";
     private static final String VCPE_JSON = "policies/vCPE.policy.monitoring.input.tosca.json";
     private static final String POLICY_AND_VERSION = "onap.restart.tca:1.0.0";
@@ -69,8 +69,8 @@ public class AuthorativeToscaProviderPolicyTest {
      *
      * @throws Exception on database errors
      */
-    @Before
-    public void setupDao() throws Exception {
+    @BeforeEach
+    void setupDao() throws Exception {
         final DaoParameters daoParameters = new DaoParameters();
         daoParameters.setPluginClass(DefaultPfDao.class.getName());
 
@@ -96,18 +96,18 @@ public class AuthorativeToscaProviderPolicyTest {
     /**
      * Set up GSON.
      */
-    @Before
-    public void setupGson() {
+    @BeforeEach
+    void setupGson() {
         standardCoder = new StandardCoder();
     }
 
-    @After
-    public void teardown() {
+    @AfterEach
+    void teardown() {
         pfDao.close();
     }
 
     @Test
-    public void testPoliciesGet() throws Exception {
+    void testPoliciesGet() throws Exception {
         assertThatThrownBy(() -> {
             new AuthorativeToscaProvider().getPolicies(null, null, null);
         }).hasMessageMatching(DAO_IS_NULL);
@@ -162,7 +162,7 @@ public class AuthorativeToscaProviderPolicyTest {
     }
 
     @Test
-    public void testPoliciesGetFiltered() throws Exception {
+    void testPoliciesGetFiltered() throws Exception {
         assertThatThrownBy(() -> {
             new AuthorativeToscaProvider().getFilteredPolicies(null, null);
         }).hasMessageMatching(DAO_IS_NULL);
@@ -250,7 +250,7 @@ public class AuthorativeToscaProviderPolicyTest {
     }
 
     @Test
-    public void testPolicyCreate() throws Exception {
+    void testPolicyCreate() throws Exception {
         assertThatThrownBy(() -> {
             new AuthorativeToscaProvider().createPolicies(null, null);
         }).hasMessageMatching(DAO_IS_NULL);
@@ -283,7 +283,7 @@ public class AuthorativeToscaProviderPolicyTest {
     }
 
     @Test
-    public void testPolicyUpdate() throws Exception {
+    void testPolicyUpdate() throws Exception {
         assertThatThrownBy(() -> {
             new AuthorativeToscaProvider().createPolicies(null, null);
         }).hasMessageMatching(DAO_IS_NULL);
@@ -328,7 +328,7 @@ public class AuthorativeToscaProviderPolicyTest {
     }
 
     @Test
-    public void testPoliciesDelete() throws Exception {
+    void testPoliciesDelete() throws Exception {
         assertThatThrownBy(() -> {
             new AuthorativeToscaProvider().deletePolicy(null, null, null);
         }).hasMessageMatching(DAO_IS_NULL);
@@ -391,7 +391,7 @@ public class AuthorativeToscaProviderPolicyTest {
     }
 
     @Test
-    public void testAssertPoliciesExist() {
+    void testAssertPoliciesExist() {
         ToscaServiceTemplate testServiceTemplate = new ToscaServiceTemplate();
 
         assertThatThrownBy(() -> {
@@ -414,7 +414,7 @@ public class AuthorativeToscaProviderPolicyTest {
     }
 
     @Test
-    public void testEntityMaps() throws CoderException, PfModelException {
+    void testEntityMaps() throws CoderException, PfModelException {
         Object yamlObject =
                 new Yaml().load(ResourceUtils.getResourceAsString("policytypes/onap.policies.monitoring.tcagen2.yaml"));
         String yamlAsJsonString = new StandardCoder().encode(yamlObject);
index 42ac127..b07535e 100644 (file)
 package org.onap.policy.models.tosca.authorative.provider;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import com.google.gson.GsonBuilder;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Properties;
 import org.apache.commons.lang3.ObjectUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
+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.utils.coder.StandardCoder;
 import org.onap.policy.common.utils.resources.ResourceUtils;
 import org.onap.policy.models.base.PfConceptKey;
@@ -51,7 +51,7 @@ import org.yaml.snakeyaml.Yaml;
 /**
  * Test of the {@link AuthorativeToscaProvider} class.
  */
-public class AuthorativeToscaProviderPolicyTypeTest {
+class AuthorativeToscaProviderPolicyTypeTest {
     private static final String VERSION = "version";
     private static final String POLICY_NO_VERSION_VERSION1 = "onap.policies.NoVersion:0.0.1";
     private static final String POLICY_NO_VERSION = "onap.policies.NoVersion";
@@ -67,7 +67,7 @@ public class AuthorativeToscaProviderPolicyTypeTest {
      *
      * @throws Exception on errors
      */
-    @BeforeClass
+    @BeforeAll
     public static void readPolicyDefinition() {
         String yamlString = ResourceUtils.getResourceAsString("src/test/resources/onap.policies.NoVersion.yaml");
 
@@ -80,8 +80,8 @@ public class AuthorativeToscaProviderPolicyTypeTest {
      *
      * @throws Exception on database errors
      */
-    @Before
-    public void setupDao() throws Exception {
+    @BeforeEach
+    void setupDao() throws Exception {
         final DaoParameters daoParameters = new DaoParameters();
         daoParameters.setPluginClass(DefaultPfDao.class.getName());
 
@@ -107,18 +107,18 @@ public class AuthorativeToscaProviderPolicyTypeTest {
     /**
      * Set up GSON.
      */
-    @Before
-    public void setupGson() {
+    @BeforeEach
+    void setupGson() {
         standardCoder = new StandardCoder();
     }
 
-    @After
-    public void teardown() {
+    @AfterEach
+    void teardown() {
         pfDao.close();
     }
 
     @Test
-    public void testPolicyTypesGet() throws Exception {
+    void testPolicyTypesGet() throws Exception {
         assertThatThrownBy(() -> {
             new AuthorativeToscaProvider().getPolicyTypes(null, null, null);
         }).hasMessageMatching(DAO_IS_NULL);
@@ -171,7 +171,7 @@ public class AuthorativeToscaProviderPolicyTypeTest {
     }
 
     @Test
-    public void testPolicyTypesGetFiltered() throws Exception {
+    void testPolicyTypesGetFiltered() throws Exception {
         assertThatThrownBy(() -> {
             new AuthorativeToscaProvider().getFilteredPolicyTypes(null, null);
         }).hasMessageMatching(DAO_IS_NULL);
@@ -268,7 +268,7 @@ public class AuthorativeToscaProviderPolicyTypeTest {
     }
 
     @Test
-    public void testPolicyTypesCreate() throws Exception {
+    void testPolicyTypesCreate() throws Exception {
         assertThatThrownBy(() -> {
             new AuthorativeToscaProvider().createPolicyTypes(null, null);
         }).hasMessageMatching(DAO_IS_NULL);
@@ -306,7 +306,7 @@ public class AuthorativeToscaProviderPolicyTypeTest {
     }
 
     @Test
-    public void testPolicyTypesUpdate() throws Exception {
+    void testPolicyTypesUpdate() throws Exception {
         assertThatThrownBy(() -> {
             new AuthorativeToscaProvider().createPolicyTypes(null, null);
         }).hasMessageMatching(DAO_IS_NULL);
@@ -345,7 +345,7 @@ public class AuthorativeToscaProviderPolicyTypeTest {
     }
 
     @Test
-    public void testPolicyTypesDelete() throws Exception {
+    void testPolicyTypesDelete() throws Exception {
         assertThatThrownBy(() -> {
             new AuthorativeToscaProvider().deletePolicyType(null, null, null);
         }).hasMessageMatching(DAO_IS_NULL);
@@ -400,7 +400,7 @@ public class AuthorativeToscaProviderPolicyTypeTest {
     }
 
     @Test
-    public void testAssertPoliciesExist() {
+    void testAssertPoliciesExist() {
         ToscaServiceTemplate testServiceTemplate = new ToscaServiceTemplate();
 
         assertThatThrownBy(() -> {
@@ -423,7 +423,7 @@ public class AuthorativeToscaProviderPolicyTypeTest {
     }
 
     @Test
-    public void testNullParameters() throws Exception {
+    void testNullParameters() throws Exception {
         assertThatThrownBy(() -> new AuthorativeToscaProvider().getPolicyTypeList(null, null, null))
                 .hasMessageMatching("^dao is marked .*on.*ull but is null$");
     }
index c4d9039..9067ae7 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Policy Model
  * ================================================================================
  * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 package org.onap.policy.models.tosca.authorative.provider;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.common.utils.coder.YamlJsonTranslator;
 import org.onap.policy.common.utils.resources.ResourceUtils;
@@ -42,18 +42,18 @@ import org.yaml.snakeyaml.Yaml;
  *
  * @author Chenfei Gao (cgao@research.att.com)
  */
-public class ToscaServiceTemplateMappingTest {
+class ToscaServiceTemplateMappingTest {
 
     private StandardCoder standardCoder;
     private YamlJsonTranslator yamlJsonTranslator = new YamlJsonTranslator();
 
-    @Before
-    public void setUp() {
+    @BeforeEach
+    void setUp() {
         standardCoder = new StandardCoder();
     }
 
     @Test
-    public void testPlainToscaPolicies() throws Exception {
+    void testPlainToscaPolicies() throws Exception {
         String policyTypeInputJson =
                 ResourceUtils.getResourceAsString("policytypes/onap.policies.monitoring.tcagen2.yaml");
         ToscaServiceTemplate plainPolicyTypes =
@@ -81,7 +81,7 @@ public class ToscaServiceTemplateMappingTest {
     }
 
     @Test
-    public void testPlainToscaPolicyTypes() throws Exception {
+    void testPlainToscaPolicyTypes() throws Exception {
         Yaml yaml = new Yaml();
         String inputYaml =
                 ResourceUtils.getResourceAsString("policytypes/onap.policies.monitoring.tcagen2.yaml");
index 4fcdd8c..f47a961 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2020-2021 Nordix Foundation.
  *  Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,14 +24,14 @@ package org.onap.policy.models.tosca.simple.concepts;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.Validated;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaCapabilityAssignment;
@@ -38,12 +39,12 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaCapabilityAssignme
 /**
  * DAO test for JpaToscaCapabilityAssignment.
  */
-public class JpaToscaCapabilityAssignmentTest {
+class JpaToscaCapabilityAssignmentTest {
 
     private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
 
     @Test
-    public void testPropertyPojo() {
+    void testPropertyPojo() {
         ToscaCapabilityAssignment tca = new ToscaCapabilityAssignment();
         tca.setName("world");
         tca.setVersion("1.2.3");
@@ -116,7 +117,7 @@ public class JpaToscaCapabilityAssignmentTest {
     }
 
     @Test
-    public void testCompareTo() {
+    void testCompareTo() {
         assertEquals(-1, new JpaToscaCapabilityAssignment().compareTo(null));
         assertEquals(0, new JpaToscaCapabilityAssignment().compareTo(new JpaToscaCapabilityAssignment()));
 
@@ -154,7 +155,7 @@ public class JpaToscaCapabilityAssignmentTest {
     }
 
     @Test
-    public void testAuthorative() {
+    void testAuthorative() {
         ToscaCapabilityAssignment tca = new ToscaCapabilityAssignment();
         tca.setName("world");
         tca.setVersion("1.2.3");
index 2fdd29c..9ac401a 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.simple.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import java.util.ArrayList;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConstraint;
 
 /**
@@ -35,12 +36,12 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConstraint;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class JpaToscaConstraintLogicalTest {
+class JpaToscaConstraintLogicalTest {
 
     private static final String HELLO = "Hello";
 
     @Test
-    public void testLogicalConstraint() {
+    void testLogicalConstraint() {
         ToscaConstraint c0 = new ToscaConstraint();
         c0.setEqual(HELLO);
         JpaToscaConstraintLogical jc0 = new JpaToscaConstraintLogical(c0);
index 02e3fda..62b7613 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2021, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.simple.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.util.ArrayList;
 import java.util.List;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConstraint;
 
 /**
@@ -36,12 +37,12 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConstraint;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class JpaToscaConstraintTest {
+class JpaToscaConstraintTest {
 
     private static final String CONSTRAINT = "Constraint";
 
     @Test
-    public void testConstraintLogicalStringPojo() {
+    void testConstraintLogicalStringPojo() {
         assertNotNull(new JpaToscaConstraintLogical(JpaToscaConstraintOperation.EQ, CONSTRAINT));
 
         assertThatThrownBy(() -> new JpaToscaConstraintLogical((JpaToscaConstraintOperation) null, null))
index 7399fdc..31bb55f 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2021 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.simple.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-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.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfKey;
 import org.onap.policy.models.base.PfReferenceKey;
@@ -44,12 +45,12 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaDataType;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class JpaToscaDataTypeTest {
+class JpaToscaDataTypeTest {
 
     private static final String VERSION_001 = "0.0.1";
 
     @Test
-    public void testDataTypePojo() {
+    void testDataTypePojo() {
         assertNotNull(new JpaToscaDataType());
         assertNotNull(new JpaToscaDataType(new PfConceptKey()));
         assertNotNull(new JpaToscaDataType(new JpaToscaDataType()));
@@ -64,7 +65,7 @@ public class JpaToscaDataTypeTest {
     }
 
     @Test
-    public void testDataTypeProperties() {
+    void testDataTypeProperties() {
         PfConceptKey dtKey = new PfConceptKey("tdt", VERSION_001);
         JpaToscaDataType tdt = new JpaToscaDataType(dtKey);
 
@@ -134,7 +135,7 @@ public class JpaToscaDataTypeTest {
     }
 
     @Test
-    public void testDataTypeConstraints() {
+    void testDataTypeConstraints() {
         ToscaDataType dat = new ToscaDataType();
         dat.setName("name");
         dat.setVersion("1.2.3");
@@ -152,7 +153,7 @@ public class JpaToscaDataTypeTest {
     }
 
     @Test
-    public void testGetReferencedDataTypes() {
+    void testGetReferencedDataTypes() {
         JpaToscaDataType dt0 = new JpaToscaDataType(new PfConceptKey("dt0", "0.0.1"));
 
         assertTrue(dt0.getReferencedDataTypes().isEmpty());
index 8f339ef..588cae1 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2021 Nordix Foundation.
+ *  Copyright (C) 2019-2024 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,27 +23,27 @@ package org.onap.policy.models.tosca.simple.concepts;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.parameters.BeanValidationResult;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.Validated;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaDataType;
 
-public class JpaToscaDataTypesTest {
+class JpaToscaDataTypesTest {
 
     private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
 
     @Test
-    public void testDataTypes() {
+    void testDataTypes() {
         assertNotNull(new JpaToscaDataTypes());
         assertNotNull(new JpaToscaDataTypes(new PfConceptKey()));
         assertNotNull(new JpaToscaDataTypes(new PfConceptKey(), new TreeMap<PfConceptKey, JpaToscaDataType>()));
@@ -64,7 +64,7 @@ public class JpaToscaDataTypesTest {
     }
 
     @Test
-    public void testDerivedDataTypes() {
+    void testDerivedDataTypes() {
         List<Map<String, ToscaDataType>> dtMapList = new ArrayList<>();
         dtMapList.add(new LinkedHashMap<>());
 
index 280f1b8..6d42fea 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2021 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.simple.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-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.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfReferenceKey;
 
@@ -37,7 +38,7 @@ import org.onap.policy.models.base.PfReferenceKey;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class JpaToscaEventFilterTest {
+class JpaToscaEventFilterTest {
 
     private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
     private static final String A_REQUREMENT = "A Requrement";
@@ -45,7 +46,7 @@ public class JpaToscaEventFilterTest {
     private static final String VERSION_001 = "0.0.1";
 
     @Test
-    public void testEventFilterPojo() {
+    void testEventFilterPojo() {
         assertNotNull(new JpaToscaEventFilter());
         assertNotNull(new JpaToscaEventFilter(new PfReferenceKey()));
         assertNotNull(new JpaToscaEventFilter(new PfReferenceKey(), new PfConceptKey()));
@@ -65,7 +66,7 @@ public class JpaToscaEventFilterTest {
     }
 
     @Test
-    public void testEventFilter() {
+    void testEventFilter() {
         PfConceptKey efParentKey = new PfConceptKey("tParentKey", VERSION_001);
         PfReferenceKey efKey = new PfReferenceKey(efParentKey, "trigger0");
         PfConceptKey nodeKey = new PfConceptKey("tParentKey", VERSION_001);
@@ -110,7 +111,7 @@ public class JpaToscaEventFilterTest {
     }
 
     @Test
-    public void testValidationEventFilter() {
+    void testValidationEventFilter() {
         PfConceptKey efParentKey = new PfConceptKey("tParentKey", VERSION_001);
         PfReferenceKey efKey = new PfReferenceKey(efParentKey, "trigger0");
         PfConceptKey nodeKey = new PfConceptKey("tParentKey", VERSION_001);
index eb050ec..a081e99 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2021 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.simple.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-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.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Map;
 import java.util.TreeMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfModelService;
 
@@ -39,13 +40,13 @@ import org.onap.policy.models.base.PfModelService;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class JpaToscaModelTest {
+class JpaToscaModelTest {
 
     private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
     private static final String VERSION_001 = "0.0.1";
 
     @Test
-    public void testModelPojo() {
+    void testModelPojo() {
         assertNotNull(new JpaToscaModel());
         assertNotNull(new JpaToscaModel(new PfConceptKey()));
         assertNotNull(new JpaToscaModel(new PfConceptKey(), new JpaToscaServiceTemplates()));
@@ -66,7 +67,7 @@ public class JpaToscaModelTest {
     }
 
     @Test
-    public void testJpaToscaModel() {
+    void testJpaToscaModel() {
         PfConceptKey tstsKey = new PfConceptKey("tsts", VERSION_001);
         Map<PfConceptKey, JpaToscaServiceTemplate> tstMap = new TreeMap<>();
         JpaToscaServiceTemplates tsts = new JpaToscaServiceTemplates(tstsKey, tstMap);
index 1c79091..564ae23 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2021 Nordix Foundation.
+ *  Copyright (C) 2019-2024 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,27 +23,27 @@ package org.onap.policy.models.tosca.simple.concepts;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.parameters.BeanValidationResult;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.Validated;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
 
-public class JpaToscaPoliciesTest {
+class JpaToscaPoliciesTest {
 
     private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
 
     @Test
-    public void testPoliciesErrors() {
+    void testPoliciesErrors() {
         assertNotNull(new JpaToscaPolicies());
         assertNotNull(new JpaToscaPolicies(new PfConceptKey()));
         assertNotNull(new JpaToscaPolicies(new PfConceptKey(), new TreeMap<PfConceptKey, JpaToscaPolicy>()));
@@ -64,7 +64,7 @@ public class JpaToscaPoliciesTest {
     }
 
     @Test
-    public void testToscaPolicies() {
+    void testToscaPolicies() {
         List<Map<String, ToscaPolicy>> polMapList = new ArrayList<>();
         polMapList.add(new LinkedHashMap<>());
 
index b455145..b075ac7 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2021 Nordix Foundation.
+ *  Copyright (C) 2019-2024 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 package org.onap.policy.models.tosca.simple.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-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.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfKey;
 import org.onap.policy.models.base.PfUtils;
@@ -44,13 +44,13 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class JpaToscaPolicyTest {
+class JpaToscaPolicyTest {
 
     private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
     private static final String VERSION_001 = "0.0.1";
 
     @Test
-    public void testPolicyPojo() {
+    void testPolicyPojo() {
         assertNotNull(new JpaToscaPolicy());
         assertNotNull(new JpaToscaPolicy(new PfConceptKey()));
         assertNotNull(new JpaToscaPolicy(new PfConceptKey(), new PfConceptKey()));
@@ -83,7 +83,7 @@ public class JpaToscaPolicyTest {
     }
 
     @Test
-    public void testJpaToscaPolicy() {
+    void testJpaToscaPolicy() {
         PfConceptKey tpKey = new PfConceptKey("tdt", VERSION_001);
         PfConceptKey ptKey = new PfConceptKey("policyType", VERSION_001);
         JpaToscaPolicy tp = new JpaToscaPolicy(tpKey, ptKey);
@@ -133,7 +133,7 @@ public class JpaToscaPolicyTest {
     }
 
     @Test
-    public void testJpaToscaPolicyValidation() {
+    void testJpaToscaPolicyValidation() {
         JpaToscaPolicy tp = setUpJpaToscaPolicy();
         assertFalse(new JpaToscaPolicy().validate("").isValid());
         assertTrue(tp.validate("").isValid());
@@ -160,7 +160,7 @@ public class JpaToscaPolicyTest {
     }
 
     @Test
-    public void testJpaToscaPolicyAuthorative() {
+    void testJpaToscaPolicyAuthorative() {
         JpaToscaPolicy tp = setUpJpaToscaPolicy();
         PfConceptKey tpTypeKey = tp.getKey();
         assertNotNull(tpTypeKey);
@@ -195,7 +195,7 @@ public class JpaToscaPolicyTest {
     }
 
     @Test
-    public void testPolicyProperties() {
+    void testPolicyProperties() {
 
         Map<String, Object> properties = new LinkedHashMap<>();
 
index 5cca879..7b626b5 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2021 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.simple.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-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.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfKey;
 import org.onap.policy.models.base.PfReferenceKey;
@@ -45,12 +46,12 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class JpaToscaPolicyTypeTest {
+class JpaToscaPolicyTypeTest {
     private static final String A_DESCRIPTION = "A Description";
     private static final String VERSION_001 = "0.0.1";
 
     @Test
-    public void testPolicyTypeNull() {
+    void testPolicyTypeNull() {
         assertNotNull(new JpaToscaPolicyType());
         assertNotNull(new JpaToscaPolicyType(new PfConceptKey()));
         assertNotNull(new JpaToscaPolicyType(new JpaToscaPolicyType()));
@@ -63,7 +64,7 @@ public class JpaToscaPolicyTypeTest {
     }
 
     @Test
-    public void testPolicyTypePojo() {
+    void testPolicyTypePojo() {
         PfConceptKey ptKey = new PfConceptKey("tdt", VERSION_001);
         JpaToscaPolicyType tpt = new JpaToscaPolicyType(ptKey);
 
@@ -133,7 +134,7 @@ public class JpaToscaPolicyTypeTest {
     }
 
     @Test
-    public void testPolicyTypeValidation() {
+    void testPolicyTypeValidation() {
         JpaToscaPolicyType tpt = setUpJpaToscaPolicyType();
 
         assertEquals(6, tpt.getKeys().size());
@@ -159,7 +160,7 @@ public class JpaToscaPolicyTypeTest {
     }
 
     @Test
-    public void testPolicyTypeValidation2() {
+    void testPolicyTypeValidation2() {
         JpaToscaPolicyType tpt = setUpJpaToscaPolicyType();
 
         tpt.getMetadata().put(null, null);
@@ -187,7 +188,7 @@ public class JpaToscaPolicyTypeTest {
     }
 
     @Test
-    public void testPolicyTypeEntity() {
+    void testPolicyTypeEntity() {
         JpaToscaPolicyType tpt = setUpJpaToscaPolicyType();
 
         assertThatThrownBy(() -> tpt.validate(null)).hasMessageMatching("fieldName is marked .*on.*ull but is null");
@@ -209,7 +210,7 @@ public class JpaToscaPolicyTypeTest {
     }
 
     @Test
-    public void testGetReferencedDataTypes() {
+    void testGetReferencedDataTypes() {
         JpaToscaPolicyType pt0 = new JpaToscaPolicyType(new PfConceptKey("pt0", "0.0.1"));
 
         assertTrue(pt0.getReferencedDataTypes().isEmpty());
index 2e8459b..844a829 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2021 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,27 +24,27 @@ package org.onap.policy.models.tosca.simple.concepts;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.parameters.BeanValidationResult;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.Validated;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
 
-public class JpaToscaPolicyTypesTest {
+class JpaToscaPolicyTypesTest {
 
     private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
 
     @Test
-    public void testPolicyTypesNull() {
+    void testPolicyTypesNull() {
         assertNotNull(new JpaToscaPolicyTypes());
         assertNotNull(new JpaToscaPolicyTypes(new PfConceptKey()));
         assertNotNull(new JpaToscaPolicyTypes(new PfConceptKey(), new TreeMap<PfConceptKey, JpaToscaPolicyType>()));
@@ -64,7 +65,7 @@ public class JpaToscaPolicyTypesTest {
     }
 
     @Test
-    public void testPolicyTypes() {
+    void testPolicyTypes() {
         List<Map<String, ToscaPolicyType>> ptMapList = new ArrayList<>();
         ptMapList.add(new LinkedHashMap<>());
 
index ffa2124..ad870ce 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2021, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.simple.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertSame;
-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.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotSame;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfReferenceKey;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaProperty;
@@ -44,7 +45,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaProperty;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class JpaToscaPropertyTest {
+class JpaToscaPropertyTest {
 
     private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
     private static final String DEFAULT_KEY = "defaultKey";
@@ -52,7 +53,7 @@ public class JpaToscaPropertyTest {
     private static final String VERSION_001 = "0.0.1";
 
     @Test
-    public void testPropertyNull() {
+    void testPropertyNull() {
         assertNotNull(new JpaToscaProperty());
         assertNotNull(new JpaToscaProperty(new PfReferenceKey()));
         assertNotNull(new JpaToscaProperty(new PfReferenceKey(), new PfConceptKey()));
@@ -69,7 +70,7 @@ public class JpaToscaPropertyTest {
     }
 
     @Test
-    public void testProperty() {
+    void testProperty() {
         PfConceptKey pparentKey = new PfConceptKey("tParentKey", VERSION_001);
         PfReferenceKey pkey = new PfReferenceKey(pparentKey, "trigger0");
         PfConceptKey ptypeKey = new PfConceptKey("TTypeKey", VERSION_001);
@@ -119,7 +120,7 @@ public class JpaToscaPropertyTest {
     }
 
     @Test
-    public void testPropertyCompareData() {
+    void testPropertyCompareData() {
         JpaToscaProperty tp = setUpJpaToscaProperty();
 
         PfReferenceKey otherDtKey = new PfReferenceKey("otherDt", VERSION_001, "OtherProperty");
@@ -180,7 +181,7 @@ public class JpaToscaPropertyTest {
     }
 
     @Test
-    public void testPropertyCompareDescription() {
+    void testPropertyCompareDescription() {
         JpaToscaProperty tp = setUpJpaToscaProperty();
         JpaToscaProperty tdtClone0 = new JpaToscaProperty(tp);
 
@@ -203,7 +204,7 @@ public class JpaToscaPropertyTest {
     }
 
     @Test
-    public void testPropertyCompareMetadata() {
+    void testPropertyCompareMetadata() {
         JpaToscaProperty tp = setUpJpaToscaProperty();
         PfConceptKey typeKey = new PfConceptKey("type", VERSION_001);
         tp.setType(typeKey);
@@ -233,7 +234,7 @@ public class JpaToscaPropertyTest {
     }
 
     @Test
-    public void testToAuthorative_testFromAuthorative() {
+    void testToAuthorative_testFromAuthorative() {
         // check with empty structure
         JpaToscaProperty tp = new JpaToscaProperty();
         ToscaProperty auth = tp.toAuthorative();
index a8d4f34..9cab6eb 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2021 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.simple.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-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.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
 import java.util.List;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.base.PfConceptKey;
 
 /**
@@ -38,12 +39,12 @@ import org.onap.policy.models.base.PfConceptKey;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class JpaToscaSchemaDefinitionTest {
+class JpaToscaSchemaDefinitionTest {
 
     private static final String A_DESCRIPTION = "A Description";
 
     @Test
-    public void testEntrySchemaNull() {
+    void testEntrySchemaNull() {
         assertNotNull(new JpaToscaSchemaDefinition(new PfConceptKey()));
         assertNotNull(new JpaToscaSchemaDefinition(new JpaToscaSchemaDefinition(new PfConceptKey())));
 
@@ -55,7 +56,7 @@ public class JpaToscaSchemaDefinitionTest {
     }
 
     @Test
-    public void testEntrySchema() {
+    void testEntrySchema() {
         PfConceptKey typeKey = new PfConceptKey("type", "0.0.1");
         JpaToscaSchemaDefinition tes = new JpaToscaSchemaDefinition(typeKey);
 
@@ -100,7 +101,7 @@ public class JpaToscaSchemaDefinitionTest {
     }
 
     @Test
-    public void testEntrySchemaValidation() {
+    void testEntrySchemaValidation() {
         PfConceptKey typeKey = new PfConceptKey("type", "0.0.1");
         JpaToscaSchemaDefinition tes = setUpJpaToscaSchemaDefinition(typeKey);
 
index 6296788..d7d7b39 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2021, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,16 +24,16 @@ package org.onap.policy.models.tosca.simple.concepts;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-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.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.TreeMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.parameters.BeanValidationResult;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfReferenceKey;
@@ -43,13 +44,13 @@ import org.onap.policy.models.base.Validated;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class JpaToscaServiceTemplateTest {
+class JpaToscaServiceTemplateTest {
 
     private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
     private static final String VERSION_001 = "0.0.1";
 
     @Test
-    public void testServiceTemplateNull() {
+    void testServiceTemplateNull() {
         assertNotNull(new JpaToscaServiceTemplate());
         assertNotNull(new JpaToscaServiceTemplate(new PfConceptKey()));
         assertNotNull(new JpaToscaServiceTemplate(new PfConceptKey(), ""));
@@ -69,7 +70,7 @@ public class JpaToscaServiceTemplateTest {
     }
 
     @Test
-    public void testServiceTemplatePojo() {
+    void testServiceTemplatePojo() {
         PfConceptKey tstKey = new PfConceptKey("tst", VERSION_001);
         JpaToscaServiceTemplate tst = new JpaToscaServiceTemplate(tstKey, "Tosca Version");
 
index a019a97..c115998 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2020 Nordix Foundation.
  *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.simple.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
 
-public class JpaToscaServiceTemplatesTest {
+class JpaToscaServiceTemplatesTest {
 
     private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
 
     @Test
-    public void testServiceTemplates() {
+    void testServiceTemplates() {
         assertNotNull(new JpaToscaServiceTemplates());
         assertNotNull(new JpaToscaServiceTemplates(new PfConceptKey()));
         assertNotNull(
index 7e8b781..92a5972 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2021 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.simple.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-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.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.sql.Timestamp;
 import java.time.Instant;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfReferenceKey;
 
@@ -39,12 +40,12 @@ import org.onap.policy.models.base.PfReferenceKey;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class JpaToscaTimeIntervalTest {
+class JpaToscaTimeIntervalTest {
 
     private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
 
     @Test
-    public void testTimeIntervalPojo() {
+    void testTimeIntervalPojo() {
         assertNotNull(new JpaToscaTimeInterval());
         assertNotNull(new JpaToscaTimeInterval(new PfReferenceKey()));
         assertNotNull(new JpaToscaTimeInterval(new PfReferenceKey(), Instant.now(), Instant.now()));
@@ -75,7 +76,7 @@ public class JpaToscaTimeIntervalTest {
     }
 
     @Test
-    public void testTimeInterval() {
+    void testTimeInterval() {
         PfConceptKey ttiParentKey = new PfConceptKey("tParentKey", "0.0.1");
         PfReferenceKey ttiKey = new PfReferenceKey(ttiParentKey, "trigger0");
         Instant startTime = Instant.ofEpochSecond(1000);
@@ -114,7 +115,7 @@ public class JpaToscaTimeIntervalTest {
     }
 
     @Test
-    public void testTimeIntervalValidation() {
+    void testTimeIntervalValidation() {
         Instant startTime = Instant.ofEpochSecond(1000);
         Instant endTime = Instant.ofEpochSecond(2000);
         JpaToscaTimeInterval tti = setUpJpaToscaTimeInterval(startTime, endTime);
index 3790329..8c9154b 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2021 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.simple.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-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.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Map;
 import java.util.TreeMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfReferenceKey;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaTopologyTemplate;
@@ -40,13 +41,13 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaTopologyTemplate;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class JpaToscaTopologyTemplateTest {
+class JpaToscaTopologyTemplateTest {
 
     private static final String A_DESCRIPTION = "A Description";
     private static final String VERSION_001 = "0.0.1";
 
     @Test
-    public void testTopologyTemplatePojo() {
+    void testTopologyTemplatePojo() {
         assertNotNull(new JpaToscaTopologyTemplate());
         assertNotNull(new JpaToscaTopologyTemplate(new PfReferenceKey()));
         assertNotNull(new JpaToscaTopologyTemplate(new JpaToscaTopologyTemplate()));
@@ -63,7 +64,7 @@ public class JpaToscaTopologyTemplateTest {
     }
 
     @Test
-    public void testTopologyTemplates() {
+    void testTopologyTemplates() {
         PfReferenceKey tttKey = new PfReferenceKey("tst", VERSION_001, "ttt");
         JpaToscaTopologyTemplate ttt = new JpaToscaTopologyTemplate(tttKey);
 
@@ -106,7 +107,7 @@ public class JpaToscaTopologyTemplateTest {
     }
 
     @Test
-    public void testTopologyTemplateValidation() {
+    void testTopologyTemplateValidation() {
         PfReferenceKey tttKey = new PfReferenceKey("tst", VERSION_001, "ttt");
         JpaToscaTopologyTemplate ttt = new JpaToscaTopologyTemplate(tttKey);
 
index 597ce0c..26995e9 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2021 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.simple.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-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.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.time.Duration;
 import java.time.Instant;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfReferenceKey;
 
@@ -39,7 +40,7 @@ import org.onap.policy.models.base.PfReferenceKey;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class JpaToscaTriggerTest {
+class JpaToscaTriggerTest {
 
     private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
     private static final String EVENT_TYPE = "EventType";
@@ -49,7 +50,7 @@ public class JpaToscaTriggerTest {
     private static final String VERSION_001 = "0.0.1";
 
     @Test
-    public void testTriggerPojo() {
+    void testTriggerPojo() {
         assertNotNull(new JpaToscaTrigger());
         assertNotNull(new JpaToscaTrigger(new PfReferenceKey()));
         assertNotNull(new JpaToscaTrigger(new PfReferenceKey(), EVENT_TYPE, ACTION));
@@ -78,7 +79,7 @@ public class JpaToscaTriggerTest {
     }
 
     @Test
-    public void testTriggerConstraints() {
+    void testTriggerConstraints() {
         PfConceptKey tparentKey = new PfConceptKey("tParentKey", VERSION_001);
         PfReferenceKey tkey = new PfReferenceKey(tparentKey, "trigger0");
         JpaToscaTrigger tdt = new JpaToscaTrigger(tkey, EVENT_TYPE, ACTION);
@@ -151,7 +152,7 @@ public class JpaToscaTriggerTest {
     }
 
     @Test
-    public void testCloneToscaTrigger() {
+    void testCloneToscaTrigger() {
         PfConceptKey tparentKey = new PfConceptKey("tParentKey", VERSION_001);
         PfReferenceKey tkey = new PfReferenceKey(tparentKey, "trigger0");
         JpaToscaTrigger tdt = new JpaToscaTrigger(tkey, EVENT_TYPE, ACTION);
index f232fcb..e94c325 100644 (file)
@@ -4,6 +4,7 @@
  * ================================================================================
  * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2021 Nordix Foundation.
+ * Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.simple.concepts;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.List;
 import java.util.Map;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
 import lombok.Setter;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.parameters.annotations.NotNull;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaWithTypeAndObjectProperties;
 
-public class JpaToscaWithStringPropertiesTest {
+class JpaToscaWithStringPropertiesTest {
     private static final String SOME_DESCRIPTION = "some description";
     private static final String KEY1 = "abc";
     private static final String KEY2 = "def";
@@ -46,13 +47,13 @@ public class JpaToscaWithStringPropertiesTest {
 
     private MyJpa jpa;
 
-    @Before
-    public void setUp() {
+    @BeforeEach
+    void setUp() {
         jpa = new MyJpa();
     }
 
     @Test
-    public void testGetKeys() {
+    void testGetKeys() {
         PfConceptKey key = new PfConceptKey("bye", "9.8.7");
         PfConceptKey typeKey = new PfConceptKey("type", "6.5.4");
 
@@ -65,7 +66,7 @@ public class JpaToscaWithStringPropertiesTest {
     }
 
     @Test
-    public void testClean() {
+    void testClean() {
         jpa.setDescription("  some description  ");
         jpa.setProperties(Map.of(KEY1, "10 ", KEY2, " 20"));
 
@@ -75,7 +76,7 @@ public class JpaToscaWithStringPropertiesTest {
     }
 
     @Test
-    public void testToAuthorative() {
+    void testToAuthorative() {
         jpa.setDescription(SOME_DESCRIPTION);
         jpa.setProperties(Map.of(KEY1, STRING1, KEY2, STRING2));
 
@@ -85,7 +86,7 @@ public class JpaToscaWithStringPropertiesTest {
     }
 
     @Test
-    public void testFromAuthorative() {
+    void testFromAuthorative() {
         MyTosca tosca = new MyTosca();
         tosca.setType("type");
         tosca.setTypeVersion("1.2.3");
@@ -104,7 +105,7 @@ public class JpaToscaWithStringPropertiesTest {
     }
 
     @Test
-    public void testCompareTo() {
+    void testCompareTo() {
         jpa.setDescription(SOME_DESCRIPTION);
         jpa.setProperties(Map.of(KEY1, STRING1, KEY2, STRING2));
 
@@ -120,14 +121,14 @@ public class JpaToscaWithStringPropertiesTest {
     }
 
     @Test
-    public void testJpaToscaWithStringProperties() {
+    void testJpaToscaWithStringProperties() {
         assertThat(jpa.getProperties()).isNull();
         assertThat(jpa.getKey().isNullKey()).isTrue();
 
     }
 
     @Test
-    public void testJpaToscaWithStringPropertiesPfConceptKey() {
+    void testJpaToscaWithStringPropertiesPfConceptKey() {
         PfConceptKey key = new PfConceptKey("hello", "1.2.3");
 
         jpa = new MyJpa(key);
@@ -135,7 +136,7 @@ public class JpaToscaWithStringPropertiesTest {
     }
 
     @Test
-    public void testJpaToscaWithStringPropertiesJpaToscaWithStringPropertiesOfT() {
+    void testJpaToscaWithStringPropertiesJpaToscaWithStringPropertiesOfT() {
         jpa.setDescription(SOME_DESCRIPTION);
         assertEquals(jpa, new MyJpa(jpa));
 
@@ -144,7 +145,7 @@ public class JpaToscaWithStringPropertiesTest {
     }
 
     @Test
-    public void testJpaToscaWithStringPropertiesT() {
+    void testJpaToscaWithStringPropertiesT() {
         MyTosca tosca = new MyTosca();
         tosca.setName("world");
         tosca.setVersion("3.2.1");
@@ -161,7 +162,7 @@ public class JpaToscaWithStringPropertiesTest {
     }
 
     @Test
-    public void testValidateWithKey() {
+    void testValidateWithKey() {
         // null key - should fail
         jpa.setText("some text");
         assertThat(jpa.validateWithKey("fieldA").isValid()).isFalse();
index e259edf..6defc85 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,7 +22,7 @@
 package org.onap.policy.models.tosca.simple.concepts;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -30,9 +31,9 @@ import java.util.Map;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
 import lombok.Setter;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.parameters.annotations.NotNull;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfKey;
@@ -40,7 +41,7 @@ import org.onap.policy.models.base.PfReferenceKey;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaProperty;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaWithToscaProperties;
 
-public class JpaToscaWithToscaPropertiesTest {
+class JpaToscaWithToscaPropertiesTest {
     private static final String SOME_DESCRIPTION = "some description";
     private static final String KEY1 = "abc";
     private static final String KEY2 = "def";
@@ -60,7 +61,7 @@ public class JpaToscaWithToscaPropertiesTest {
     /**
      * Initializes the properties.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JPA_PROP1.setDescription(DESCRIPT1);
         JPA_PROP2.setDescription(DESCRIPT2);
@@ -69,13 +70,13 @@ public class JpaToscaWithToscaPropertiesTest {
         PROP2 = JPA_PROP2.toAuthorative();
     }
 
-    @Before
-    public void setUp() {
+    @BeforeEach
+    void setUp() {
         jpa = new MyJpa();
     }
 
     @Test
-    public void testGetKeys() {
+    void testGetKeys() {
         PfConceptKey key = new PfConceptKey("bye", "9.8.7");
 
         jpa = new MyJpa(key);
@@ -92,7 +93,7 @@ public class JpaToscaWithToscaPropertiesTest {
     }
 
     @Test
-    public void testClean() {
+    void testClean() {
         jpa.clean();
 
         jpa.setDescription("  some description  ");
@@ -111,7 +112,7 @@ public class JpaToscaWithToscaPropertiesTest {
     }
 
     @Test
-    public void testToAuthorative() {
+    void testToAuthorative() {
         jpa.setDescription(SOME_DESCRIPTION);
         jpa.setProperties(Map.of(KEY1, JPA_PROP1, KEY2, JPA_PROP2));
 
@@ -121,7 +122,7 @@ public class JpaToscaWithToscaPropertiesTest {
     }
 
     @Test
-    public void testFromAuthorative() {
+    void testFromAuthorative() {
         MyTosca tosca = new MyTosca();
         tosca.setDescription(SOME_DESCRIPTION);
 
@@ -144,7 +145,7 @@ public class JpaToscaWithToscaPropertiesTest {
     }
 
     @Test
-    public void testCompareTo() {
+    void testCompareTo() {
         jpa.setDescription(SOME_DESCRIPTION);
         jpa.setProperties(Map.of(KEY1, JPA_PROP1, KEY2, JPA_PROP2));
 
@@ -160,19 +161,19 @@ public class JpaToscaWithToscaPropertiesTest {
     }
 
     @Test
-    public void testJpaToscaWithToscaProperties() {
+    void testJpaToscaWithToscaProperties() {
         assertThat(jpa.getProperties()).isNull();
         assertThat(jpa.getKey().isNullKey()).isTrue();
     }
 
     @Test
-    public void testJpaToscaWithToscaPropertiesPfConceptKey() {
+    void testJpaToscaWithToscaPropertiesPfConceptKey() {
         jpa = new MyJpa(CONCEPT_KEY1);
         assertEquals(CONCEPT_KEY1, jpa.getKey());
     }
 
     @Test
-    public void testJpaToscaWithToscaPropertiesJpaToscaWithToscaPropertiesOfT() {
+    void testJpaToscaWithToscaPropertiesJpaToscaWithToscaPropertiesOfT() {
         jpa.setDescription(SOME_DESCRIPTION);
         assertEquals(jpa, new MyJpa(jpa));
 
@@ -181,7 +182,7 @@ public class JpaToscaWithToscaPropertiesTest {
     }
 
     @Test
-    public void testJpaToscaWithToscaPropertiesT() {
+    void testJpaToscaWithToscaPropertiesT() {
         MyTosca tosca = new MyTosca();
         tosca.setName("world");
         tosca.setVersion("3.2.1");
@@ -203,7 +204,7 @@ public class JpaToscaWithToscaPropertiesTest {
     }
 
     @Test
-    public void testValidateWithKey() {
+    void testValidateWithKey() {
         // null key - should fail
         jpa.setText("some text");
         assertThat(jpa.validateWithKey("fieldA").isValid()).isFalse();
@@ -218,7 +219,7 @@ public class JpaToscaWithToscaPropertiesTest {
     }
 
     @Test
-    public void testGetReferencedDataTypes() {
+    void testGetReferencedDataTypes() {
         assertThat(jpa.getReferencedDataTypes()).isEmpty();
 
         // one with a schema
index 250a819..2ac2ce6 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Policy Model
  * ================================================================================
  * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@ import com.openpojo.validation.ValidatorBuilder;
 import com.openpojo.validation.rule.impl.GetterMustExistRule;
 import com.openpojo.validation.test.impl.GetterTester;
 import com.openpojo.validation.test.impl.SetterTester;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.utils.test.ToStringTester;
 
 /**
@@ -38,11 +38,11 @@ import org.onap.policy.common.utils.test.ToStringTester;
  * @author Chenfei Gao (cgao@research.att.com)
  *
  */
-public class TestPojos {
+class TestPojos {
     private static final String POJO_PACKAGE = "org.onap.policy.models.tosca.simple.concepts";
 
     @Test
-    public void testPojos() {
+    void testPojos() {
         // @formatter:off
         final Validator validator = ValidatorBuilder
                 .create()
index 98dfdae..a789cd5 100644 (file)
 package org.onap.policy.models.tosca.simple.provider;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.Properties;
 import java.util.TreeMap;
-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.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.common.utils.resources.ResourceUtils;
@@ -65,7 +65,7 @@ import org.yaml.snakeyaml.Yaml;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class SimpleToscaProviderTest {
+class SimpleToscaProviderTest {
     private static final String TEMPLATE_IS_NULL = "^serviceTemplate is marked .*on.*ull but is null$";
     private static final String INCOMING_TEMPLATE_IS_NULL = "^incomingServiceTemplate is marked .*on.*ull but is null$";
     private static final String VCPE_INPUT_JSON = "policies/vCPE.policy.monitoring.input.tosca.json";
@@ -79,8 +79,8 @@ public class SimpleToscaProviderTest {
      *
      * @throws Exception on database errors
      */
-    @Before
-    public void setupDao() throws Exception {
+    @BeforeEach
+    void setupDao() throws Exception {
         final DaoParameters daoParameters = new DaoParameters();
         daoParameters.setPluginClass(DefaultPfDao.class.getName());
 
@@ -107,18 +107,18 @@ public class SimpleToscaProviderTest {
     /**
      * Set up GSON.
      */
-    @Before
-    public void setupGson() {
+    @BeforeEach
+    void setupGson() {
         standardCoder = new StandardCoder();
     }
 
-    @After
-    public void teardown() {
+    @AfterEach
+    void teardown() {
         pfDao.close();
     }
 
     @Test
-    public void testCreateUpdateGetDeleteDataType() throws PfModelException {
+    void testCreateUpdateGetDeleteDataType() throws PfModelException {
         PfConceptKey dataType0Key = new PfConceptKey("DataType0", "0.0.1");
         JpaToscaDataType dataType0 = new JpaToscaDataType();
         dataType0.setKey(dataType0Key);
@@ -217,7 +217,7 @@ public class SimpleToscaProviderTest {
     }
 
     @Test
-    public void testCreateUpdateGetDeletePolicyType() throws PfModelException {
+    void testCreateUpdateGetDeletePolicyType() throws PfModelException {
         JpaToscaServiceTemplate serviceTemplate = new JpaToscaServiceTemplate();
 
         PfConceptKey dataType0Key = new PfConceptKey("DataType0", "0.0.1");
@@ -310,7 +310,7 @@ public class SimpleToscaProviderTest {
     }
 
     @Test
-    public void testCreateUpdateGetDeletePolicyTypeWithDataType() throws PfModelException {
+    void testCreateUpdateGetDeletePolicyTypeWithDataType() throws PfModelException {
         PfConceptKey policyType0Key = new PfConceptKey("PolicyType0", "0.0.1");
         JpaToscaPolicyType policyType0 = new JpaToscaPolicyType();
         policyType0.setKey(policyType0Key);
@@ -356,7 +356,7 @@ public class SimpleToscaProviderTest {
     }
 
     @Test
-    public void testPoliciesGet() throws Exception {
+    void testPoliciesGet() throws Exception {
         ToscaServiceTemplate toscaServiceTemplate =
             standardCoder.decode(ResourceUtils.getResourceAsString(VCPE_INPUT_JSON), ToscaServiceTemplate.class);
 
@@ -385,7 +385,7 @@ public class SimpleToscaProviderTest {
     }
 
     @Test
-    public void testPolicyCreate() throws Exception {
+    void testPolicyCreate() throws Exception {
         ToscaServiceTemplate toscaServiceTemplate =
             standardCoder.decode(ResourceUtils.getResourceAsString(VCPE_INPUT_JSON), ToscaServiceTemplate.class);
 
@@ -403,7 +403,7 @@ public class SimpleToscaProviderTest {
     }
 
     @Test
-    public void testPolicyCreateTypeAndVersion() throws Exception {
+    void testPolicyCreateTypeAndVersion() throws Exception {
         ToscaServiceTemplate toscaServiceTemplate =
             standardCoder.decode(ResourceUtils.getResourceAsString(VCPE_INPUT_JSON), ToscaServiceTemplate.class);
 
@@ -462,7 +462,7 @@ public class SimpleToscaProviderTest {
     }
 
     @Test
-    public void testPolicyUpdate() throws Exception {
+    void testPolicyUpdate() throws Exception {
         ToscaServiceTemplate toscaServiceTemplate =
             standardCoder.decode(ResourceUtils.getResourceAsString(VCPE_INPUT_JSON), ToscaServiceTemplate.class);
 
@@ -479,7 +479,7 @@ public class SimpleToscaProviderTest {
     }
 
     @Test
-    public void testPoliciesDelete() throws Exception {
+    void testPoliciesDelete() throws Exception {
         ToscaServiceTemplate toscaServiceTemplate =
             standardCoder.decode(ResourceUtils.getResourceAsString(VCPE_INPUT_JSON), ToscaServiceTemplate.class);
 
@@ -515,7 +515,7 @@ public class SimpleToscaProviderTest {
     }
 
     @Test
-    public void testAssertPoliciesExist() {
+    void testAssertPoliciesExist() {
         JpaToscaServiceTemplate testServiceTemplate = new JpaToscaServiceTemplate();
 
         assertThatThrownBy(() -> new SimpleToscaProvider().createPolicies(pfDao, testServiceTemplate))
@@ -531,13 +531,13 @@ public class SimpleToscaProviderTest {
     }
 
     @Test
-    public void testGetServiceTemplate() throws PfModelException {
+    void testGetServiceTemplate() throws PfModelException {
         assertThatThrownBy(() -> new SimpleToscaProvider().getServiceTemplate(pfDao))
             .hasMessage("service template not found in database");
     }
 
     @Test
-    public void testAppendToServiceTemplate() throws PfModelException {
+    void testAppendToServiceTemplate() throws PfModelException {
         JpaToscaServiceTemplate serviceTemplateFragment = new JpaToscaServiceTemplate();
         serviceTemplateFragment.setPolicyTypes(new JpaToscaPolicyTypes());
         JpaToscaPolicyType badPt = new JpaToscaPolicyType();
@@ -549,7 +549,7 @@ public class SimpleToscaProviderTest {
     }
 
     @Test
-    public void testGetDataTypesCornerCases() throws PfModelException {
+    void testGetDataTypesCornerCases() throws PfModelException {
         assertThatThrownBy(() -> {
             new SimpleToscaProvider().getDataTypes(pfDao, "hello", "0.0.1");
         }).hasMessageMatching("service template not found in database");
@@ -612,7 +612,7 @@ public class SimpleToscaProviderTest {
     }
 
     @Test
-    public void testGetPolicyTypesCornerCases() throws PfModelException {
+    void testGetPolicyTypesCornerCases() throws PfModelException {
         assertThatThrownBy(() -> {
             new SimpleToscaProvider().getPolicyTypes(pfDao, "hello", "0.0.1");
         }).hasMessageMatching("service template not found in database");
@@ -677,7 +677,7 @@ public class SimpleToscaProviderTest {
     }
 
     @Test
-    public void testGetPoliciesCornerCases() throws PfModelException {
+    void testGetPoliciesCornerCases() throws PfModelException {
         assertThatThrownBy(() -> {
             new SimpleToscaProvider().getPolicies(pfDao, "hello", "0.0.1");
         }).hasMessageMatching("service template not found in database");
@@ -755,7 +755,7 @@ public class SimpleToscaProviderTest {
     }
 
     @Test
-    public void testNonNullsDataType() {
+    void testNonNullsDataType() {
         assertThatThrownBy(() -> {
             new SimpleToscaProvider().getServiceTemplate(null);
         }).hasMessageMatching(DAO_IS_NULL);
@@ -814,7 +814,7 @@ public class SimpleToscaProviderTest {
     }
 
     @Test
-    public void testNotNullsPolicyTypes() {
+    void testNotNullsPolicyTypes() {
         assertThatThrownBy(() -> {
             new SimpleToscaProvider().getPolicyTypes(null, null, null);
         }).hasMessageMatching(DAO_IS_NULL);
@@ -897,7 +897,7 @@ public class SimpleToscaProviderTest {
     }
 
     @Test
-    public void testDeleteServiceTemplate() throws PfModelException {
+    void testDeleteServiceTemplate() throws PfModelException {
         assertThatThrownBy(() -> {
             new SimpleToscaProvider().deleteServiceTemplate(null);
         }).hasMessageMatching("^dao is marked .*on.*ull but is null$");
@@ -930,7 +930,7 @@ public class SimpleToscaProviderTest {
     }
 
     @Test
-    public void testNullParameters() {
+    void testNullParameters() {
         assertThatThrownBy(() -> {
             new SimpleToscaProvider().getCascadedDataTypes(null, null, null);
         }).hasMessageMatching("^dbServiceTemplate is marked .*on.*ull but is null$");
index 1d6be1b..205d3ba 100644 (file)
 package org.onap.policy.models.tosca.simple.provider;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.Properties;
 import java.util.TreeMap;
-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.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfModelException;
 import org.onap.policy.models.dao.DaoParameters;
@@ -52,7 +52,7 @@ import org.onap.policy.models.tosca.simple.concepts.JpaToscaTrigger;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class SimpleToscaServiceTemplateProviderTest {
+class SimpleToscaServiceTemplateProviderTest {
     private static final String TEMPLATE_IS_NULL = "^serviceTemplate is marked .*on.*ull but is null$";
     private static final String DAO_IS_NULL = "^dao is marked .*on.*ull but is null$";
 
@@ -63,8 +63,8 @@ public class SimpleToscaServiceTemplateProviderTest {
      *
      * @throws Exception on database errors
      */
-    @Before
-    public void setupDao() throws Exception {
+    @BeforeEach
+    void setupDao() throws Exception {
         final DaoParameters daoParameters = new DaoParameters();
         daoParameters.setPluginClass(DefaultPfDao.class.getName());
 
@@ -89,13 +89,13 @@ public class SimpleToscaServiceTemplateProviderTest {
         pfDao.init(daoParameters);
     }
 
-    @After
-    public void teardown() {
+    @AfterEach
+    void teardown() {
         pfDao.close();
     }
 
     @Test
-    public void testCreateUpdateGetDeleteDataType() throws PfModelException {
+    void testCreateUpdateGetDeleteDataType() throws PfModelException {
         JpaToscaServiceTemplate serviceTemplate = new JpaToscaServiceTemplate();
         serviceTemplate.setMetadata(new TreeMap<String, String>());
 
@@ -166,7 +166,7 @@ public class SimpleToscaServiceTemplateProviderTest {
     }
 
     @Test
-    public void testNonNulls() {
+    void testNonNulls() {
         assertThatThrownBy(() -> {
             new SimpleToscaServiceTemplateProvider().write(null, null);
         }).hasMessageMatching(DAO_IS_NULL);
index 4e491fd..18e011f 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2020 Nordix Foundation.
  *  Copyright (C) 2019-2020,2022 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.simple.serialization;
 
 import static org.assertj.core.api.Assertions.assertThatCode;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import com.google.gson.JsonArray;
 import com.google.gson.JsonObject;
 import com.google.gson.JsonParser;
 import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.common.utils.coder.YamlJsonTranslator;
@@ -50,7 +51,7 @@ import org.yaml.snakeyaml.Yaml;
  * @author Liam Fallon (liam.fallon@est.tech)
  * @author Chenfei Gao (cgao@research.att.com)
  */
-public class MonitoringPolicySerializationTest {
+class MonitoringPolicySerializationTest {
 
     private static final String VERSION = "version";
 
@@ -96,7 +97,7 @@ public class MonitoringPolicySerializationTest {
     private final YamlJsonTranslator yamlJsonTranslator = new YamlJsonTranslator();
 
     @Test
-    public void testDeserialization() throws Exception {
+    void testDeserialization() throws Exception {
         String policyTypeInputJson =
                 ResourceUtils.getResourceAsString("policytypes/onap.policies.monitoring.tcagen2.yaml");
         ToscaServiceTemplate plainPolicyTypes =
@@ -133,7 +134,7 @@ public class MonitoringPolicySerializationTest {
     }
 
     @Test
-    public void testSerialization() {
+    void testSerialization() {
         assertThatCode(() -> {
             // vCPE
             JpaToscaServiceTemplate serviceTemplate = deserializeMonitoringInputJson(VCPE_MON_INPUT_JSON);
index f1999be..86b07c7 100644 (file)
 
 package org.onap.policy.models.tosca.simple.serialization;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Map.Entry;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.common.utils.resources.ResourceUtils;
@@ -50,7 +50,7 @@ import org.yaml.snakeyaml.Yaml;
  *
  * @author Chenfei Gao (cgao@research.att.com)
  */
-public class MonitoringPolicyTypeSerializationTest {
+class MonitoringPolicyTypeSerializationTest {
 
     private static final String DATATYPE_ROOT = "tosca.datatypes.Root";
 
@@ -81,13 +81,13 @@ public class MonitoringPolicyTypeSerializationTest {
 
     private StandardCoder coder;
 
-    @Before
-    public void setUp() {
+    @BeforeEach
+    void setUp() {
         coder = new StandardCoder();
     }
 
     @Test
-    public void testDeserialization() throws Exception {
+    void testDeserialization() throws Exception {
         // TCA v1
         JpaToscaServiceTemplate serviceTemplateFromYaml = deserializeMonitoringInputYaml(MONITORING_TCA_YAML);
         verifyTcaInputDeserialization(serviceTemplateFromYaml, VERSION_100, TCA_V1);
@@ -102,7 +102,7 @@ public class MonitoringPolicyTypeSerializationTest {
     }
 
     @Test
-    public void testSerialization() throws Exception {
+    void testSerialization() throws Exception {
         // TCA v1
         JpaToscaServiceTemplate tcaServiceTemplateFromYaml = deserializeMonitoringInputYaml(MONITORING_TCA_YAML);
         String serializedServiceTemplateTca = serializeMonitoringServiceTemplate(tcaServiceTemplateFromYaml);
index ba48603..4ddae1c 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2020 Nordix Foundation.
+ * Modifications Copyright (C) 2020, 2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 package org.onap.policy.models.tosca.simple.serialization;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.List;
 import java.util.Map;
 import org.apache.commons.collections4.MapUtils;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.common.utils.resources.ResourceUtils;
@@ -40,7 +41,7 @@ import org.onap.policy.models.tosca.simple.concepts.JpaToscaProperty;
 import org.onap.policy.models.tosca.simple.concepts.JpaToscaServiceTemplate;
 import org.yaml.snakeyaml.Yaml;
 
-public class OptimizationPolicyTypeSerializationTest {
+class OptimizationPolicyTypeSerializationTest {
 
     private static final String TYPE_ROOT = "tosca.policies.Root";
     private static final String VERSION = "1.0.0";
@@ -52,13 +53,13 @@ public class OptimizationPolicyTypeSerializationTest {
 
     private StandardCoder coder;
 
-    @Before
-    public void setUp() {
+    @BeforeEach
+    void setUp() {
         coder = new StandardCoder();
     }
 
     @Test
-    public void testOptimization() throws CoderException {
+    void testOptimization() throws CoderException {
         JpaToscaServiceTemplate svctmpl = loadYaml(INPUT_OPTIMIZATION_YAML);
         validate("initial object", svctmpl, TYPE_ROOT, "onap.policies.Optimization", false, false);
 
@@ -70,7 +71,7 @@ public class OptimizationPolicyTypeSerializationTest {
     }
 
     @Test
-    public void testOptimizationResource() throws CoderException {
+    void testOptimizationResource() throws CoderException {
         JpaToscaServiceTemplate svctmpl = loadYaml(INPUT_OPTIMIZATION_RESOURCE_YAML);
         validate("initial object", svctmpl, "onap.policies.Optimization", "onap.policies.optimization.Resource", true,
                 true);
@@ -83,7 +84,7 @@ public class OptimizationPolicyTypeSerializationTest {
     }
 
     @Test
-    public void testOptimizationService() throws CoderException {
+    void testOptimizationService() throws CoderException {
         JpaToscaServiceTemplate svctmpl = loadYaml(INPUT_OPTIMIZATION_SERVICE_YAML);
         validate("initial object", svctmpl, "onap.policies.Optimization", "onap.policies.optimization.Service", false,
                 true);
@@ -120,17 +121,17 @@ public class OptimizationPolicyTypeSerializationTest {
             boolean checkResource, boolean checkService) {
         JpaToscaPolicyTypes policyTypes = svctmpl.getPolicyTypes();
 
-        assertEquals(testnm + " type count", 1, policyTypes.getConceptMap().size());
+        assertEquals(1, policyTypes.getConceptMap().size(), testnm + " type count");
         JpaToscaPolicyType policyType = policyTypes.getConceptMap().values().iterator().next();
 
-        assertEquals(testnm + " name", typeName, policyType.getName());
-        assertEquals(testnm + " version", VERSION, policyType.getVersion());
+        assertEquals(typeName, policyType.getName(), testnm + " name");
+        assertEquals(VERSION, policyType.getVersion(), testnm + " version");
 
-        assertNotNull(testnm + " derived from", policyType.getDerivedFrom());
-        assertEquals(testnm + " derived from name", derivedFrom, policyType.getDerivedFrom().getName());
+        assertNotNull(String.valueOf(policyType.getDerivedFrom()), testnm + " derived from");
+        assertEquals(derivedFrom, policyType.getDerivedFrom().getName(), testnm + " derived from name");
 
         Map<String, JpaToscaProperty> props = policyType.getProperties();
-        assertNotNull(testnm + " properties", props);
+        assertNotNull(props.toString(), testnm + " properties");
 
         if (checkResource && checkService) {
             validateResources(testnm, props.get("resources"));
@@ -149,59 +150,59 @@ public class OptimizationPolicyTypeSerializationTest {
     private void validateScope(String testName, JpaToscaProperty prop) {
         String testnm = testName + " scope";
 
-        assertNotNull(testnm, prop);
+        assertNotNull(prop, testnm);
         validateMatchable(testnm, prop.getMetadata());
     }
 
     private void validateServices(String testName, JpaToscaProperty prop) {
         String testnm = testName + " services";
 
-        assertNotNull(testnm, prop);
+        assertNotNull(prop, testnm);
         validateMatchable(testnm, prop.getMetadata());
     }
 
     private void validateResources(String testName, JpaToscaProperty prop) {
         String testnm = testName + " resources";
 
-        assertNotNull(testnm, prop);
+        assertNotNull(prop, testnm);
         validateMatchable(testnm, prop.getMetadata());
     }
 
     private void validateGeography(String testName, JpaToscaProperty prop) {
         String testnm = testName + " geography";
 
-        assertNotNull(testnm, prop);
+        assertNotNull(prop, testnm);
 
         // this line results in a stack overflow
         // assertEquals(testnm + " name", "geography", prop.getName());
 
-        assertEquals(testnm + " description", "One or more geographic regions", prop.getDescription());
-        assertEquals(testnm + " type", "list", prop.getType().getName());
+        assertEquals("One or more geographic regions", prop.getDescription(), testnm + " description");
+        assertEquals("list", prop.getType().getName(), testnm + " description");
         validateMatchable(testnm, prop.getMetadata());
-        assertTrue(testnm + " required", prop.isRequired());
-        assertEquals(testnm + " entry_schema", "string", prop.getEntrySchema().getType().getName());
+        assertTrue(prop.isRequired(), testnm + " required");
+        assertEquals("string", prop.getEntrySchema().getType().getName(), testnm + " description");
 
         List<JpaToscaConstraint> constraints = prop.getEntrySchema().getConstraints();
-        assertNotNull(testnm + " constraints", constraints);
+        assertNotNull(constraints, testnm + " constraints");
 
-        assertEquals(testnm + " constraint size", 1, constraints.size());
-        assertTrue(testnm + " constraint type", constraints.get(0) instanceof JpaToscaConstraintValidValues);
+        assertEquals(1, constraints.size(), testnm + " constraint size");
+        assertInstanceOf(JpaToscaConstraintValidValues.class, constraints.get(0), testnm + " constraint type");
         JpaToscaConstraintValidValues constraint = (JpaToscaConstraintValidValues) constraints.get(0);
 
-        assertEquals(testnm + " valid values", "[US, International]", constraint.getValidValues().toString());
+        assertEquals("[US, International]", constraint.getValidValues().toString(), testnm + " valid values");
     }
 
     private void validateIdentity(String testName, JpaToscaProperty prop) {
         String testnm = testName + " identity";
 
-        assertNotNull(testnm, prop);
-        assertEquals(testnm + " metadata", true, MapUtils.isEmpty(prop.getMetadata()));
+        assertNotNull(prop, testnm);
+        assertTrue(MapUtils.isEmpty(prop.getMetadata()), testnm + " metadata");
     }
 
     private void validateMatchable(String testName, Map<String, String> metadata) {
         String testnm = testName + " matchable";
 
-        assertNotNull(testnm + " metadata", metadata);
-        assertEquals(testnm + " value", "true", metadata.get("matchable"));
+        assertNotNull(metadata, testnm + " metadata");
+        assertEquals("true", metadata.get("matchable"), testnm + " value");
     }
 }
index 675ec32..0f5e7ab 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2020-2021 Nordix Foundation.
  *  Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.models.tosca.utils;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.Iterator;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.Validated;
 import org.onap.policy.models.tosca.simple.concepts.JpaToscaDataType;
@@ -42,9 +43,9 @@ import org.onap.policy.models.tosca.simple.concepts.JpaToscaTopologyTemplate;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class ToscaServiceTemplateUtilsTest {
+class ToscaServiceTemplateUtilsTest {
     @Test
-    public void testAddFragmentNulls() {
+    void testAddFragmentNulls() {
         assertThatThrownBy(() -> {
             ToscaServiceTemplateUtils.addFragment(null, null);
         }).hasMessageMatching("originalTemplate is marked .*on.*ull but is null");
@@ -62,7 +63,7 @@ public class ToscaServiceTemplateUtilsTest {
     }
 
     @Test
-    public void testAddFragment() {
+    void testAddFragment() {
         JpaToscaServiceTemplate originalTemplate = new JpaToscaServiceTemplate();
         JpaToscaServiceTemplate fragmentTemplate00 = new JpaToscaServiceTemplate();
 
index a40e9c2..9e65590 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2021 Nordix Foundation.
  *  Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,12 +25,12 @@ package org.onap.policy.models.tosca.utils;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-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.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.common.parameters.BeanValidationResult;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfKey;
@@ -46,10 +47,10 @@ import org.onap.policy.models.tosca.simple.concepts.JpaToscaTopologyTemplate;
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public class ToscaUtilsTest {
+class ToscaUtilsTest {
 
     @Test
-    public void testAssertDataTypes() {
+    void testAssertDataTypes() {
         JpaToscaServiceTemplate jpaToscaServiceTemplate = new JpaToscaServiceTemplate();
 
         assertFalse(ToscaUtils.doDataTypesExist(jpaToscaServiceTemplate));
@@ -79,7 +80,7 @@ public class ToscaUtilsTest {
     }
 
     @Test
-    public void testAssertPolicyTypes() {
+    void testAssertPolicyTypes() {
         JpaToscaServiceTemplate jpaToscaServiceTemplate = new JpaToscaServiceTemplate();
 
         assertFalse(ToscaUtils.doPolicyTypesExist(jpaToscaServiceTemplate));
@@ -108,7 +109,7 @@ public class ToscaUtilsTest {
     }
 
     @Test
-    public void testAssertPolicies() {
+    void testAssertPolicies() {
         JpaToscaServiceTemplate jpaToscaServiceTemplate = new JpaToscaServiceTemplate();
 
         assertFalse(ToscaUtils.doPoliciesExist(jpaToscaServiceTemplate));
@@ -146,7 +147,7 @@ public class ToscaUtilsTest {
     }
 
     @Test
-    public void testGetentityTypeAncestors() {
+    void testGetentityTypeAncestors() {
         assertThatThrownBy(() -> {
             ToscaUtils.getEntityTypeAncestors(null, null, null);
         }).hasMessageMatching("entityTypes is marked .*on.*ull but is null");
@@ -177,7 +178,7 @@ public class ToscaUtilsTest {
     }
 
     @Test
-    public void testGetentityTypeAncestorsDataType() {
+    void testGetentityTypeAncestorsDataType() {
 
         JpaToscaDataTypes dataTypes = new JpaToscaDataTypes();
         JpaToscaDataType dt0 = new JpaToscaDataType();
@@ -267,12 +268,12 @@ public class ToscaUtilsTest {
     }
 
     @Test
-    public void testGetPredefinedDataTypes() {
+    void testGetPredefinedDataTypes() {
         assertTrue(ToscaUtils.getPredefinedDataTypes().contains(new PfConceptKey("string", PfKey.NULL_KEY_VERSION)));
     }
 
     @Test
-    public void testgetEntityTree() {
+    void testgetEntityTree() {
         assertThatThrownBy(() -> {
             ToscaUtils.getEntityTree(null, null, null);
         }).hasMessageMatching("entityTypes is marked .*on.*ull but is null");