diff --git a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/model/EvalDomainModelFactoryTest.java b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/model/EvalDomainModelFactoryTest.java
index 5149c86..8471a65 100644
--- a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/model/EvalDomainModelFactoryTest.java
+++ b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/model/EvalDomainModelFactoryTest.java
@@ -1,44 +1,45 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. 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.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
 
 package org.onap.policy.apex.testsuites.integration.common.model;
 
-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 org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
 
 /**
  * Test the evaluation domain model factory.
  */
-public class EvalDomainModelFactoryTest {
+class EvalDomainModelFactoryTest {
 
     @Test
-    public void testEvalDomainModelFactory() {
+    void testEvalDomainModelFactory() {
         EvalDomainModelFactory edmf = new EvalDomainModelFactory();
         assertNotNull(edmf);
-        
+
         AxPolicyModel ecaPolicyModel = edmf.getEcaPolicyModel();
         assertEquals("EvaluationPolicyModel_ECA:0.0.1", ecaPolicyModel.getId());
-        
+
         AxPolicyModel oodaPolicyModel = edmf.getOodaPolicyModel();
         assertEquals("EvaluationPolicyModel_OODA:0.0.1", oodaPolicyModel.getId());
     }
diff --git a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelFactoryTest.java b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelFactoryTest.java
index 406bec1..01219fd 100644
--- a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelFactoryTest.java
+++ b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelFactoryTest.java
@@ -1,53 +1,54 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. 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.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
 
 package org.onap.policy.apex.testsuites.integration.common.model;
 
-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 org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
 
 /**
  * Test the evaluation domain model factory.
  */
-public class SampleDomainModelFactoryTest {
+class SampleDomainModelFactoryTest {
 
     @Test
-    public void testSampleDomainModelFactory() {
+    void testSampleDomainModelFactory() {
         SampleDomainModelFactory sdmf = new SampleDomainModelFactory();
         assertNotNull(sdmf);
-        
+
         AxPolicyModel samplePolicyModel = sdmf.getSamplePolicyModel("JAVASCRIPT");
         assertEquals("SamplePolicyModelJAVASCRIPT:0.0.1", samplePolicyModel.getId());
-        
+
         samplePolicyModel = sdmf.getSamplePolicyModel("JAVA");
         assertEquals("SamplePolicyModelJAVA:0.0.1", samplePolicyModel.getId());
-        
+
         samplePolicyModel = sdmf.getSamplePolicyModel("JYTHON");
         assertEquals("SamplePolicyModelJYTHON:0.0.1", samplePolicyModel.getId());
-        
+
         samplePolicyModel = sdmf.getSamplePolicyModel("JRUBY");
         assertEquals("SamplePolicyModelJRUBY:0.0.1", samplePolicyModel.getId());
-        
+
         samplePolicyModel = sdmf.getSamplePolicyModel("MVEL");
         assertEquals("SamplePolicyModelMVEL:0.0.1", samplePolicyModel.getId());
     }
diff --git a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelSaverTest.java b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelSaverTest.java
index eaf2233..e266ee1 100644
--- a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelSaverTest.java
+++ b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelSaverTest.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2020,2022 Nordix Foundation
+ *  Modifications Copyright (C) 2020, 2022, 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,24 +22,25 @@
 package org.onap.policy.apex.testsuites.integration.common.model;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-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 java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.util.Comparator;
-import org.junit.Test;
+import java.util.Objects;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 
 /**
  * Test the sample domain model saver.
  */
-public class SampleDomainModelSaverTest {
+class SampleDomainModelSaverTest {
 
     @Test
-    public void testSampleDomainModelSaver() throws IOException, ApexException {
+    void testSampleDomainModelSaver() throws IOException, ApexException {
         assertThatThrownBy(() -> SampleDomainModelSaver.main(null)).isInstanceOf(NullPointerException.class);
 
         String[] args0 =
@@ -55,7 +56,7 @@
 
         File tempDir = new File(tempDirectory.toString());
         assertTrue(tempDir.isDirectory());
-        assertEquals(5, tempDir.listFiles().length);
+        assertEquals(5, Objects.requireNonNull(tempDir.listFiles()).length);
 
         Files.walk(tempDirectory).sorted(Comparator.reverseOrder()).map(Path::toFile).forEach(File::delete);
     }
diff --git a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/testclasses/TestPingClassTest.java b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/testclasses/TestPingClassTest.java
index 92f86f4..ea8ec81 100644
--- a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/testclasses/TestPingClassTest.java
+++ b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/testclasses/TestPingClassTest.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. 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.
@@ -22,17 +22,17 @@
 package org.onap.policy.apex.testsuites.integration.common.testclasses;
 
 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;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 
 /**
  * Test the ping test class.
  */
-public class TestPingClassTest {
+class TestPingClassTest {
     @Test
-    public void testPingClass() throws ApexException {
+    void testPingClass() throws ApexException {
         PingTestClass ptc = new PingTestClass();
 
         ptc.setName("Hello");
@@ -46,47 +46,45 @@
 
         ptc.setPongTime(-1);
         assertEquals(-1, ptc.getPongTime());
-        assertThatThrownBy(() -> ptc.verify()).isInstanceOf(ApexException.class)
+        assertThatThrownBy(ptc::verify).isInstanceOf(ApexException.class)
             .hasMessageContaining("TestPing is not valid, name does not start with \"Rose\"");
 
         ptc.setName(null);
-        assertThatThrownBy(() -> ptc.verify()).isInstanceOf(ApexException.class)
+        assertThatThrownBy(ptc::verify).isInstanceOf(ApexException.class)
             .hasMessageContaining("TestPing is not valid, name length null or less than 4");
 
         ptc.setName("Ros");
-        assertThatThrownBy(() -> ptc.verify()).isInstanceOf(ApexException.class)
+        assertThatThrownBy(ptc::verify).isInstanceOf(ApexException.class)
             .hasMessageContaining("TestPing is not valid, name length null or less than 4");
 
         ptc.setName("Rose");
-        assertThatThrownBy(() -> ptc.verify()).isInstanceOf(ApexException.class)
+        assertThatThrownBy(ptc::verify).isInstanceOf(ApexException.class)
             .hasMessageContaining("TestPing is not valid, description length null or less than 44");
 
         ptc.setDescription(null);
-        assertThatThrownBy(() -> ptc.verify()).isInstanceOf(ApexException.class)
+        assertThatThrownBy(ptc::verify).isInstanceOf(ApexException.class)
             .hasMessageContaining("TestPing is not valid, description length null or less than 44");
 
         ptc.setDescription("A rose by any other name would smell as swee");
-        assertThatThrownBy(() -> ptc.verify()).isInstanceOf(ApexException.class)
+        assertThatThrownBy(ptc::verify).isInstanceOf(ApexException.class)
             .hasMessageContaining("TestPing is not valid, description length null or less than 44");
 
         ptc.setDescription("A rose by any other name would smell as swell");
-        assertThatThrownBy(() -> ptc.verify()).isInstanceOf(ApexException.class)
-           .hasMessageContaining("TestPing is not valid, description is incorrect");
+        assertThatThrownBy(ptc::verify).isInstanceOf(ApexException.class)
+            .hasMessageContaining("TestPing is not valid, description is incorrect");
 
         ptc.setDescription("A rose by any other name would smell as sweet");
-        assertThatThrownBy(() -> ptc.verify()).isInstanceOf(ApexException.class)
+        assertThatThrownBy(ptc::verify).isInstanceOf(ApexException.class)
             .hasMessageContaining("TestPing is not valid, pong time -1 is less than ping time 0");
 
         ptc.setPongTime(-2);
-        assertThatThrownBy(() -> ptc.verify()).isInstanceOf(ApexException.class)
-           .hasMessageContaining("TestPing is not valid, pong time -2 is less than ping time 0");
+        assertThatThrownBy(ptc::verify).isInstanceOf(ApexException.class)
+            .hasMessageContaining("TestPing is not valid, pong time -2 is less than ping time 0");
 
         ptc.setPongTime(1);
         ptc.verify();
 
-        assertEquals(
-                "PingTestClass(id=0, name=Rose, "
-                        + "description=A rose by any other name would smell as sweet, pingTime=0, pongTime=1)",
-                ptc.toString());
+        assertEquals("PingTestClass(id=0, name=Rose, description=A rose by any other name would smell as sweet, "
+            + "pingTime=0, pongTime=1)", ptc.toString());
     }
 }
diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexActionListener.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexActionListener.java
index da90361..67c8609 100644
--- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexActionListener.java
+++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexActionListener.java
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  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.
@@ -41,7 +42,7 @@
 public class TestApexActionListener implements EnEventListener {
     private static final XLogger logger = XLoggerFactory.getXLogger(TestApexActionListener.class);
 
-    private List<EnEvent> resultEvents = new ArrayList<>();
+    private final List<EnEvent> resultEvents = new ArrayList<>();
 
     @Getter
     private final String id;
@@ -64,15 +65,12 @@
      */
     public EnEvent getResult(final boolean allowNulls) {
         EnEvent result = null;
-        while (true) {
+        do {
             while (resultEvents.isEmpty()) {
                 ThreadUtilities.sleep(100);
             }
             result = resultEvents.remove(0);
-            if (result != null || allowNulls) {
-                break;
-            }
-        }
+        } while (result == null && !allowNulls);
         return result;
     }
 
diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngine.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngine.java
index b9bfcaa..24cf494 100644
--- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngine.java
+++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngine.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-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.
@@ -26,12 +26,10 @@
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
-import java.io.IOException;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
-import org.onap.policy.apex.core.engine.EngineParameters;
 import org.onap.policy.apex.core.engine.engine.ApexEngine;
 import org.onap.policy.apex.core.engine.engine.impl.ApexEngineFactory;
 import org.onap.policy.apex.core.engine.event.EnEvent;
@@ -53,12 +51,9 @@
      *
      * @param axLogicExecutorType the type of logic executor to use to construct the sample policy model for this test
      * @throws ApexException the apex exception
-     * @throws InterruptedException the interrupted exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
-    public TestApexEngine(final String axLogicExecutorType,
-            final EngineParameters parameters) throws ApexException, InterruptedException, IOException {
-        logger.debug("Running TestApexEngine test for + " + axLogicExecutorType + "logic . . .");
+    public TestApexEngine(final String axLogicExecutorType) throws ApexException {
+        logger.debug("Running TestApexEngine test for + {}logic . . .", axLogicExecutorType);
 
         final AxPolicyModel apexPolicyModel = new SampleDomainModelFactory().getSamplePolicyModel(axLogicExecutorType);
         assertNotNull(apexPolicyModel);
diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJRuby.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJRuby.java
index f698934..6845589 100644
--- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJRuby.java
+++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJRuby.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. 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.
@@ -23,23 +23,21 @@
 
 import static org.assertj.core.api.Assertions.assertThatCode;
 
-import java.io.IOException;
-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.apex.context.impl.schema.java.JavaSchemaHelperParameters;
 import org.onap.policy.apex.context.parameters.ContextParameterConstants;
 import org.onap.policy.apex.context.parameters.ContextParameters;
 import org.onap.policy.apex.context.parameters.SchemaParameters;
 import org.onap.policy.apex.core.engine.EngineParameters;
-import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.plugins.executor.jruby.JrubyExecutorParameters;
 import org.onap.policy.common.parameters.ParameterService;
 
 /**
  * The Class TestApexEngineJRuby.
  */
-public class TestApexEngineJRuby {
+class TestApexEngineJRuby {
     private SchemaParameters schemaParameters;
     private ContextParameters contextParameters;
     private EngineParameters engineParameters;
@@ -47,8 +45,8 @@
     /**
      * Before test.
      */
-    @Before
-    public void beforeTest() {
+    @BeforeEach
+    void beforeTest() {
         schemaParameters = new SchemaParameters();
 
         schemaParameters.setName(ContextParameterConstants.SCHEMA_GROUP_NAME);
@@ -76,8 +74,8 @@
     /**
      * After test.
      */
-    @After
-    public void afterTest() {
+    @AfterEach
+    void afterTest() {
         ParameterService.deregister(engineParameters);
 
         ParameterService.deregister(contextParameters.getDistributorParameters());
@@ -90,15 +88,9 @@
 
     /**
      * Test apex engine.
-     *
-     * @throws ApexException the apex exception
-     * @throws InterruptedException the interrupted exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testApexEngineJRuby() throws ApexException, InterruptedException, IOException {
-        assertThatCode(() -> {
-            new TestApexEngine("JRUBY", engineParameters);
-        }).doesNotThrowAnyException();
+    void testApexEngineJRuby() {
+        assertThatCode(() -> new TestApexEngine("JRUBY")).doesNotThrowAnyException();
     }
 }
diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJava.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJava.java
index 937a89d..571b6bd 100644
--- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJava.java
+++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJava.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. 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.
@@ -23,16 +23,14 @@
 
 import static org.assertj.core.api.Assertions.assertThatCode;
 
-import java.io.IOException;
-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.apex.context.impl.schema.java.JavaSchemaHelperParameters;
 import org.onap.policy.apex.context.parameters.ContextParameterConstants;
 import org.onap.policy.apex.context.parameters.ContextParameters;
 import org.onap.policy.apex.context.parameters.SchemaParameters;
 import org.onap.policy.apex.core.engine.EngineParameters;
-import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.plugins.executor.java.JavaExecutorParameters;
 import org.onap.policy.common.parameters.ParameterService;
 
@@ -41,7 +39,7 @@
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
-public class TestApexEngineJava {
+class TestApexEngineJava {
     private SchemaParameters schemaParameters;
     private ContextParameters contextParameters;
     private EngineParameters engineParameters;
@@ -49,8 +47,8 @@
     /**
      * Before test.
      */
-    @Before
-    public void beforeTest() {
+    @BeforeEach
+    void beforeTest() {
         schemaParameters = new SchemaParameters();
 
         schemaParameters.setName(ContextParameterConstants.SCHEMA_GROUP_NAME);
@@ -78,8 +76,8 @@
     /**
      * After test.
      */
-    @After
-    public void afterTest() {
+    @AfterEach
+    void afterTest() {
         ParameterService.deregister(engineParameters);
 
         ParameterService.deregister(contextParameters.getDistributorParameters());
@@ -92,16 +90,12 @@
 
     /**
      * Test apex engine.
-     *
-     * @throws InterruptedException the interrupted exception
-     * @throws IOException Signals that an I/O exception has occurred.
-     * @throws ApexException the apex exception
      */
     @Test
-    public void testApexEngineJava() {
+    void testApexEngineJava() {
         assertThatCode(() -> {
-            new TestApexEngine("JAVA", engineParameters);
-            new TestApexEngine("JAVA", engineParameters);
+            new TestApexEngine("JAVA");
+            new TestApexEngine("JAVA");
         }).doesNotThrowAnyException();
     }
 }
diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJavascript.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJavascript.java
index 108416b..d5b4fd1 100644
--- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJavascript.java
+++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJavascript.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. 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.
@@ -23,23 +23,21 @@
 
 import static org.assertj.core.api.Assertions.assertThatCode;
 
-import java.io.IOException;
-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.apex.context.impl.schema.java.JavaSchemaHelperParameters;
 import org.onap.policy.apex.context.parameters.ContextParameterConstants;
 import org.onap.policy.apex.context.parameters.ContextParameters;
 import org.onap.policy.apex.context.parameters.SchemaParameters;
 import org.onap.policy.apex.core.engine.EngineParameters;
-import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters;
 import org.onap.policy.common.parameters.ParameterService;
 
 /**
  * The Class TestApexEngineJavascript.
  */
-public class TestApexEngineJavascript {
+class TestApexEngineJavascript {
     private SchemaParameters schemaParameters;
     private ContextParameters contextParameters;
     private EngineParameters engineParameters;
@@ -47,8 +45,8 @@
     /**
      * Before test.
      */
-    @Before
-    public void beforeTest() {
+    @BeforeEach
+    void beforeTest() {
         schemaParameters = new SchemaParameters();
 
         schemaParameters.setName(ContextParameterConstants.SCHEMA_GROUP_NAME);
@@ -76,8 +74,8 @@
     /**
      * After test.
      */
-    @After
-    public void afterTest() {
+    @AfterEach
+    void afterTest() {
         ParameterService.deregister(engineParameters);
 
         ParameterService.deregister(contextParameters.getDistributorParameters());
@@ -91,15 +89,12 @@
     /**
      * Test apex engine.
      *
-     * @throws ApexException the apex exception
-     * @throws InterruptedException the interrupted exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testApexEngineJavascript() throws ApexException, InterruptedException, IOException {
+    void testApexEngineJavascript() {
         assertThatCode(() -> {
-            new TestApexEngine("JAVASCRIPT", engineParameters);
-            new TestApexEngine("JAVASCRIPT", engineParameters);
+            new TestApexEngine("JAVASCRIPT");
+            new TestApexEngine("JAVASCRIPT");
         }).doesNotThrowAnyException();
     }
 }
diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJython.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJython.java
index 76b3835..9359900 100644
--- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJython.java
+++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJython.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. 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.
@@ -23,16 +23,14 @@
 
 import static org.assertj.core.api.Assertions.assertThatCode;
 
-import java.io.IOException;
-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.apex.context.impl.schema.java.JavaSchemaHelperParameters;
 import org.onap.policy.apex.context.parameters.ContextParameterConstants;
 import org.onap.policy.apex.context.parameters.ContextParameters;
 import org.onap.policy.apex.context.parameters.SchemaParameters;
 import org.onap.policy.apex.core.engine.EngineParameters;
-import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters;
 import org.onap.policy.common.parameters.ParameterService;
 
@@ -40,9 +38,8 @@
  * The Class TestApexEngineJython should be the test class for the Jython interpreter.
  *
  * <p>It actually reruns the javascript tests as a placeholder until the Jython security issues are resolved.
- *
  */
-public class TestApexEngineJython {
+class TestApexEngineJython {
     private SchemaParameters schemaParameters;
     private ContextParameters contextParameters;
     private EngineParameters engineParameters;
@@ -50,8 +47,8 @@
     /**
      * Before test.
      */
-    @Before
-    public void beforeTest() {
+    @BeforeEach
+    void beforeTest() {
         schemaParameters = new SchemaParameters();
 
         schemaParameters.setName(ContextParameterConstants.SCHEMA_GROUP_NAME);
@@ -79,8 +76,8 @@
     /**
      * After test.
      */
-    @After
-    public void afterTest() {
+    @AfterEach
+    void afterTest() {
         ParameterService.deregister(engineParameters);
 
         ParameterService.deregister(contextParameters.getDistributorParameters());
@@ -93,16 +90,12 @@
 
     /**
      * Test apex engine.
-     *
-     * @throws ApexException the apex exception
-     * @throws InterruptedException the interrupted exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testApexEngineJython() throws ApexException, InterruptedException, IOException {
+    void testApexEngineJython() {
         assertThatCode(() -> {
-            new TestApexEngine("JAVASCRIPT", engineParameters);
-            new TestApexEngine("JAVASCRIPT", engineParameters);
+            new TestApexEngine("JAVASCRIPT");
+            new TestApexEngine("JAVASCRIPT");
         }).doesNotThrowAnyException();
     }
 }
diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineMvel.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineMvel.java
index 499dc59..c0ee142 100644
--- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineMvel.java
+++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineMvel.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. 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.
@@ -23,23 +23,21 @@
 
 import static org.assertj.core.api.Assertions.assertThatCode;
 
-import java.io.IOException;
-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.apex.context.impl.schema.java.JavaSchemaHelperParameters;
 import org.onap.policy.apex.context.parameters.ContextParameterConstants;
 import org.onap.policy.apex.context.parameters.ContextParameters;
 import org.onap.policy.apex.context.parameters.SchemaParameters;
 import org.onap.policy.apex.core.engine.EngineParameters;
-import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.plugins.executor.mvel.MvelExecutorParameters;
 import org.onap.policy.common.parameters.ParameterService;
 
 /**
  * The Class TestApexEngineMvel.
  */
-public class TestApexEngineMvel {
+class TestApexEngineMvel {
     private SchemaParameters schemaParameters;
     private ContextParameters contextParameters;
     private EngineParameters engineParameters;
@@ -47,8 +45,8 @@
     /**
      * Before test.
      */
-    @Before
-    public void beforeTest() {
+    @BeforeEach
+    void beforeTest() {
         schemaParameters = new SchemaParameters();
 
         schemaParameters.setName(ContextParameterConstants.SCHEMA_GROUP_NAME);
@@ -76,8 +74,8 @@
     /**
      * After test.
      */
-    @After
-    public void afterTest() {
+    @AfterEach
+    void afterTest() {
         ParameterService.deregister(engineParameters);
 
         ParameterService.deregister(contextParameters.getDistributorParameters());
@@ -90,16 +88,12 @@
 
     /**
      * Test apex engine.
-     *
-     * @throws ApexException the apex exception
-     * @throws InterruptedException the interrupted exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testApexEngineMvel() throws ApexException, InterruptedException, IOException {
+    void testApexEngineMvel() {
         assertThatCode(() -> {
-            new TestApexEngine("MVEL", engineParameters);
-            new TestApexEngine("MVEL", engineParameters);
+            new TestApexEngine("MVEL");
+            new TestApexEngine("MVEL");
         }).doesNotThrowAnyException();
     }
 }
diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/event/TestEventInstantiation.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/event/TestEventInstantiation.java
index 7500088..7f9a432 100644
--- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/event/TestEventInstantiation.java
+++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/event/TestEventInstantiation.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-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.
@@ -22,17 +22,16 @@
 package org.onap.policy.apex.testsuites.integration.executor.event;
 
 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.io.IOException;
 import java.util.Date;
 import java.util.HashMap;
 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.apex.context.impl.schema.java.JavaSchemaHelperParameters;
 import org.onap.policy.apex.context.parameters.ContextParameterConstants;
 import org.onap.policy.apex.context.parameters.ContextParameters;
@@ -43,7 +42,6 @@
 import org.onap.policy.apex.core.engine.event.EnEvent;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
-import org.onap.policy.apex.model.basicmodel.handling.ApexModelException;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
 import org.onap.policy.apex.plugins.executor.mvel.MvelExecutorParameters;
 import org.onap.policy.apex.testsuites.integration.common.model.SampleDomainModelFactory;
@@ -56,7 +54,7 @@
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
-public class TestEventInstantiation {
+class TestEventInstantiation {
     // Logger for this class
     private static final XLogger logger = XLoggerFactory.getXLogger(TestEventInstantiation.class);
 
@@ -67,8 +65,8 @@
     /**
      * Before test.
      */
-    @Before
-    public void beforeTest() {
+    @BeforeEach
+    void beforeTest() {
         schemaParameters = new SchemaParameters();
 
         schemaParameters.setName(ContextParameterConstants.SCHEMA_GROUP_NAME);
@@ -96,8 +94,8 @@
     /**
      * After test.
      */
-    @After
-    public void afterTest() {
+    @AfterEach
+    void afterTest() {
         ParameterService.deregister(engineParameters);
 
         ParameterService.deregister(contextParameters.getDistributorParameters());
@@ -111,12 +109,10 @@
     /**
      * Test event instantiation.
      *
-     * @throws ApexModelException on errors in handling Apex models
-     * @throws IOException Signals that an I/O exception has occurred.
      * @throws ApexException the apex exception
      */
     @Test
-    public void testEventInstantiation() throws ApexModelException, IOException, ApexException {
+    void testEventInstantiation() throws ApexException {
         final String xmlFileName = "xml/ApexModel_MVEL.xml";
 
         logger.debug("Running TestEventInstantiation test  on file {} . . .", xmlFileName);
@@ -164,14 +160,14 @@
         assertEquals(temperature, temp1);
 
         Object value = event.put("TestMatchCase", null);
+        assert value != null;
         assertEquals(16, ((Byte) value).intValue());
         value = event.get("TestMatchCase");
         assertNull(value);
 
         assertThatThrownBy(() -> event.put("TestMatchCase", "Hello"))
             .hasMessage("Event0000:0.0.1:NULL:TestMatchCase: object \"Hello\" of class \"java.lang.String\" "
-                    + "not compatible with class \"java.lang.Byte\"");
-        event.put("TestMatchCase", 123.45);
+                + "not compatible with class \"java.lang.Byte\"");
 
         event.put("TestMatchCase", Byte.valueOf("16"));
 
@@ -196,7 +192,7 @@
         assertEquals(123.456789, temp3, 0);
 
         final Date aDate = new Date(1433453067123L);
-        final Map<String, Object> eventDataList = new HashMap<String, Object>();
+        final Map<String, Object> eventDataList = new HashMap<>();
         eventDataList.put("TestSlogan", "This is a test slogan");
         eventDataList.put("TestMatchCase", Byte.valueOf("123"));
         eventDataList.put("TestTimestamp", aDate.getTime());
diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexModelExport.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexModelExport.java
index dc5c06f..eb4d00f 100644
--- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexModelExport.java
+++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexModelExport.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. 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.
@@ -21,15 +21,14 @@
 
 package org.onap.policy.apex.testsuites.integration.executor.handling;
 
-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.Before;
-import org.junit.Test;
-import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
 import org.onap.policy.apex.model.policymodel.handling.PolicyModelSplitter;
@@ -41,22 +40,21 @@
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
-public class TestApexModelExport {
+class TestApexModelExport {
     private static final XLogger logger = XLoggerFactory.getXLogger(TestApexModelExport.class);
 
     private AxPolicyModel model = null;
 
-    @Before
-    public void initApexModelSmall() throws ApexException {
+    @BeforeEach
+    void initApexModelSmall() {
         model = new TestApexSamplePolicyModelCreator("MVEL").getModel();
     }
 
     @Test
-    public void testApexModelExport() throws Exception {
+    void testApexModelExport() throws Exception {
         logger.info("Starting test: testApexModelExport");
 
-        final List<AxArtifactKey> exportPolicyList = new ArrayList<AxArtifactKey>();
-        exportPolicyList.addAll(model.getPolicies().getPolicyMap().keySet());
+        final List<AxArtifactKey> exportPolicyList = new ArrayList<>(model.getPolicies().getPolicyMap().keySet());
 
         final AxPolicyModel exportedModel0 = PolicyModelSplitter.getSubPolicyModel(model, exportPolicyList);
 
diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexPolicyModelAnalysis.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexPolicyModelAnalysis.java
index abcd22a..ae8bc90 100644
--- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexPolicyModelAnalysis.java
+++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexPolicyModelAnalysis.java
@@ -1,35 +1,37 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. 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.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
 
 package org.onap.policy.apex.testsuites.integration.executor.handling;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
 import org.onap.policy.apex.model.policymodel.handling.PolicyAnalyser;
 import org.onap.policy.apex.model.policymodel.handling.PolicyAnalysisResult;
 
-public class TestApexPolicyModelAnalysis {
+class TestApexPolicyModelAnalysis {
+
     @Test
-    public void testApexPolicyModelAnalysis() throws Exception {
+    void testApexPolicyModelAnalysis() {
         final AxPolicyModel model = new TestApexSamplePolicyModelCreator("MVEL").getModel();
         final PolicyAnalysisResult result = new PolicyAnalyser().analyse(model);
 
diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyCreateModelFiles.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyCreateModelFiles.java
index 2cc7a79..1522ff9 100644
--- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyCreateModelFiles.java
+++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyCreateModelFiles.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
- *  Modifications Copyright (C) 2022 Nordix Foundation.
+ *  Modifications Copyright (C) 2022, 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,19 +24,19 @@
 
 import static org.assertj.core.api.Assertions.assertThatCode;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.apex.model.basicmodel.test.TestApexModel;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
 
-public class TestApexSamplePolicyCreateModelFiles {
+class TestApexSamplePolicyCreateModelFiles {
     @Test
-    public void testModelWriteRead() throws Exception {
+    void testModelWriteRead() {
         String[] types = {"JAVA", "JAVASCRIPT", "JRUBY", "JYTHON", "MVEL"};
         for (String type: types) {
             final TestApexSamplePolicyModelCreator apexPolicyModelCreator = new TestApexSamplePolicyModelCreator(type);
             final TestApexModel<AxPolicyModel> testApexPolicyModel =
                     new TestApexModel<AxPolicyModel>(AxPolicyModel.class, apexPolicyModelCreator);
-            assertThatCode(() -> testApexPolicyModel.testApexModelWriteReadJson()).doesNotThrowAnyException();
+            assertThatCode(testApexPolicyModel::testApexModelWriteReadJson).doesNotThrowAnyException();
         }
     }
 }
diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModel.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModel.java
index 3cb7369..e1a16c5 100644
--- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModel.java
+++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModel.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2020,2022 Nordix Foundation.
+ *  Modifications Copyright (C) 2020, 2022, 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,10 +21,10 @@
 
 package org.onap.policy.apex.testsuites.integration.executor.handling;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
 import org.onap.policy.apex.model.basicmodel.test.TestApexModel;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
@@ -32,19 +32,18 @@
 /**
  * The Class TestApexSamplePolicyModel.
  */
-public class TestApexSamplePolicyModel {
+class TestApexSamplePolicyModel {
     private static final String VALID_MODEL_STRING = "***validation of model successful***";
     private TestApexModel<AxPolicyModel> testApexModel;
 
     /**
      * Setup.
      *
-     * @throws Exception the exception
      */
-    @Before
-    public void setup() throws Exception {
+    @BeforeEach
+    void setup() {
         testApexModel =
-                new TestApexModel<AxPolicyModel>(AxPolicyModel.class, new TestApexSamplePolicyModelCreator("MVEL"));
+            new TestApexModel<>(AxPolicyModel.class, new TestApexSamplePolicyModelCreator("MVEL"));
     }
 
     /**
@@ -53,7 +52,7 @@
      * @throws Exception the exception
      */
     @Test
-    public void testModelValid() throws Exception {
+    void testModelValid() throws Exception {
         final AxValidationResult result = testApexModel.testApexModelValid();
         assertEquals(VALID_MODEL_STRING, result.toString());
     }
@@ -64,7 +63,7 @@
      * @throws Exception the exception
      */
     @Test
-    public void testModelWriteReadJson() throws Exception {
+    void testModelWriteReadJson() throws Exception {
         testApexModel.testApexModelWriteReadJson();
     }
 }
diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestContextUpdateDifferentModels.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestContextUpdateDifferentModels.java
index 0a4b9a7..7b4f04a 100644
--- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestContextUpdateDifferentModels.java
+++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestContextUpdateDifferentModels.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-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.
@@ -22,13 +22,12 @@
 package org.onap.policy.apex.testsuites.integration.executor.handling;
 
 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.io.IOException;
-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.apex.context.ContextAlbum;
 import org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters;
 import org.onap.policy.apex.context.parameters.ContextParameterConstants;
@@ -52,7 +51,7 @@
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
-public class TestContextUpdateDifferentModels {
+class TestContextUpdateDifferentModels {
     // Logger for this class
     private static final XLogger logger = XLoggerFactory.getXLogger(TestContextUpdateDifferentModels.class);
 
@@ -63,8 +62,8 @@
     /**
      * Before test.
      */
-    @Before
-    public void beforeTest() {
+    @BeforeEach
+    void beforeTest() {
         schemaParameters = new SchemaParameters();
 
         schemaParameters.setName(ContextParameterConstants.SCHEMA_GROUP_NAME);
@@ -92,8 +91,8 @@
     /**
      * After test.
      */
-    @After
-    public void afterTest() {
+    @AfterEach
+    void afterTest() {
         ParameterService.deregister(engineParameters);
 
         ParameterService.deregister(contextParameters.getDistributorParameters());
@@ -107,19 +106,17 @@
     /**
      * Test context update different models.
      *
-     * @throws ApexException the apex exception
-     * @throws InterruptedException the interrupted exception
-     * @throws IOException Signals that an I/O exception has occurred.
+     * @throws ApexException        the apex exception
      */
     @Test
-    public void testContextUpdateDifferentModels() throws ApexException, InterruptedException, IOException {
+    void testContextUpdateDifferentModels() throws ApexException {
         logger.debug("Running test testContextUpdateDifferentModels . . .");
 
         final AxPolicyModel apexModelSample = new SampleDomainModelFactory().getSamplePolicyModel("MVEL");
         assertNotNull(apexModelSample);
 
         final ApexEngineImpl apexEngine =
-                (ApexEngineImpl) new ApexEngineFactory().createApexEngine(new AxArtifactKey("TestApexEngine", "0.0.1"));
+            (ApexEngineImpl) new ApexEngineFactory().createApexEngine(new AxArtifactKey("TestApexEngine", "0.0.1"));
         final TestApexActionListener listener = new TestApexActionListener("Test");
         apexEngine.addEventListener("listener", listener);
         apexEngine.updateModel(apexModelSample, false);
@@ -133,18 +130,17 @@
         assertThatThrownBy(() -> apexEngine.updateModel(null, false))
             .hasMessage("updateModel()<-TestApexEngine:0.0.1, Apex model is not defined, it has a null value");
         assertEquals(apexEngine.getInternalContext().getContextAlbums().size(),
-                apexModelSample.getAlbums().getAlbumsMap().size());
+            apexModelSample.getAlbums().getAlbumsMap().size());
         for (final ContextAlbum contextAlbum : apexEngine.getInternalContext().getContextAlbums().values()) {
             assertEquals(
-                    contextAlbum.getAlbumDefinition(), apexModelSample.getAlbums().get(contextAlbum.getKey()));
+                contextAlbum.getAlbumDefinition(), apexModelSample.getAlbums().get(contextAlbum.getKey()));
         }
 
         apexEngine.updateModel(someSpuriousModel, false);
         assertEquals(apexEngine.getInternalContext().getContextAlbums().size(),
-                someSpuriousModel.getAlbums().getAlbumsMap().size());
+            someSpuriousModel.getAlbums().getAlbumsMap().size());
         for (final ContextAlbum contextAlbum : apexEngine.getInternalContext().getContextAlbums().values()) {
-            assertEquals(
-                    contextAlbum.getAlbumDefinition(), someSpuriousModel.getAlbums().get(contextAlbum.getKey()));
+            assertEquals(contextAlbum.getAlbumDefinition(), someSpuriousModel.getAlbums().get(contextAlbum.getKey()));
         }
 
         apexEngine.clear();
diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestContextUpdateModel.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestContextUpdateModel.java
index 21f129d..5e2ccde 100644
--- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestContextUpdateModel.java
+++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestContextUpdateModel.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-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.
@@ -21,18 +21,16 @@
 
 package org.onap.policy.apex.testsuites.integration.executor.handling;
 
-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.io.IOException;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.policy.apex.context.ContextException;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters;
 import org.onap.policy.apex.context.parameters.ContextParameterConstants;
 import org.onap.policy.apex.context.parameters.ContextParameters;
@@ -56,7 +54,7 @@
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
-public class TestContextUpdateModel {
+class TestContextUpdateModel {
     // Logger for this class
     private static final XLogger logger = XLoggerFactory.getXLogger(TestContextUpdateModel.class);
 
@@ -67,8 +65,8 @@
     /**
      * Before test.
      */
-    @Before
-    public void beforeTest() {
+    @BeforeEach
+    void beforeTest() {
         schemaParameters = new SchemaParameters();
 
         schemaParameters.setName(ContextParameterConstants.SCHEMA_GROUP_NAME);
@@ -96,8 +94,8 @@
     /**
      * After test.
      */
-    @After
-    public void afterTest() {
+    @AfterEach
+    void afterTest() {
         ParameterService.deregister(engineParameters);
 
         ParameterService.deregister(contextParameters.getDistributorParameters());
@@ -111,12 +109,10 @@
     /**
      * Test context update model.
      *
-     * @throws ApexException the apex exception
-     * @throws InterruptedException the interrupted exception
-     * @throws IOException Signals that an I/O exception has occurred.
+     * @throws ApexException        the apex exception
      */
     @Test
-    public void testContextUpdateModel() throws ApexException, InterruptedException, IOException {
+    void testContextUpdateModel() throws ApexException {
         final AxArtifactKey key = new AxArtifactKey("TestApexEngine", "0.0.1");
 
         final ApexEngine apexEngine = new ApexEngineFactory().createApexEngine(key);
@@ -168,8 +164,8 @@
     /**
      * Test context update model after.
      */
-    @After
-    public void testContextUpdateModelAfter() {
+    @AfterEach
+    void testContextUpdateModelAfter() {
         // Not used
     }
 
@@ -177,15 +173,14 @@
      * Send event.
      *
      * @param apexEngine the apex engine
-     * @param listener the listener
-     * @param eventName the event name
+     * @param listener   the listener
+     * @param eventName  the event name
      * @param shouldWork the should work
-     * @throws ContextException the context exception
      */
     private void sendEvent(final ApexEngine apexEngine, final TestApexActionListener listener, final String eventName,
-            final boolean shouldWork) throws ContextException {
+                           final boolean shouldWork) {
         final Date aDate = new Date(1433453067123L);
-        final Map<String, Object> eventDataMap = new HashMap<String, Object>();
+        final Map<String, Object> eventDataMap = new HashMap<>();
         eventDataMap.put("TestSlogan", "This is a test slogan");
         eventDataMap.put("TestMatchCase", (byte) 123);
         eventDataMap.put("TestTimestamp", aDate.getTime());
@@ -196,15 +191,15 @@
         apexEngine.handleEvent(event0);
 
         final EnEvent result = listener.getResult(true);
-        logger.debug("result 1 is:" + result);
+        logger.debug("result 1 is:{}", result);
         checkResult(result, shouldWork);
     }
 
     /**
      * Check result.
      *
-     * @param result the result
-     * @param shouldWork the should work
+     * @param result     the result
+     * @param shouldWork should trigger a valid result
      */
     private void checkResult(final EnEvent result, final boolean shouldWork) {
         if (!shouldWork) {
diff --git a/testsuites/integration/integration-uservice-test/pom.xml b/testsuites/integration/integration-uservice-test/pom.xml
index 77c346a..9e80302 100644
--- a/testsuites/integration/integration-uservice-test/pom.xml
+++ b/testsuites/integration/integration-uservice-test/pom.xml
@@ -124,9 +124,8 @@
         </dependency>
         <dependency>
             <groupId>com.salesforce.kafka.test</groupId>
-            <artifactId>kafka-junit4</artifactId>
-            <version>${version.kafka-junit4}</version>
-            <scope>test</scope>
+            <artifactId>kafka-junit5</artifactId>
+            <version>${version.kafka-junit5}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.zookeeper</groupId>
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/EventGenerator.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/EventGenerator.java
index 0417b73..a015be0 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/EventGenerator.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/EventGenerator.java
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  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.
@@ -92,27 +93,27 @@
 
         builder.append("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n");
         builder.append("<xmlApexEvent xmlns=\"http://www.onap.org/policy/apex-pdp/apexevent\">\n");
-
-        builder.append("  <name>" + eventName + "</name>\n");
+        builder.append("  <name>").append(eventName).append("</name>\n");
         builder.append("  <version>0.0.1</version>\n");
         builder.append("  <nameSpace>org.onap.policy.apex.sample.events</nameSpace>\n");
         builder.append("  <source>test</source>\n");
         builder.append("  <target>apex</target>\n");
         builder.append("  <data>\n");
         builder.append("    <key>TestSlogan</key>\n");
-        builder.append("    <value>Test slogan for External Event" + (nextEventNo++) + "</value>\n");
+        nextEventNo += 1;
+        builder.append("    <value>Test slogan for External Event").append(nextEventNo).append("</value>\n");
         builder.append("  </data>\n");
         builder.append("  <data>\n");
         builder.append("    <key>TestMatchCase</key>\n");
-        builder.append("    <value>" + nextMatchCase + "</value>\n");
+        builder.append("    <value>").append(nextMatchCase).append("</value>\n");
         builder.append("  </data>\n");
         builder.append("  <data>\n");
         builder.append("    <key>TestTimestamp</key>\n");
-        builder.append("    <value>" + System.currentTimeMillis() + "</value>\n");
+        builder.append("    <value>").append(System.currentTimeMillis()).append("</value>\n");
         builder.append("  </data>\n");
         builder.append("  <data>\n");
         builder.append("    <key>TestTemperature</key>\n");
-        builder.append("    <value>" + nextTestTemperature + "</value>\n");
+        builder.append("    <value>").append(nextTestTemperature).append("</value>\n");
         builder.append("  </data>\n");
         builder.append("</xmlApexEvent>");
 
@@ -136,441 +137,15 @@
 
         builder.append("{\n");
         builder.append("  \"nameSpace\": \"org.onap.policy.apex.sample.events\",\n");
-        builder.append("  \"name\": \"" + eventName + "\",\n");
+        builder.append("  \"name\": \"").append(eventName).append("\",\n");
         builder.append("  \"version\": \"0.0.1\",\n");
         builder.append("  \"source\": \"test\",\n");
         builder.append("  \"target\": \"apex\",\n");
-        builder.append("  \"TestSlogan\": \"Test slogan for External Event" + (nextEventNo++) + "\",\n");
-        builder.append("  \"TestMatchCase\": " + nextMatchCase + ",\n");
-        builder.append("  \"TestTimestamp\": " + System.currentTimeMillis() + ",\n");
-        builder.append("  \"TestTemperature\": " + nextTestTemperature + "\n");
-        builder.append("}");
-
-        return builder.toString();
-    }
-
-    /**
-     * Json event no name.
-     *
-     * @return the string
-     */
-    public static String jsonEventNoName() {
-        final Random rand = new Random();
-
-        final StringBuilder builder = new StringBuilder();
-
-        int nextEventNo = rand.nextInt(2);
-        final String eventName = (nextEventNo == 0 ? "Event0000" : "Event0100");
-        final int nextMatchCase = rand.nextInt(4);
-        final float nextTestTemperature = rand.nextFloat() * 10000;
-
-        builder.append("{\n");
-        builder.append("  \"nameSpace\": \"org.onap.policy.apex.sample.events\",\n");
-        builder.append("  \"namez\": \"" + eventName + "\",\n");
-        builder.append("  \"version\": \"0.0.1\",\n");
-        builder.append("  \"source\": \"test\",\n");
-        builder.append("  \"target\": \"apex\",\n");
-        builder.append("  \"TestSlogan\": \"Test slogan for External Event" + (nextEventNo++) + "\",\n");
-        builder.append("  \"TestMatchCase\": " + nextMatchCase + ",\n");
-        builder.append("  \"TestTimestamp\": " + System.currentTimeMillis() + ",\n");
-        builder.append("  \"TestTemperature\": " + nextTestTemperature + "\n");
-        builder.append("}");
-
-        return builder.toString();
-    }
-
-    /**
-     * Json event bad name.
-     *
-     * @return the string
-     */
-    public static String jsonEventBadName() {
-        final Random rand = new Random();
-
-        final StringBuilder builder = new StringBuilder();
-
-        int nextEventNo = rand.nextInt(2);
-        final int nextMatchCase = rand.nextInt(4);
-        final float nextTestTemperature = rand.nextFloat() * 10000;
-
-        builder.append("{\n");
-        builder.append("  \"nameSpace\": \"org.onap.policy.apex.sample.events\",\n");
-        builder.append("  \"name\": \"%%%%\",\n");
-        builder.append("  \"version\": \"0.0.1\",\n");
-        builder.append("  \"source\": \"test\",\n");
-        builder.append("  \"target\": \"apex\",\n");
-        builder.append("  \"TestSlogan\": \"Test slogan for External Event" + (nextEventNo++) + "\",\n");
-        builder.append("  \"TestMatchCase\": " + nextMatchCase + ",\n");
-        builder.append("  \"TestTimestamp\": " + System.currentTimeMillis() + ",\n");
-        builder.append("  \"TestTemperature\": " + nextTestTemperature + "\n");
-        builder.append("}");
-
-        return builder.toString();
-    }
-
-    /**
-     * Json event no ex name.
-     *
-     * @return the string
-     */
-    public static String jsonEventNoExName() {
-        final Random rand = new Random();
-
-        final StringBuilder builder = new StringBuilder();
-
-        int nextEventNo = rand.nextInt(2);
-        final int nextMatchCase = rand.nextInt(4);
-        final float nextTestTemperature = rand.nextFloat() * 10000;
-
-        builder.append("{\n");
-        builder.append("  \"nameSpace\": \"org.onap.policy.apex.sample.events\",\n");
-        builder.append("  \"name\": \"I_DONT_EXIST\",\n");
-        builder.append("  \"source\": \"test\",\n");
-        builder.append("  \"target\": \"apex\",\n");
-        builder.append("  \"TestSlogan\": \"Test slogan for External Event" + (nextEventNo++) + "\",\n");
-        builder.append("  \"TestMatchCase\": " + nextMatchCase + ",\n");
-        builder.append("  \"TestTimestamp\": " + System.currentTimeMillis() + ",\n");
-        builder.append("  \"TestTemperature\": " + nextTestTemperature + "\n");
-        builder.append("}");
-
-        return builder.toString();
-    }
-
-    /**
-     * Json event no version.
-     *
-     * @return the string
-     */
-    public static String jsonEventNoVersion() {
-        final Random rand = new Random();
-
-        final StringBuilder builder = new StringBuilder();
-
-        int nextEventNo = rand.nextInt(2);
-        final String eventName = (nextEventNo == 0 ? "Event0000" : "Event0100");
-        final int nextMatchCase = rand.nextInt(4);
-        final float nextTestTemperature = rand.nextFloat() * 10000;
-
-        builder.append("{\n");
-        builder.append("  \"nameSpace\": \"org.onap.policy.apex.sample.events\",\n");
-        builder.append("  \"name\": \"" + eventName + "\",\n");
-        builder.append("  \"versiion\": \"0.0.1\",\n");
-        builder.append("  \"source\": \"test\",\n");
-        builder.append("  \"target\": \"apex\",\n");
-        builder.append("  \"TestSlogan\": \"Test slogan for External Event" + (nextEventNo++) + "\",\n");
-        builder.append("  \"TestMatchCase\": " + nextMatchCase + ",\n");
-        builder.append("  \"TestTimestamp\": " + System.currentTimeMillis() + ",\n");
-        builder.append("  \"TestTemperature\": " + nextTestTemperature + "\n");
-        builder.append("}");
-
-        return builder.toString();
-    }
-
-    /**
-     * Json event bad version.
-     *
-     * @return the string
-     */
-    public static String jsonEventBadVersion() {
-        final Random rand = new Random();
-
-        final StringBuilder builder = new StringBuilder();
-
-        int nextEventNo = rand.nextInt(2);
-        final String eventName = (nextEventNo == 0 ? "Event0000" : "Event0100");
-        final int nextMatchCase = rand.nextInt(4);
-        final float nextTestTemperature = rand.nextFloat() * 10000;
-
-        builder.append("{\n");
-        builder.append("  \"nameSpace\": \"org.onap.policy.apex.sample.events\",\n");
-        builder.append("  \"name\": \"" + eventName + "\",\n");
-        builder.append("  \"version\": \"#####\",\n");
-        builder.append("  \"source\": \"test\",\n");
-        builder.append("  \"target\": \"apex\",\n");
-        builder.append("  \"TestSlogan\": \"Test slogan for External Event" + (nextEventNo++) + "\",\n");
-        builder.append("  \"TestMatchCase\": " + nextMatchCase + ",\n");
-        builder.append("  \"TestTimestamp\": " + System.currentTimeMillis() + ",\n");
-        builder.append("  \"TestTemperature\": " + nextTestTemperature + "\n");
-        builder.append("}");
-
-        return builder.toString();
-    }
-
-    /**
-     * Json event no ex version.
-     *
-     * @return the string
-     */
-    public static String jsonEventNoExVersion() {
-        final Random rand = new Random();
-
-        final StringBuilder builder = new StringBuilder();
-
-        int nextEventNo = rand.nextInt(2);
-        final int nextMatchCase = rand.nextInt(4);
-        final float nextTestTemperature = rand.nextFloat() * 10000;
-
-        builder.append("{\n");
-        builder.append("  \"nameSpace\": \"org.onap.policy.apex.sample.events\",\n");
-        builder.append("  \"name\": \"Event0000\",\n");
-        builder.append("  \"version\": \"1.2.3\",\n");
-        builder.append("  \"source\": \"test\",\n");
-        builder.append("  \"target\": \"apex\",\n");
-        builder.append("  \"TestSlogan\": \"Test slogan for External Event" + (nextEventNo++) + "\",\n");
-        builder.append("  \"TestMatchCase\": " + nextMatchCase + ",\n");
-        builder.append("  \"TestTimestamp\": " + System.currentTimeMillis() + ",\n");
-        builder.append("  \"TestTemperature\": " + nextTestTemperature + "\n");
-        builder.append("}");
-
-        return builder.toString();
-    }
-
-    /**
-     * Json event no namespace.
-     *
-     * @return the string
-     */
-    public static String jsonEventNoNamespace() {
-        final Random rand = new Random();
-
-        final StringBuilder builder = new StringBuilder();
-
-        int nextEventNo = rand.nextInt(2);
-        final String eventName = (nextEventNo == 0 ? "Event0000" : "Event0100");
-        final int nextMatchCase = rand.nextInt(4);
-        final float nextTestTemperature = rand.nextFloat() * 10000;
-
-        builder.append("{\n");
-        builder.append("  \"nameSpacee\": \"org.onap.policy.apex.sample.events\",\n");
-        builder.append("  \"name\": \"" + eventName + "\",\n");
-        builder.append("  \"version\": \"0.0.1\",\n");
-        builder.append("  \"source\": \"test\",\n");
-        builder.append("  \"target\": \"apex\",\n");
-        builder.append("  \"TestSlogan\": \"Test slogan for External Event" + (nextEventNo++) + "\",\n");
-        builder.append("  \"TestMatchCase\": " + nextMatchCase + ",\n");
-        builder.append("  \"TestTimestamp\": " + System.currentTimeMillis() + ",\n");
-        builder.append("  \"TestTemperature\": " + nextTestTemperature + "\n");
-        builder.append("}");
-
-        return builder.toString();
-    }
-
-    /**
-     * Json event bad namespace.
-     *
-     * @return the string
-     */
-    public static String jsonEventBadNamespace() {
-        final Random rand = new Random();
-
-        final StringBuilder builder = new StringBuilder();
-
-        int nextEventNo = rand.nextInt(2);
-        final String eventName = (nextEventNo == 0 ? "Event0000" : "Event0100");
-        final int nextMatchCase = rand.nextInt(4);
-        final float nextTestTemperature = rand.nextFloat() * 10000;
-
-        builder.append("{\n");
-        builder.append("  \"nameSpace\": \"hello.&&&&\",\n");
-        builder.append("  \"name\": \"" + eventName + "\",\n");
-        builder.append("  \"version\": \"0.0.1\",\n");
-        builder.append("  \"source\": \"test\",\n");
-        builder.append("  \"target\": \"apex\",\n");
-        builder.append("  \"TestSlogan\": \"Test slogan for External Event" + (nextEventNo++) + "\",\n");
-        builder.append("  \"TestMatchCase\": " + nextMatchCase + ",\n");
-        builder.append("  \"TestTimestamp\": " + System.currentTimeMillis() + ",\n");
-        builder.append("  \"TestTemperature\": " + nextTestTemperature + "\n");
-        builder.append("}");
-
-        return builder.toString();
-    }
-
-    /**
-     * Json event no ex namespace.
-     *
-     * @return the string
-     */
-    public static String jsonEventNoExNamespace() {
-        final Random rand = new Random();
-
-        final StringBuilder builder = new StringBuilder();
-
-        int nextEventNo = rand.nextInt(2);
-        final int nextMatchCase = rand.nextInt(4);
-        final float nextTestTemperature = rand.nextFloat() * 10000;
-
-        builder.append("{\n");
-        builder.append("  \"nameSpace\": \"pie.in.the.sky\",\n");
-        builder.append("  \"name\": \"Event0000\",\n");
-        builder.append("  \"version\": \"0.0.1\",\n");
-        builder.append("  \"source\": \"test\",\n");
-        builder.append("  \"target\": \"apex\",\n");
-        builder.append("  \"TestSlogan\": \"Test slogan for External Event" + (nextEventNo++) + "\",\n");
-        builder.append("  \"TestMatchCase\": " + nextMatchCase + ",\n");
-        builder.append("  \"TestTimestamp\": " + System.currentTimeMillis() + ",\n");
-        builder.append("  \"TestTemperature\": " + nextTestTemperature + "\n");
-        builder.append("}");
-
-        return builder.toString();
-    }
-
-    /**
-     * Json event no source.
-     *
-     * @return the string
-     */
-    public static String jsonEventNoSource() {
-        final Random rand = new Random();
-
-        final StringBuilder builder = new StringBuilder();
-
-        int nextEventNo = rand.nextInt(2);
-        final String eventName = (nextEventNo == 0 ? "Event0000" : "Event0100");
-        final int nextMatchCase = rand.nextInt(4);
-        final float nextTestTemperature = rand.nextFloat() * 10000;
-
-        builder.append("{\n");
-        builder.append("  \"nameSpace\": \"org.onap.policy.apex.sample.events\",\n");
-        builder.append("  \"name\": \"" + eventName + "\",\n");
-        builder.append("  \"version\": \"0.0.1\",\n");
-        builder.append("  \"sourcee\": \"test\",\n");
-        builder.append("  \"target\": \"apex\",\n");
-        builder.append("  \"TestSlogan\": \"Test slogan for External Event" + (nextEventNo++) + "\",\n");
-        builder.append("  \"TestMatchCase\": " + nextMatchCase + ",\n");
-        builder.append("  \"TestTimestamp\": " + System.currentTimeMillis() + ",\n");
-        builder.append("  \"TestTemperature\": " + nextTestTemperature + "\n");
-        builder.append("}");
-
-        return builder.toString();
-    }
-
-    /**
-     * Json event bad source.
-     *
-     * @return the string
-     */
-    public static String jsonEventBadSource() {
-        final Random rand = new Random();
-
-        final StringBuilder builder = new StringBuilder();
-
-        int nextEventNo = rand.nextInt(2);
-        final String eventName = (nextEventNo == 0 ? "Event0000" : "Event0100");
-        final int nextMatchCase = rand.nextInt(4);
-        final float nextTestTemperature = rand.nextFloat() * 10000;
-
-        builder.append("{\n");
-        builder.append("  \"nameSpace\": \"org.onap.policy.apex.sample.events\",\n");
-        builder.append("  \"name\": \"" + eventName + "\",\n");
-        builder.append("  \"version\": \"0.0.1\",\n");
-        builder.append("  \"source\": \"%!@**@!\",\n");
-        builder.append("  \"target\": \"apex\",\n");
-        builder.append("  \"TestSlogan\": \"Test slogan for External Event" + (nextEventNo++) + "\",\n");
-        builder.append("  \"TestMatchCase\": " + nextMatchCase + ",\n");
-        builder.append("  \"TestTimestamp\": " + System.currentTimeMillis() + ",\n");
-        builder.append("  \"TestTemperature\": " + nextTestTemperature + "\n");
-        builder.append("}");
-
-        return builder.toString();
-    }
-
-    /**
-     * Json event no target.
-     *
-     * @return the string
-     */
-    public static String jsonEventNoTarget() {
-        final Random rand = new Random();
-
-        final StringBuilder builder = new StringBuilder();
-
-        int nextEventNo = rand.nextInt(2);
-        final String eventName = (nextEventNo == 0 ? "Event0000" : "Event0100");
-        final int nextMatchCase = rand.nextInt(4);
-        final float nextTestTemperature = rand.nextFloat() * 10000;
-
-        builder.append("{\n");
-        builder.append("  \"nameSpace\": \"org.onap.policy.apex.sample.events\",\n");
-        builder.append("  \"name\": \"" + eventName + "\",\n");
-        builder.append("  \"version\": \"0.0.1\",\n");
-        builder.append("  \"source\": \"test\",\n");
-        builder.append("  \"targett\": \"apex\",\n");
-        builder.append("  \"TestSlogan\": \"Test slogan for External Event" + (nextEventNo++) + "\",\n");
-        builder.append("  \"TestMatchCase\": " + nextMatchCase + ",\n");
-        builder.append("  \"TestTimestamp\": " + System.currentTimeMillis() + ",\n");
-        builder.append("  \"TestTemperature\": " + nextTestTemperature + "\n");
-        builder.append("}");
-
-        return builder.toString();
-    }
-
-    /**
-     * Json event bad target.
-     *
-     * @return the string
-     */
-    public static String jsonEventBadTarget() {
-        final Random rand = new Random();
-
-        final StringBuilder builder = new StringBuilder();
-
-        int nextEventNo = rand.nextInt(2);
-        final String eventName = (nextEventNo == 0 ? "Event0000" : "Event0100");
-        final int nextMatchCase = rand.nextInt(4);
-        final float nextTestTemperature = rand.nextFloat() * 10000;
-
-        builder.append("{\n");
-        builder.append("  \"nameSpace\": \"org.onap.policy.apex.sample.events\",\n");
-        builder.append("  \"name\": \"" + eventName + "\",\n");
-        builder.append("  \"version\": \"0.0.1\",\n");
-        builder.append("  \"source\": \"test\",\n");
-        builder.append("  \"target\": \"KNIO(*S)A(S)D\",\n");
-        builder.append("  \"TestSlogan\": \"Test slogan for External Event" + (nextEventNo++) + "\",\n");
-        builder.append("  \"TestMatchCase\": " + nextMatchCase + ",\n");
-        builder.append("  \"TestTimestamp\": " + System.currentTimeMillis() + ",\n");
-        builder.append("  \"TestTemperature\": " + nextTestTemperature + "\n");
-        builder.append("}");
-
-        return builder.toString();
-    }
-
-    /**
-     * Json event missing fields.
-     *
-     * @return the string
-     */
-    public static String jsonEventMissingFields() {
-        final StringBuilder builder = new StringBuilder();
-
-        builder.append("{\n");
-        builder.append("  \"nameSpace\": \"org.onap.policy.apex.sample.events\",\n");
-        builder.append("  \"name\": \"Event0000\",\n");
-        builder.append("  \"version\": \"0.0.1\",\n");
-        builder.append("  \"source\": \"test\",\n");
-        builder.append("  \"target\": \"apex\"\n");
-        builder.append("}");
-
-        return builder.toString();
-    }
-
-    /**
-     * Json event null fields.
-     *
-     * @return the string
-     */
-    public static String jsonEventNullFields() {
-        final StringBuilder builder = new StringBuilder();
-
-        builder.append("{\n");
-        builder.append("  \"nameSpace\": \"org.onap.policy.apex.sample.events\",\n");
-        builder.append("  \"name\": \"Event0000\",\n");
-        builder.append("  \"version\": \"0.0.1\",\n");
-        builder.append("  \"source\": \"test\",\n");
-        builder.append("  \"target\": \"Apex\",\n");
-        builder.append("  \"TestSlogan\": null,\n");
-        builder.append("  \"TestMatchCase\": -1,\n");
-        builder.append("  \"TestTimestamp\": -1,\n");
-        builder.append("  \"TestTemperature\": -1.0\n");
+        nextEventNo += 1;
+        builder.append("  \"TestSlogan\": \"Test slogan for External Event").append(nextEventNo).append("\",\n");
+        builder.append("  \"TestMatchCase\": ").append(nextMatchCase).append(",\n");
+        builder.append("  \"TestTimestamp\": ").append(System.currentTimeMillis()).append(",\n");
+        builder.append("  \"TestTemperature\": ").append(nextTestTemperature).append("\n");
         builder.append("}");
 
         return builder.toString();
@@ -587,7 +162,7 @@
             return;
         }
 
-        int eventCount = 0;
+        int eventCount;
         try {
             eventCount = Integer.parseInt(args[0]);
         } catch (final Exception e) {
@@ -602,7 +177,6 @@
             LOGGER.info(jsonEvents(eventCount));
         } else {
             LOGGER.error("usage EventGenerator #events XML|JSON");
-            return;
         }
     }
 }
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/AsyncEventMimoTest.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/AsyncEventMimoTest.java
index cf6efdd..084d251 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/AsyncEventMimoTest.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/AsyncEventMimoTest.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Bell Canada. 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.
@@ -22,11 +22,13 @@
 
 package org.onap.policy.apex.testsuites.integration.uservice.adapt.events.syncasync;
 
-import java.io.File;
-import org.junit.After;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-public class AsyncEventMimoTest extends TestEventBase {
+import java.io.File;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
+
+class AsyncEventMimoTest extends TestEventBase {
     private final String[] outFilePaths = {
         "target/examples/events/SampleDomain/EventsOutMulti0.json",
         "target/examples/events/SampleDomain/EventsOutMulti1.json",
@@ -36,15 +38,15 @@
     /**
      * Delete output files.
      */
-    @After
-    public void deleteOutputFiles() {
+    @AfterEach
+    void deleteOutputFiles() {
         for (String filePath : outFilePaths) {
-            new File(filePath).delete();
+            assertTrue(new File(filePath).delete());
         }
     }
 
     @Test
-    public void testJsonFileAsyncMimo() throws Exception {
+    void testJsonFileAsyncMimo() throws Exception {
         final String[] args = {
             "-rfr",
             "target",
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/AsyncEventMisoTest.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/AsyncEventMisoTest.java
index 2da4f5b..3dfcdd7 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/AsyncEventMisoTest.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/AsyncEventMisoTest.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Bell Canada. 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.
@@ -22,11 +22,13 @@
 
 package org.onap.policy.apex.testsuites.integration.uservice.adapt.events.syncasync;
 
-import java.io.File;
-import org.junit.After;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-public class AsyncEventMisoTest extends TestEventBase {
+import java.io.File;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
+
+class AsyncEventMisoTest extends TestEventBase {
     private final String[] outFilePaths = {
         "target/examples/events/SampleDomain/EventsOutSingle.json"
     };
@@ -34,15 +36,15 @@
     /**
      * Delete output files.
      */
-    @After
-    public void deleteOutputFiles() {
+    @AfterEach
+    void deleteOutputFiles() {
         for (String filePath : outFilePaths) {
-            new File(filePath).delete();
+            assertTrue(new File(filePath).delete());
         }
     }
 
     @Test
-    public void testJsonFileAsyncMiso() throws Exception {
+    void testJsonFileAsyncMiso() throws Exception {
         final String[] args = {
             "-rfr",
             "target",
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/AsyncEventSimoTest.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/AsyncEventSimoTest.java
index 5e63b38..a73a27d 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/AsyncEventSimoTest.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/AsyncEventSimoTest.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Bell Canada. 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.
@@ -22,11 +22,13 @@
 
 package org.onap.policy.apex.testsuites.integration.uservice.adapt.events.syncasync;
 
-import java.io.File;
-import org.junit.After;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-public class AsyncEventSimoTest extends TestEventBase {
+import java.io.File;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
+
+class AsyncEventSimoTest extends TestEventBase {
     private final String[] outFilePaths = {
         "target/examples/events/SampleDomain/EventsOutMulti0.json",
         "target/examples/events/SampleDomain/EventsOutMulti1.json",
@@ -36,15 +38,15 @@
     /**
      * Delete output files.
      */
-    @After
-    public void deleteOutputFiles() {
+    @AfterEach
+    void deleteOutputFiles() {
         for (String filePath : outFilePaths) {
-            new File(filePath).delete();
+            assertTrue(new File(filePath).delete());
         }
     }
 
     @Test
-    public void testJsonFileAsyncSimo() throws Exception {
+    void testJsonFileAsyncSimo() throws Exception {
         final String[] args = {
             "-rfr",
             "target",
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/AsyncEventSisoTest.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/AsyncEventSisoTest.java
index 412d4be..3b8b8f8 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/AsyncEventSisoTest.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/AsyncEventSisoTest.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Bell Canada. 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.
@@ -22,11 +22,13 @@
 
 package org.onap.policy.apex.testsuites.integration.uservice.adapt.events.syncasync;
 
-import java.io.File;
-import org.junit.After;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-public class AsyncEventSisoTest extends TestEventBase {
+import java.io.File;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
+
+class AsyncEventSisoTest extends TestEventBase {
     private final String[] outFilePaths = {
         "target/examples/events/SampleDomain/EventsOutSingle.json"
     };
@@ -34,15 +36,15 @@
     /**
      * Delete output files.
      */
-    @After
-    public void deleteOutputFiles() {
+    @AfterEach
+    void deleteOutputFiles() {
         for (String filePath : outFilePaths) {
-            new File(filePath).delete();
+            assertTrue(new File(filePath).delete());
         }
     }
 
     @Test
-    public void testJsonFileAsyncSiso() throws Exception {
+    void testJsonFileAsyncSiso() throws Exception {
         final String[] args = {
             "-rfr",
             "target",
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/SyncEventMimoTest.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/SyncEventMimoTest.java
index 4826560..7f87b37 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/SyncEventMimoTest.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/SyncEventMimoTest.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Bell Canada. 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.
@@ -22,11 +22,13 @@
 
 package org.onap.policy.apex.testsuites.integration.uservice.adapt.events.syncasync;
 
-import java.io.File;
-import org.junit.After;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-public class SyncEventMimoTest extends TestEventBase {
+import java.io.File;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
+
+class SyncEventMimoTest extends TestEventBase {
     private final String[] outFilePaths = {
         "target/examples/events/SampleDomain/EventsOutMulti0.json",
         "target/examples/events/SampleDomain/EventsOutMulti1.json",
@@ -36,15 +38,15 @@
     /**
      * Delete output files.
      */
-    @After
-    public void deleteOutputFiles() {
+    @AfterEach
+    void deleteOutputFiles() {
         for (String filePath : outFilePaths) {
-            new File(filePath).delete();
+            assertTrue(new File(filePath).delete());
         }
     }
 
     @Test
-    public void testJsonFileAsyncMimo() throws Exception {
+    void testJsonFileAsyncMimo() throws Exception {
         final String[] args = {
             "-rfr",
             "target",
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/SyncEventSisoTest.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/SyncEventSisoTest.java
index 596bcbc..c7f0829 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/SyncEventSisoTest.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/events/syncasync/SyncEventSisoTest.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Bell Canada. 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.
@@ -22,11 +22,13 @@
 
 package org.onap.policy.apex.testsuites.integration.uservice.adapt.events.syncasync;
 
-import java.io.File;
-import org.junit.After;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-public class SyncEventSisoTest extends TestEventBase {
+import java.io.File;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
+
+class SyncEventSisoTest extends TestEventBase {
     private final String[] outFilePaths = {
         "target/examples/events/SampleDomain/EventsOutSingle.json"
     };
@@ -34,15 +36,15 @@
     /**
      * Delete output files.
      */
-    @After
-    public void deleteOutputFiles() {
+    @AfterEach
+    void deleteOutputFiles() {
         for (String filePath : outFilePaths) {
-            new File(filePath).delete();
+            assertTrue(new File(filePath).delete());
         }
     }
 
     @Test
-    public void testJsonFileAsyncSiso() throws Exception {
+    void testJsonFileAsyncSiso() throws Exception {
         final String[] args = {
             "-rfr",
             "target",
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/file/TestFile2File.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/file/TestFile2File.java
index 57e3053..95232d8 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/file/TestFile2File.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/file/TestFile2File.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2020-2022 Nordix Foundation.
+ *  Modifications Copyright (C) 2020-2022, 2024 Nordix Foundation.
  *  Modifications Copyright (C) 2020-2022 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,68 +22,68 @@
 
 package org.onap.policy.apex.testsuites.integration.uservice.adapt.file;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.io.File;
 import java.io.IOException;
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.policy.apex.core.infrastructure.messaging.MessagingException;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.service.engine.main.ApexMain;
 import org.onap.policy.common.utils.resources.TextFileUtils;
 
-public class TestFile2File {
+class TestFile2File {
     /**
      * Clear relative file root environment variable.
      */
-    @Before
-    public void clearRelativeFileRoot() {
+    @BeforeEach
+    void clearRelativeFileRoot() {
         System.clearProperty("APEX_RELATIVE_FILE_ROOT");
     }
 
     @Test
-    public void testJsonFileEvents() throws MessagingException, ApexException, IOException {
+    void testJsonFileEvents() throws ApexException, IOException {
         final String[] args = {"-rfr", "target", "-p", "target/examples/config/SampleDomain/File2FileJsonEvent.json"};
 
-        testFileEvents(args, "target/examples/events/SampleDomain/EventsOut.json", 44400);
+        testFileEvents(args);
     }
 
-    private void testFileEvents(final String[] args, final String outFilePath, final long expectedFileSize)
-            throws MessagingException, ApexException, IOException {
+    private void testFileEvents(final String[] args) throws ApexException, IOException {
         final ApexMain apexMain = new ApexMain(args);
 
-        final File outFile = new File(outFilePath);
+        final File outFile = new File("target/examples/events/SampleDomain/EventsOut.json");
 
         while (!outFile.exists()) {
             ThreadUtilities.sleep(500);
         }
 
         // Wait for the file to be filled
-        long outFileSize = 0;
+        long outFileSize;
         while (true) {
-            final String fileString = stripVariableLengthText(outFilePath);
+            final String fileString = stripVariableLengthText();
             outFileSize = fileString.length();
-            if (outFileSize > 0 && outFileSize >= expectedFileSize) {
+            if (outFileSize > 0 && outFileSize >= (long) 44400) {
                 break;
             }
             ThreadUtilities.sleep(500);
         }
 
         apexMain.shutdown();
-        assertEquals(expectedFileSize, outFileSize);
+        assertEquals(44400, outFileSize);
     }
 
     /**
      * Strip variable length text from file string.
      *
-     * @param outFile the file to read and strip
      * @return the stripped string
      * @throws IOException on out file read exceptions
      */
-    private String stripVariableLengthText(final String outFile) throws IOException {
-        return TextFileUtils.getTextFileAsString(outFile).replaceAll("\\s+", "").replaceAll(":\\d*\\.?\\d*,", ":0,")
-                .replaceAll(":\\d*}", ":0}").replaceAll("<value>\\d*\\.?\\d*</value>", "<value>0</value>");
+    private String stripVariableLengthText() throws IOException {
+        return TextFileUtils.getTextFileAsString("target/examples/events/SampleDomain/EventsOut.json")
+            .replaceAll("\\s+", "")
+            .replaceAll(":\\d*\\.?\\d*,", ":0,")
+            .replaceAll(":\\d*}", ":0}")
+            .replaceAll("<value>\\d*\\.?\\d*</value>", "<value>0</value>");
     }
 }
\ No newline at end of file
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/file/TestFile2FileFiltered.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/file/TestFile2FileFiltered.java
index a03b97e..f9ac03e 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/file/TestFile2FileFiltered.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/file/TestFile2FileFiltered.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2020-2021 Nordix Foundation.
+ *  Modifications Copyright (C) 2020-2021, 2024 Nordix Foundation.
  *  Modifications Copyright (C) 2020-2022 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,29 +22,28 @@
 
 package org.onap.policy.apex.testsuites.integration.uservice.adapt.file;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.io.File;
 import java.io.IOException;
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.policy.apex.core.infrastructure.messaging.MessagingException;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.service.engine.main.ApexMain;
 import org.onap.policy.common.utils.resources.TextFileUtils;
 
-public class TestFile2FileFiltered {
+class TestFile2FileFiltered {
     /**
      * Clear relative file root environment variable.
      */
-    @Before
-    public void clearRelativeFileRoot() {
+    @BeforeEach
+    void clearRelativeFileRoot() {
         System.clearProperty("APEX_RELATIVE_FILE_ROOT");
     }
 
     @Test
-    public void testJsonFilteredFileInOutEvents() throws MessagingException, ApexException, IOException {
+    void testJsonFilteredFileInOutEvents() throws ApexException, IOException {
         // @formatter:off
         final String[] args =
             { "-rfr", "target", "-p", "target/examples/config/SampleDomain/File2FileFilteredInOutJsonEvent.json" };
@@ -61,7 +60,7 @@
     }
 
     @Test
-    public void testJsonFilteredFileOutEvents() throws MessagingException, ApexException, IOException {
+    void testJsonFilteredFileOutEvents() throws ApexException, IOException {
         // @formatter:off
         final String[] args =
             { "-rfr", "target", "-p", "target/examples/config/SampleDomain/File2FileFilteredOutJsonEvent.json" };
@@ -78,7 +77,7 @@
     }
 
     @Test
-    public void testJsonFilteredFileInEvents() throws MessagingException, ApexException, IOException {
+    void testJsonFilteredFileInEvents() throws ApexException, IOException {
         // @formatter:off
         final String[] args =
             { "-rfr", "target", "-p", "target/examples/config/SampleDomain/File2FileFilteredInJsonEvent.json" };
@@ -94,7 +93,7 @@
     }
 
     private void testFilteredFileEvents(final String[] args, final String[] outFilePaths,
-            final long[] expectedFileSizes) throws MessagingException, ApexException, IOException {
+                                        final long[] expectedFileSizes) throws ApexException, IOException {
         final ApexMain apexMain = new ApexMain(args);
 
         final File outFile0 = new File(outFilePaths[0]);
@@ -104,7 +103,7 @@
         }
 
         // Wait for the file to be filled
-        long outFile0Size = 0;
+        long outFile0Size;
         for (int i = 0; i < 20; i++) {
             final String fileString = stripVariableLengthText(outFilePaths[0]);
             outFile0Size = fileString.length();
@@ -139,6 +138,6 @@
      */
     private String stripVariableLengthText(final String outFile) throws IOException {
         return TextFileUtils.getTextFileAsString(outFile).replaceAll("\\s+", "").replaceAll(":\\d*\\.?\\d*,", ":0,")
-                .replaceAll(":\\d*}", ":0}").replaceAll("<value>\\d*\\.?\\d*</value>", "<value>0</value>");
+            .replaceAll(":\\d*}", ":0}").replaceAll("<value>\\d*\\.?\\d*</value>", "<value>0</value>");
     }
 }
\ No newline at end of file
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/file/TestFile2FileIgnore.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/file/TestFile2FileIgnore.java
index 1fc98d6..de14b7f 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/file/TestFile2FileIgnore.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/file/TestFile2FileIgnore.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2020-2021 Nordix Foundation.
+ *  Modifications Copyright (C) 2020-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.
@@ -22,10 +22,10 @@
 package org.onap.policy.apex.testsuites.integration.uservice.adapt.file;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 import java.io.IOException;
-import org.onap.policy.apex.core.infrastructure.messaging.MessagingException;
 import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.service.engine.main.ApexMain;
@@ -43,42 +43,38 @@
      * The main method.
      *
      * @param args the arguments
-     * @throws MessagingException the messaging exception
      * @throws ApexException the apex exception
      * @throws IOException Signals that an I/O exception has occurred.
      */
-    public static void main(final String[] args) throws MessagingException, ApexException, IOException {
+    public static void main(final String[] args) throws ApexException, IOException {
         final String[] apexArgs = {"-rfr", "target", "-c", "examples/config/SampleDomain/File2FileJsonEvent.json"};
 
-        testFileEvents(apexArgs, "target/EventsOut.json", 48656);
+        testFileEvents(apexArgs);
     }
 
     /**
      * Test file events.
      *
      * @param args the args
-     * @param outFilePath the out file path
-     * @param expectedFileSize the expected file size
-     * @throws MessagingException the messaging exception
      * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
+     * @throws IOException   Signals that an I/O exception has occurred.
      */
-    private static void testFileEvents(final String[] args, final String outFilePath, final long expectedFileSize)
-        throws MessagingException, ApexException, IOException {
+    private static void testFileEvents(final String[] args)
+        throws ApexException, IOException {
         final ApexMain apexMain = new ApexMain(args);
 
-        final File outFile = new File(outFilePath);
+        final File outFile = new File("target/EventsOut.json");
 
         while (!outFile.exists()) {
             ThreadUtilities.sleep(500);
         }
 
         // Wait for the file to be filled
-        long outFileSize = 0;
+        long outFileSize;
         while (true) {
-            final String fileString = stripVariableLengthText(outFilePath);
+            final String fileString = stripVariableLengthText();
             outFileSize = fileString.length();
-            if (outFileSize > 0 && outFileSize >= expectedFileSize) {
+            if (outFileSize > 0 && outFileSize >= (long) 48656) {
                 break;
             }
             ThreadUtilities.sleep(500);
@@ -88,19 +84,19 @@
         ThreadUtilities.sleep(100000000);
 
         apexMain.shutdown();
-        outFile.delete();
-        assertEquals(outFileSize, expectedFileSize);
+        assertTrue(outFile.delete());
+        assertEquals(48656, outFileSize);
     }
 
     /**
      * Strip variable length text from file string.
      *
-     * @param outFile the file to read and strip
      * @return the stripped string
      * @throws IOException on out file read exceptions
      */
-    private static String stripVariableLengthText(final String outFile) throws IOException {
-        return TextFileUtils.getTextFileAsString(outFile).replaceAll("\\s+", "").replaceAll(":\\d*\\.?\\d*,", ":0,")
+    private static String stripVariableLengthText() throws IOException {
+        return TextFileUtils.getTextFileAsString("target/EventsOut.json")
+            .replaceAll("\\s+", "").replaceAll(":\\d*\\.?\\d*,", ":0,")
             .replaceAll(":\\d*}", ":0}").replaceAll("<value>\\d*\\.?\\d*</value>", "<value>0</value>");
     }
 }
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/JmsEventProducer.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/JmsEventProducer.java
index 119b306..ea0547c 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/JmsEventProducer.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/JmsEventProducer.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2020, 2023 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2020, 2023-2024 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -61,18 +61,18 @@
     /**
      * Instantiates a new jms event producer.
      *
-     * @param topic the topic
+     * @param topic             the topic
      * @param connectionFactory the connection factory
-     * @param username the username
-     * @param password the password
-     * @param eventCount the event count
-     * @param sendObjects the send objects
-     * @param eventInterval the event interval
+     * @param username          the username
+     * @param password          the password
+     * @param eventCount        the event count
+     * @param sendObjects       the send objects
+     * @param eventInterval     the event interval
      * @throws JMSException the JMS exception
      */
     public JmsEventProducer(final String topic, final ConnectionFactory connectionFactory, final String username,
-            final String password, final int eventCount, final boolean sendObjects,
-            final long eventInterval) throws JMSException {
+                            final String password, final int eventCount, final boolean sendObjects,
+                            final long eventInterval) throws JMSException {
         this.topic = topic;
         this.eventCount = eventCount;
         this.sendObjects = sendObjects;
@@ -91,7 +91,7 @@
     public void run() {
         final Topic jmsTopic = new ActiveMQTopic(topic);
         try (final Session jmsSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-                final MessageProducer jmsProducer = jmsSession.createProducer(jmsTopic)) {
+             final MessageProducer jmsProducer = jmsSession.createProducer(jmsTopic)) {
 
             while (producerThread.isAlive() && !stopFlag) {
                 ThreadUtilities.sleep(50);
@@ -117,7 +117,7 @@
     /**
      * Send events to topic.
      *
-     * @param jmsSession the jms session
+     * @param jmsSession  the jms session
      * @param jmsProducer the jms producer
      * @throws JMSException the JMS exception
      */
@@ -128,7 +128,7 @@
         for (int i = 0; i < eventCount; i++) {
             ThreadUtilities.sleep(eventInterval);
 
-            Message jmsMessage = null;
+            Message jmsMessage;
             if (sendObjects) {
                 final PingTestClass pingTestClass = new PingTestClass();
                 pingTestClass.setId(i);
@@ -139,7 +139,7 @@
             jmsProducer.send(jmsMessage);
             eventsSentCount++;
         }
-        LOGGER.debug("{} : completed, number of events sent", this.getClass().getName(), eventsSentCount);
+        LOGGER.debug("{} : completed, number of events sent: {}", this.getClass().getName(), eventsSentCount);
     }
 
     /**
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/JmsEventSubscriber.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/JmsEventSubscriber.java
index 7f0cd87..46a3320 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/JmsEventSubscriber.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/JmsEventSubscriber.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2020, 2023 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2020, 2023-2024 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -96,7 +96,7 @@
                     } else if (message instanceof TextMessage) {
                         ((TextMessage) message).getText();
                     } else {
-                        throw new ApexEventException("unknowm message \"" + message + "\" of type \""
+                        throw new ApexEventException("unknown message \"" + message + "\" of type \""
                                 + message.getClass().getName() + "\" received");
                     }
                     eventsReceivedCount++;
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/JmsServerRunner.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/JmsServerRunner.java
index 02d913d..4972823 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/JmsServerRunner.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/JmsServerRunner.java
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2022-2023 Nordix Foundation.
+ *  Copyright (C) 2022-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.
@@ -32,10 +32,10 @@
     private static final Logger LOGGER = LoggerFactory.getLogger(JmsServerRunner.class);
 
     // Embedded JMS server
-    private EmbeddedActiveMQ embedded;
+    private final EmbeddedActiveMQ embedded;
 
     // Thread to run the JMS server in
-    private Thread jmsServerRunnerThread;
+    private final Thread jmsServerRunnerThread;
 
     // Config fields
     private final String serverName;
@@ -45,7 +45,7 @@
      * Create the JMS Server.
      *
      * @param serverName Name of the server
-     * @param serverUri URI for the server
+     * @param serverUri  URI for the server
      * @throws Exception on errors
      */
     public JmsServerRunner(String serverName, String serverUri) throws Exception {
@@ -64,25 +64,25 @@
         embedded = new EmbeddedActiveMQ();
         embedded.setConfiguration(config);
 
-        LOGGER.debug("starting JMS Server " + serverName + " on URI " + serverUri + " . . .");
+        LOGGER.debug("starting JMS Server {} on URI {} . . .", serverName, serverUri);
 
         jmsServerRunnerThread = new Thread(this);
         jmsServerRunnerThread.start();
 
-        LOGGER.debug("requested start on JMS Server " + serverName + " on URI " + serverUri);
+        LOGGER.debug("requested start on JMS Server {} on URI {}", serverName, serverUri);
     }
 
     @Override
     public void run() {
         try {
-            LOGGER.debug("starting JMS Server thread " + serverName + " on URI " + serverUri + " . . .");
+            LOGGER.debug("starting JMS Server thread {} on URI {} . . .", serverName, serverUri);
             embedded.start();
 
             await().atMost(30, TimeUnit.SECONDS).until(() -> embedded.getActiveMQServer().isActive());
 
-            LOGGER.debug("started JMS Server thread " + serverName + " on URI " + serverUri);
+            LOGGER.debug("started JMS Server thread {} on URI {} ", serverName, serverUri);
         } catch (Exception e) {
-            LOGGER.warn("failed to start JMS Server thread " + serverName + " on URI " + serverUri, e);
+            LOGGER.warn("failed to start JMS Server thread {} on URI {}. {}", serverName, serverUri, e.getMessage());
         }
     }
 
@@ -92,20 +92,20 @@
      * @throws Exception on stop errors
      */
     public void stop() throws Exception {
-        LOGGER.debug("stopping JMS Server " + serverName + " on URI " + serverUri + " . . .");
+        LOGGER.debug("stopping JMS Server {} on URI {} . . .", serverName, serverUri);
 
         if (!embedded.getActiveMQServer().isActive()) {
-            LOGGER.debug("JMS Server " + serverName + " already stopped on URI " + serverUri + " . . .");
+            LOGGER.debug("JMS Server {} already stopped on URI {} . . .", serverName, serverUri);
             return;
         }
 
         embedded.stop();
 
-        LOGGER.debug("waiting on JMS Server " + serverName + " to stop on URI " + serverUri + " . . .");
+        LOGGER.debug("waiting on JMS Server {} to stop on URI {} . . .", serverName, serverUri);
 
         await().atMost(30, TimeUnit.SECONDS)
-                .until(() -> !embedded.getActiveMQServer().isActive() && !jmsServerRunnerThread.isAlive());
+            .until(() -> !embedded.getActiveMQServer().isActive() && !jmsServerRunnerThread.isAlive());
 
-        LOGGER.debug("stopping JMS Server " + serverName + " on URI " + serverUri + " . . .");
+        LOGGER.debug("stopping JMS Server {} on URI {} . . .", serverName, serverUri);
     }
 }
\ No newline at end of file
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/TestContext.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/TestContext.java
index f27162a..58d5a82 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/TestContext.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/TestContext.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2023 Nordix Foundation.
+ *  Modifications Copyright (C) 2023-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.
@@ -36,7 +36,6 @@
 import javax.naming.NameClassPair;
 import javax.naming.NameParser;
 import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.artemis.jms.client.ActiveMQTopic;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexRuntimeException;
@@ -48,7 +47,7 @@
  */
 public class TestContext implements Context {
 
-    private Properties testProperties;
+    private final Properties testProperties;
 
     /**
      * Instantiates a new test context.
@@ -57,7 +56,7 @@
         try {
             testProperties = new Properties();
 
-            final Map<String, Object> params = new HashMap<String, Object>();
+            final Map<String, Object> params = new HashMap<>();
             params.put("host", HOST);
             params.put("port", PORT);
             testProperties.put("ConnectionFactory", new ActiveMQConnectionFactory(TestJms2Jms.SERVER_URI));
@@ -73,7 +72,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public Object lookup(final Name name) throws NamingException {
+    public Object lookup(final Name name) {
         return null;
     }
 
@@ -81,7 +80,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public Object lookup(final String name) throws NamingException {
+    public Object lookup(final String name) {
         return testProperties.get(name);
     }
 
@@ -89,7 +88,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public void bind(final Name name, final Object obj) throws NamingException {
+    public void bind(final Name name, final Object obj) {
         // Not used here
     }
 
@@ -97,7 +96,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public void bind(final String name, final Object obj) throws NamingException {
+    public void bind(final String name, final Object obj) {
         // Not used here
     }
 
@@ -105,7 +104,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public void rebind(final Name name, final Object obj) throws NamingException {
+    public void rebind(final Name name, final Object obj) {
         // Not used here
     }
 
@@ -113,7 +112,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public void rebind(final String name, final Object obj) throws NamingException {
+    public void rebind(final String name, final Object obj) {
         // Not used here
     }
 
@@ -121,7 +120,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public void unbind(final Name name) throws NamingException {
+    public void unbind(final Name name) {
         // Not used here
     }
 
@@ -129,7 +128,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public void unbind(final String name) throws NamingException {
+    public void unbind(final String name) {
         // Not used here
     }
 
@@ -137,7 +136,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public void rename(final Name oldName, final Name newName) throws NamingException {
+    public void rename(final Name oldName, final Name newName) {
         // Not used here
     }
 
@@ -145,7 +144,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public void rename(final String oldName, final String newName) throws NamingException {
+    public void rename(final String oldName, final String newName) {
         // Not used here
     }
 
@@ -153,7 +152,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public NamingEnumeration<NameClassPair> list(final Name name) throws NamingException {
+    public NamingEnumeration<NameClassPair> list(final Name name) {
         return null;
     }
 
@@ -161,7 +160,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public NamingEnumeration<NameClassPair> list(final String name) throws NamingException {
+    public NamingEnumeration<NameClassPair> list(final String name) {
         return null;
     }
 
@@ -169,7 +168,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public NamingEnumeration<Binding> listBindings(final Name name) throws NamingException {
+    public NamingEnumeration<Binding> listBindings(final Name name) {
         return null;
     }
 
@@ -177,7 +176,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public NamingEnumeration<Binding> listBindings(final String name) throws NamingException {
+    public NamingEnumeration<Binding> listBindings(final String name) {
         return null;
     }
 
@@ -185,7 +184,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public void destroySubcontext(final Name name) throws NamingException {
+    public void destroySubcontext(final Name name) {
         // Not used here
     }
 
@@ -193,7 +192,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public void destroySubcontext(final String name) throws NamingException {
+    public void destroySubcontext(final String name) {
         // Not used here
     }
 
@@ -201,7 +200,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public Context createSubcontext(final Name name) throws NamingException {
+    public Context createSubcontext(final Name name) {
         return null;
     }
 
@@ -209,7 +208,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public Context createSubcontext(final String name) throws NamingException {
+    public Context createSubcontext(final String name) {
         return null;
     }
 
@@ -217,7 +216,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public Object lookupLink(final Name name) throws NamingException {
+    public Object lookupLink(final Name name) {
         return null;
     }
 
@@ -225,7 +224,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public Object lookupLink(final String name) throws NamingException {
+    public Object lookupLink(final String name) {
         return null;
     }
 
@@ -233,7 +232,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public NameParser getNameParser(final Name name) throws NamingException {
+    public NameParser getNameParser(final Name name) {
         return null;
     }
 
@@ -241,7 +240,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public NameParser getNameParser(final String name) throws NamingException {
+    public NameParser getNameParser(final String name) {
         return null;
     }
 
@@ -249,7 +248,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public Name composeName(final Name name, final Name prefix) throws NamingException {
+    public Name composeName(final Name name, final Name prefix) {
         return null;
     }
 
@@ -257,7 +256,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public String composeName(final String name, final String prefix) throws NamingException {
+    public String composeName(final String name, final String prefix) {
         return null;
     }
 
@@ -265,7 +264,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public Object addToEnvironment(final String propName, final Object propVal) throws NamingException {
+    public Object addToEnvironment(final String propName, final Object propVal) {
         return null;
     }
 
@@ -273,7 +272,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public Object removeFromEnvironment(final String propName) throws NamingException {
+    public Object removeFromEnvironment(final String propName) {
         return null;
     }
 
@@ -281,7 +280,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public Hashtable<?, ?> getEnvironment() throws NamingException {
+    public Hashtable<?, ?> getEnvironment() {
         return null;
     }
 
@@ -289,7 +288,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public void close() throws NamingException {
+    public void close() {
         // Not used here
     }
 
@@ -297,7 +296,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public String getNameInNamespace() throws NamingException {
+    public String getNameInNamespace() {
         return null;
     }
 }
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/TestInitialContextFactory.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/TestInitialContextFactory.java
index 071c426..ecda797 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/TestInitialContextFactory.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/TestInitialContextFactory.java
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  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.
@@ -23,7 +24,6 @@
 
 import java.util.Hashtable;
 import javax.naming.Context;
-import javax.naming.NamingException;
 import javax.naming.spi.InitialContextFactory;
 import lombok.NoArgsConstructor;
 
@@ -41,7 +41,7 @@
      * {@inheritDoc}.
      */
     @Override
-    public Context getInitialContext(final Hashtable<?, ?> environment) throws NamingException {
+    public Context getInitialContext(final Hashtable<?, ?> environment) {
         return context;
     }
 }
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/TestJms2Jms.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/TestJms2Jms.java
index 91417a5..8e4614c 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/TestJms2Jms.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/jms/TestJms2Jms.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2020, 2023 Nordix Foundation.
+ *  Modifications Copyright (C) 2020, 2023-2024 Nordix Foundation.
  *  Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,17 +23,16 @@
 package org.onap.policy.apex.testsuites.integration.uservice.adapt.jms;
 
 import static org.awaitility.Awaitility.await;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import jakarta.jms.JMSException;
-import java.io.IOException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.service.engine.main.ApexMain;
 import org.slf4j.Logger;
@@ -42,7 +41,7 @@
 /**
  * The Class TestJms2Jms.
  */
-public class TestJms2Jms {
+class TestJms2Jms {
     private static final Logger LOGGER = LoggerFactory.getLogger(TestJms2Jms.class);
 
     protected static final String SERVER_NAME = "JmsTestServer";
@@ -63,28 +62,26 @@
      *
      * @throws Exception the exception
      */
-    @BeforeClass
-    public static void setupEmbeddedJmsServer() throws Exception {
+    @BeforeAll
+    static void setupEmbeddedJmsServer() throws Exception {
         jmsServerRunner = new JmsServerRunner(SERVER_NAME, SERVER_URI);
 
-        await().pollDelay(3L, TimeUnit.SECONDS).until(() -> new AtomicBoolean(true).get() == true);
+        await().pollDelay(3L, TimeUnit.SECONDS).until(() -> new AtomicBoolean(true).get());
     }
 
     /**
      * Clear relative file root environment variable.
      */
-    @Before
-    public void clearRelativeFileRoot() {
+    @BeforeEach
+    void clearRelativeFileRoot() {
         System.clearProperty("APEX_RELATIVE_FILE_ROOT");
     }
 
     /**
      * Shutdown embedded jms server.
-     *
-     * @throws IOException Signals that an I/O exception has occurred.
      */
-    @AfterClass
-    public static void shutdownEmbeddedJmsServer() throws IOException {
+    @AfterAll
+    static void shutdownEmbeddedJmsServer() {
         try {
             if (jmsServerRunner != null) {
                 jmsServerRunner.stop();
@@ -99,10 +96,10 @@
      * Test jms object events.
      *
      * @throws ApexException the apex exception
-     * @throws JMSException the JMS exception
+     * @throws JMSException  the JMS exception
      */
     @Test
-    public void testJmsObjectEvents() throws ApexException, JMSException {
+    void testJmsObjectEvents() throws ApexException, JMSException {
         final String[] args = {
             "-rfr", "target", "-p", "target/examples/config/JMS/JMS2JMSObjectEvent.json"
         };
@@ -113,10 +110,10 @@
      * Test jms json events.
      *
      * @throws ApexException the apex exception
-     * @throws JMSException the JMS exception
+     * @throws JMSException  the JMS exception
      */
     @Test
-    public void testJmsJsonEvents() throws ApexException, JMSException {
+    void testJmsJsonEvents() throws ApexException, JMSException {
         final String[] args = {
             "-rfr", "target", "-p", "target/examples/config/JMS/JMS2JMSJsonEvent.json"
         };
@@ -126,22 +123,22 @@
     /**
      * Test jms events.
      *
-     * @param args the args
+     * @param args        the args
      * @param sendObjects the send objects
      * @throws ApexException the apex exception
-     * @throws JMSException the JMS exception
+     * @throws JMSException  the JMS exception
      */
     private void testJmsEvents(final String[] args, final Boolean sendObjects) throws ApexException, JMSException {
         final JmsEventSubscriber subscriber =
-                new JmsEventSubscriber(JMS_TOPIC_APEX_OUT, new ActiveMQConnectionFactory(SERVER_URI), null, null);
+            new JmsEventSubscriber(JMS_TOPIC_APEX_OUT, new ActiveMQConnectionFactory(SERVER_URI), null, null);
 
         final JmsEventProducer producer =
-                new JmsEventProducer(JMS_TOPIC_APEX_IN, new ActiveMQConnectionFactory(SERVER_URI), null, null,
-                        EVENT_COUNT, sendObjects, EVENT_INTERVAL);
+            new JmsEventProducer(JMS_TOPIC_APEX_IN, new ActiveMQConnectionFactory(SERVER_URI), null, null,
+                EVENT_COUNT, sendObjects, EVENT_INTERVAL);
 
         final ApexMain apexMain = new ApexMain(args);
 
-        await().atMost(3L, TimeUnit.SECONDS).until(() -> apexMain.isAlive());
+        await().atMost(3L, TimeUnit.SECONDS).until(apexMain::isAlive);
 
         producer.sendEvents();
 
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/kafka/KafkaEventProducer.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/kafka/KafkaEventProducer.java
index 2b90642..556f838 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/kafka/KafkaEventProducer.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/kafka/KafkaEventProducer.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2020, 2024 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,7 +22,7 @@
 
 package org.onap.policy.apex.testsuites.integration.uservice.adapt.kafka;
 
-import com.salesforce.kafka.test.junit4.SharedKafkaTestResource;
+import com.salesforce.kafka.test.junit5.SharedKafkaTestResource;
 import java.time.Duration;
 import lombok.Getter;
 import org.apache.kafka.clients.producer.Producer;
@@ -57,14 +57,14 @@
     /**
      * Instantiates a new kafka event producer.
      *
-     * @param topic the topic
+     * @param topic                   the topic
      * @param sharedKafkaTestResource the kafka server address
-     * @param eventCount the event count
-     * @param xmlEvents the xml events
-     * @param eventInterval the event interval
+     * @param eventCount              the event count
+     * @param xmlEvents               the xml events
+     * @param eventInterval           the event interval
      */
     public KafkaEventProducer(final String topic, final SharedKafkaTestResource sharedKafkaTestResource,
-        final int eventCount, final boolean xmlEvents, final long eventInterval) {
+                              final int eventCount, final boolean xmlEvents, final long eventInterval) {
         this.topic = topic;
         this.sharedKafkaTestResource = sharedKafkaTestResource;
         this.eventCount = eventCount;
@@ -116,13 +116,13 @@
                 eventInterval);
             ThreadUtilities.sleep(eventInterval);
 
-            String eventString = null;
+            String eventString;
             if (xmlEvents) {
                 eventString = EventGenerator.xmlEvent();
             } else {
                 eventString = EventGenerator.jsonEvent();
             }
-            producer.send(new ProducerRecord<String, String>(topic, "Event" + i + "Of" + eventCount, eventString));
+            producer.send(new ProducerRecord<>(topic, "Event" + i + "Of" + eventCount, eventString));
             producer.flush();
             eventsSentCount++;
             LOGGER.debug("****** Sent event No. {} ******\n{}", eventsSentCount, eventString);
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/kafka/KafkaEventSubscriber.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/kafka/KafkaEventSubscriber.java
index 5a6696d..dd3e9dd 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/kafka/KafkaEventSubscriber.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/kafka/KafkaEventSubscriber.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2020, 2024 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,16 +22,15 @@
 
 package org.onap.policy.apex.testsuites.integration.uservice.adapt.kafka;
 
-import com.salesforce.kafka.test.junit4.SharedKafkaTestResource;
+import com.salesforce.kafka.test.junit5.SharedKafkaTestResource;
 import java.time.Duration;
-import java.util.Arrays;
+import java.util.Collections;
 import java.util.Properties;
 import lombok.Getter;
 import org.apache.kafka.clients.consumer.ConsumerRecord;
 import org.apache.kafka.clients.consumer.ConsumerRecords;
 import org.apache.kafka.clients.consumer.KafkaConsumer;
 import org.apache.kafka.common.serialization.StringDeserializer;
-import org.onap.policy.apex.core.infrastructure.messaging.MessagingException;
 import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -58,12 +57,11 @@
     /**
      * Instantiates a new kafka event subscriber.
      *
-     * @param topic the topic
+     * @param topic                   the topic
      * @param sharedKafkaTestResource the kafka server address
-     * @throws MessagingException the messaging exception
      */
     public KafkaEventSubscriber(final String topic,
-        final SharedKafkaTestResource sharedKafkaTestResource) throws MessagingException {
+                                final SharedKafkaTestResource sharedKafkaTestResource) {
         this.topic = topic;
 
         final Properties consumerProperties = new Properties();
@@ -71,7 +69,7 @@
 
         consumer = sharedKafkaTestResource.getKafkaTestUtils().getKafkaConsumer(StringDeserializer.class,
             StringDeserializer.class, consumerProperties);
-        consumer.subscribe(Arrays.asList(topic));
+        consumer.subscribe(Collections.singletonList(topic));
 
         subscriberThread = new Thread(this);
         subscriberThread.start();
@@ -88,10 +86,10 @@
         while (subscriberThread.isAlive() && !subscriberThread.isInterrupted()) {
             try {
                 final ConsumerRecords<String, String> records = consumer.poll(POLL_DURATION);
-                for (final ConsumerRecord<String, String> record : records) {
+                for (final ConsumerRecord<String, String> rec : records) {
                     eventsReceivedCount++;
                     LOGGER.debug("****** Received event No. {} ******\noffset={}\nkey={}\n{}", eventsReceivedCount,
-                        record.offset(), record.key(), record.value());
+                        rec.offset(), rec.key(), rec.value());
                 }
             } catch (final Exception e) {
                 // Thread interrupted
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/kafka/TestKafka2Kafka.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/kafka/TestKafka2Kafka.java
index 50e6afb..a2da3c0 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/kafka/TestKafka2Kafka.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/kafka/TestKafka2Kafka.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2020, 2024 Nordix Foundation.
  *  Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,23 +23,26 @@
 package org.onap.policy.apex.testsuites.integration.uservice.adapt.kafka;
 
 import static org.awaitility.Awaitility.await;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.fail;
 
-import com.salesforce.kafka.test.junit4.SharedKafkaTestResource;
+import com.salesforce.kafka.test.junit5.SharedKafkaTestResource;
 import java.io.File;
 import java.io.IOException;
 import java.util.concurrent.TimeUnit;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.onap.policy.apex.service.engine.main.ApexMain;
 import org.onap.policy.common.utils.resources.TextFileUtils;
 
 /**
  * The Class TestKafka2Kafka tests Kafka event sending and reception.
  */
-public class TestKafka2Kafka {
+@ExtendWith(SharedKafkaTestResource.class)
+class TestKafka2Kafka {
     private static final long MAX_TEST_LENGTH = 300000;
 
     private static final int EVENT_COUNT = 25;
@@ -48,14 +51,15 @@
     /**
      * Clear relative file root environment variable.
      */
-    @Before
-    public void clearRelativeFileRoot() {
+    @BeforeEach
+    void clearRelativeFileRoot() {
         System.clearProperty("APEX_RELATIVE_FILE_ROOT");
     }
 
-    @ClassRule
-    public static final SharedKafkaTestResource sharedKafkaTestResource = new SharedKafkaTestResource()
-        // Start a cluster with 1 brokers.
+    @RegisterExtension
+    @Order(1)
+    static final SharedKafkaTestResource sharedKafkaTestResource = new SharedKafkaTestResource()
+        // Start a cluster with 1 broker.
         .withBrokers(1)
         // Disable topic auto-creation.
         .withBrokerProperty("auto.create.topics.enable", "false");
@@ -66,42 +70,40 @@
      * @throws Exception the apex exception
      */
     @Test
-    public void testJsonKafkaEvents() throws Exception {
+    void testJsonKafkaEvents() throws Exception {
         final String conditionedConfigFile = getConditionedConfigFile(
             "target" + File.separator + "examples/config/SampleDomain/Kafka2KafkaJsonEvent.json");
         final String[] args = {"-rfr", "target", "-p", conditionedConfigFile};
-        testKafkaEvents(args, false, "json");
+        testKafkaEvents(args);
     }
 
     /**
      * Test kafka events.
      *
      * @param args the args
-     * @param xmlEvents the xml events
-     * @param topicSuffix the topic suffix
      * @throws Exception on errors
      */
-    private void testKafkaEvents(String[] args, final Boolean xmlEvents, final String topicSuffix) throws Exception {
+    private void testKafkaEvents(String[] args) throws Exception {
 
-        sharedKafkaTestResource.getKafkaTestUtils().createTopic("apex-out-" + topicSuffix, 1, (short) 1);
-        sharedKafkaTestResource.getKafkaTestUtils().createTopic("apex-in-" + topicSuffix, 1, (short) 1);
+        sharedKafkaTestResource.getKafkaTestUtils().createTopic("apex-out-" + "json", 1, (short) 1);
+        sharedKafkaTestResource.getKafkaTestUtils().createTopic("apex-in-" + "json", 1, (short) 1);
 
         final KafkaEventSubscriber subscriber =
-            new KafkaEventSubscriber("apex-out-" + topicSuffix, sharedKafkaTestResource);
+            new KafkaEventSubscriber("apex-out-" + "json", sharedKafkaTestResource);
 
-        await().atMost(30, TimeUnit.SECONDS).until(() -> subscriber.isAlive());
+        await().atMost(30, TimeUnit.SECONDS).until(subscriber::isAlive);
 
         final ApexMain apexMain = new ApexMain(args);
-        await().atMost(10, TimeUnit.SECONDS).until(() -> apexMain.isAlive());
+        await().atMost(10, TimeUnit.SECONDS).until(apexMain::isAlive);
 
         long initWaitEndTIme = System.currentTimeMillis() + 10000;
 
         await().atMost(12, TimeUnit.SECONDS).until(() -> initWaitEndTIme < System.currentTimeMillis());
 
-        final KafkaEventProducer producer = new KafkaEventProducer("apex-in-" + topicSuffix, sharedKafkaTestResource,
-            EVENT_COUNT, xmlEvents, EVENT_INTERVAL);
+        final KafkaEventProducer producer = new KafkaEventProducer("apex-in-" + "json", sharedKafkaTestResource,
+            EVENT_COUNT, false, EVENT_INTERVAL);
 
-        await().atMost(30, TimeUnit.SECONDS).until(() -> producer.isAlive());
+        await().atMost(30, TimeUnit.SECONDS).until(producer::isAlive);
 
         producer.sendEvents();
 
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/restclient/TestExecutionPropertyRest.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/restclient/TestExecutionPropertyRest.java
index 593ddd0..56931b7 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/restclient/TestExecutionPropertyRest.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/restclient/TestExecutionPropertyRest.java
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2020,2023 Nordix Foundation.
+ *  Copyright (C) 2019-2020, 2023-2024 Nordix Foundation.
  *  Modifications Copyright (C) 2020-2021 Bell Canada. All rights reserved.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
@@ -24,7 +24,7 @@
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.awaitility.Awaitility.await;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import jakarta.ws.rs.client.Client;
 import jakarta.ws.rs.client.ClientBuilder;
@@ -32,11 +32,11 @@
 import java.io.ByteArrayOutputStream;
 import java.io.PrintStream;
 import java.util.concurrent.TimeUnit;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.apex.auth.clieditor.tosca.ApexCliToscaEditorMain;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.service.engine.main.ApexMain;
@@ -50,7 +50,7 @@
 /**
  * This class runs integration tests for execution property in restClient.
  */
-public class TestExecutionPropertyRest {
+class TestExecutionPropertyRest {
 
     private static final XLogger LOGGER = XLoggerFactory.getXLogger(TestExecutionPropertyRest.class);
 
@@ -70,8 +70,8 @@
      *
      * @throws Exception the exception
      */
-    @BeforeClass
-    public static void setUp() throws Exception {
+    @BeforeAll
+    static void setUp() throws Exception {
         if (NetworkUtil.isTcpPortOpen("localHost", PORT, 3, 50L)) {
             throw new IllegalStateException("port " + PORT + " is still in use");
         }
@@ -92,11 +92,9 @@
 
     /**
      * Tear down.
-     *
-     * @throws Exception the exception
      */
-    @AfterClass
-    public static void tearDown() throws Exception {
+    @AfterAll
+    static void tearDown() {
         if (server != null) {
             server.stop();
         }
@@ -105,8 +103,8 @@
     /**
      * Before test.
      */
-    @Before
-    public void beforeTest() {
+    @BeforeEach
+    void beforeTest() {
         System.clearProperty("APEX_RELATIVE_FILE_ROOT");
         System.setOut(new PrintStream(outContent));
         System.setErr(new PrintStream(errContent));
@@ -114,10 +112,11 @@
 
     /**
      * After test.
+     *
      * @throws ApexException the exception.
      */
-    @After
-    public void afterTest() throws ApexException {
+    @AfterEach
+    void afterTest() throws ApexException {
         if (null != apexMain) {
             apexMain.shutdown();
         }
@@ -129,7 +128,7 @@
      * Test Bad Url tag in Parameter .
      */
     @Test
-    public void testBadUrl() throws Exception {
+    void testBadUrl() {
         // @formatter:off
         final String[] cliArgs = new String[] {
             "-c",
@@ -158,17 +157,17 @@
 
         final String outString = outContent.toString();
 
-        LOGGER.info("testReplaceUrlTag-OUTSTRING=\n" + outString + "\nEnd-TagUrl");
+        LOGGER.info("testReplaceUrlTag-OUTSTRING=\n{}\nEnd-TagUrl", outString);
         assertThat(outString).contains("item \"url\" "
-                        + "value \"http://localhost:32801/TestExecutionRest/apex/event/tagId}\" INVALID, "
-                        + "invalid URL has been set for event sending on RESTCLIENT");
+            + "value \"http://localhost:32801/TestExecutionRest/apex/event/tagId}\" INVALID, "
+            + "invalid URL has been set for event sending on RESTCLIENT");
     }
 
     /**
      * Test Not find value for tags in Url .
      */
     @Test
-    public void testNoValueSetForTagUrl() throws Exception {
+    void testNoValueSetForTagUrl() {
         // @formatter:off
         final String[] cliArgs = new String[] {
             "-c",
@@ -200,14 +199,14 @@
                 .contains("key \"Number\" specified on url \"http://localhost:32801/TestExecutionRest/apex"
                     + "/event/{tagId}/{Number}\" not found in execution properties passed by the current policy"));
         assertTrue(apexMain.isAlive());
-        LOGGER.info("testNoValueSetForTagUrl-OUTSTRING=\n" + outContent.toString() + "\nEnd-TagUrl");
+        LOGGER.info("testNoValueSetForTagUrl-OUTSTRING=\n{}\nEnd-TagUrl", outContent);
     }
 
     /**
      * Test Bad Http code Filter.
      */
     @Test
-    public void testBadCodeFilter() throws Exception {
+    void testBadCodeFilter() {
         // @formatter:off
         final String[] cliArgs = new String[] {
             "-c",
@@ -237,14 +236,14 @@
         await().atMost(5, TimeUnit.SECONDS).until(() -> outContent.toString()
             .contains("failed with status code 500 and message \"{\"testToRun\": FetchHttpCode}"));
         assertTrue(apexMain.isAlive());
-        LOGGER.info("testBadCodeFilter-OUTSTRING=\n" + outContent.toString() + "\nEnd-TagUrl");
+        LOGGER.info("testBadCodeFilter-OUTSTRING=\n{}\nEnd-TagUrl", outContent);
     }
 
     /**
      * Test Http code filter set and multi-tag Url are transformed correctly.
      */
     @Test
-    public void testReplaceUrlMultiTag() throws Exception {
+    void testReplaceUrlMultiTag() {
         final Client client = ClientBuilder.newClient();
         // @formatter:off
         final String[] cliArgs = new String[] {
@@ -277,7 +276,8 @@
             return response.readEntity(String.class).contains("\"PostProperUrl\": 3");
         });
         assertTrue(apexMain.isAlive());
-        LOGGER.info("testReplaceUrlMultiTag-OUTSTRING=\n" + outContent.toString() + "\nEnd-MultiTagUrl");
+        LOGGER.info("testReplaceUrlMultiTag-OUTSTRING=\n{}\nEnd-MultiTagUrl", outContent);
+        client.close();
     }
 
 }
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/restclient/TestFile2Rest.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/restclient/TestFile2Rest.java
index 7370656..21f3d09 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/restclient/TestFile2Rest.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/restclient/TestFile2Rest.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2020,2023 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2020, 2023-2024 Nordix Foundation.
  *  Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,24 +24,22 @@
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.awaitility.Awaitility.await;
-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 com.google.gson.Gson;
 import jakarta.ws.rs.client.Client;
 import jakarta.ws.rs.client.ClientBuilder;
 import jakarta.ws.rs.core.Response;
 import java.io.ByteArrayOutputStream;
-import java.io.IOException;
 import java.io.PrintStream;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.onap.policy.apex.core.infrastructure.messaging.MessagingException;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.service.engine.main.ApexMain;
@@ -55,7 +53,7 @@
 /**
  * The Class TestFile2Rest.
  */
-public class TestFile2Rest {
+class TestFile2Rest {
     private static final XLogger LOGGER = XLoggerFactory.getXLogger(TestFile2Rest.class);
 
     private static final int PORT = 32801;
@@ -73,10 +71,10 @@
      *
      * @throws Exception the exception
      */
-    @BeforeClass
-    public static void setUp() throws Exception {
+    @BeforeAll
+    static void setUp() throws Exception {
         server = HttpServletServerFactoryInstance.getServerFactory().build("TestFile2Rest", false, null, PORT, false,
-                "/TestFile2Rest", false, false);
+            "/TestFile2Rest", false, false);
 
         server.addServletClass(null, TestRestClientEndpoint.class.getName());
         server.setSerializationProvider(GsonMessageBodyHandler.class.getName());
@@ -90,11 +88,9 @@
 
     /**
      * Tear down.
-     *
-     * @throws Exception the exception
      */
-    @AfterClass
-    public static void tearDown() throws Exception {
+    @AfterAll
+    static void tearDown() {
         if (server != null) {
             server.stop();
         }
@@ -103,8 +99,8 @@
     /**
      * Before test.
      */
-    @Before
-    public void beforeTest() {
+    @BeforeEach
+    void beforeTest() {
         System.clearProperty("APEX_RELATIVE_FILE_ROOT");
         System.setOut(new PrintStream(outContent));
         System.setErr(new PrintStream(errContent));
@@ -112,10 +108,11 @@
 
     /**
      * After test.
+     *
      * @throws ApexException the exception.
      */
-    @After
-    public void afterTest() throws ApexException {
+    @AfterEach
+    void afterTest() throws ApexException {
         if (null != apexMain) {
             apexMain.shutdown();
         }
@@ -126,12 +123,10 @@
     /**
      * Test file events post.
      *
-     * @throws MessagingException the messaging exception
      * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testFileEventsPost() throws MessagingException, ApexException, IOException {
+    void testFileEventsPost() throws ApexException {
         final Client client = ClientBuilder.newClient();
 
         // @formatter:off
@@ -142,7 +137,7 @@
             "target/examples/config/SampleDomain/File2RESTJsonEventPost.json"
         };
         // @formatter:on
-        final ApexMain apexMain = new ApexMain(args);
+        final ApexMain apexMainTemp = new ApexMain(args);
 
         Response response = null;
 
@@ -150,7 +145,7 @@
         for (int i = 0; i < 100; i++) {
             ThreadUtilities.sleep(100);
             response = client.target("http://localhost:32801/TestFile2Rest/apex/event/Stats")
-                    .request("application/json").get();
+                .request("application/json").get();
 
             if (Response.Status.OK.getStatusCode() != response.getStatus()) {
                 break;
@@ -158,27 +153,26 @@
 
             final String responseString = response.readEntity(String.class);
 
-            @SuppressWarnings("unchecked")
-            final Map<String, Object> jsonMap = new Gson().fromJson(responseString, Map.class);
+            @SuppressWarnings("unchecked") final Map<String, Object> jsonMap =
+                new Gson().fromJson(responseString, Map.class);
             if ((double) jsonMap.get("POST") == 100) {
                 break;
             }
         }
 
-        apexMain.shutdown();
+        apexMainTemp.shutdown();
 
         assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
+        client.close();
     }
 
     /**
      * Test file events put.
      *
-     * @throws MessagingException the messaging exception
      * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testFileEventsPut() throws MessagingException, ApexException, IOException {
+    void testFileEventsPut() throws ApexException {
         // @formatter:off
         final String[] args = {
             "-rfr",
@@ -187,7 +181,7 @@
             "target/examples/config/SampleDomain/File2RESTJsonEventPut.json"
         };
         // @formatter:on
-        final ApexMain apexMain = new ApexMain(args);
+        final ApexMain apexMainTemp = new ApexMain(args);
 
         final Client client = ClientBuilder.newClient();
 
@@ -197,7 +191,7 @@
         for (int i = 0; i < 20; i++) {
             ThreadUtilities.sleep(300);
             response = client.target("http://localhost:32801/TestFile2Rest/apex/event/Stats")
-                    .request("application/json").get();
+                .request("application/json").get();
 
             if (Response.Status.OK.getStatusCode() != response.getStatus()) {
                 break;
@@ -205,27 +199,24 @@
 
             final String responseString = response.readEntity(String.class);
 
-            @SuppressWarnings("unchecked")
-            final Map<String, Object> jsonMap = new Gson().fromJson(responseString, Map.class);
+            @SuppressWarnings("unchecked") final Map<String, Object> jsonMap =
+                new Gson().fromJson(responseString, Map.class);
             if ((double) jsonMap.get("PUT") == 20) {
                 break;
             }
         }
 
-        apexMain.shutdown();
+        apexMainTemp.shutdown();
 
         assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
+        client.close();
     }
 
     /**
      * Test file events no url.
-     *
-     * @throws MessagingException the messaging exception
-     * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testFileEventsNoUrl() throws MessagingException, ApexException, IOException {
+    void testFileEventsNoUrl() {
 
         final String[] args = {"src/test/resources/prodcons/File2RESTJsonEventNoURL.json"};
         apexMain = new ApexMain(args);
@@ -236,13 +227,9 @@
 
     /**
      * Test file events bad url.
-     *
-     * @throws MessagingException the messaging exception
-     * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testFileEventsBadUrl() throws MessagingException, ApexException, IOException {
+    void testFileEventsBadUrl() {
 
         final String[] args = {"src/test/resources/prodcons/File2RESTJsonEventBadURL.json"};
         apexMain = new ApexMain(args);
@@ -256,13 +243,9 @@
 
     /**
      * Test file events bad http method.
-     *
-     * @throws MessagingException the messaging exception
-     * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testFileEventsBadHttpMethod() throws MessagingException, ApexException, IOException {
+    void testFileEventsBadHttpMethod() {
 
         final String[] args = {"src/test/resources/prodcons/File2RESTJsonEventBadHTTPMethod.json"};
         apexMain = new ApexMain(args);
@@ -275,13 +258,9 @@
 
     /**
      * Test file events bad response.
-     *
-     * @throws MessagingException the messaging exception
-     * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testFileEventsBadResponse() throws MessagingException, ApexException, IOException {
+    void testFileEventsBadResponse() {
 
         final String[] args = {"src/test/resources/prodcons/File2RESTJsonEventPostBadResponse.json"};
         apexMain = new ApexMain(args);
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/restclient/TestRest2File.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/restclient/TestRest2File.java
index 34aaab8..557cfde 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/restclient/TestRest2File.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/restclient/TestRest2File.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2020,2023 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2020, 2023-2024 Nordix Foundation.
  *  Modifications Copyright (C) 2020-2021 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,20 +23,17 @@
 package org.onap.policy.apex.testsuites.integration.uservice.adapt.restclient;
 
 import static org.awaitility.Awaitility.await;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.io.ByteArrayOutputStream;
-import java.io.IOException;
 import java.io.PrintStream;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.util.concurrent.TimeUnit;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.policy.apex.core.infrastructure.messaging.MessagingException;
-import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.apex.service.engine.main.ApexMain;
 import org.onap.policy.common.endpoints.http.server.HttpServletServer;
 import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
@@ -48,7 +45,7 @@
 /**
  * The Class TestRest2File.
  */
-public class TestRest2File {
+class TestRest2File {
     private static final XLogger LOGGER = XLoggerFactory.getXLogger(TestRest2File.class);
 
     private static final int PORT = 32801;
@@ -64,8 +61,8 @@
     /**
      * Before Test.
      */
-    @Before
-    public void beforeTest() {
+    @BeforeEach
+    void beforeTest() {
         System.clearProperty("APEX_RELATIVE_FILE_ROOT");
         System.setOut(new PrintStream(outContent));
         System.setErr(new PrintStream(errContent));
@@ -76,8 +73,8 @@
      *
      * @throws Exception the exception
      */
-    @Before
-    public void setUp() throws Exception {
+    @BeforeEach
+    void setUp() throws Exception {
         server = HttpServletServerFactoryInstance.getServerFactory().build("TestRest2File", false, null, PORT, false,
             "/TestRest2File", false, false);
 
@@ -96,8 +93,8 @@
      *
      * @throws Exception the exception
      */
-    @After
-    public void tearDown() throws Exception {
+    @AfterEach
+    void tearDown() throws Exception {
         if (null != apexMain) {
             apexMain.shutdown();
         }
@@ -110,31 +107,26 @@
 
     /**
      * Test rest events in.
-     *
-     * @throws MessagingException the messaging exception
-     * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testRestEventsIn() throws MessagingException, ApexException, IOException {
+    void testRestEventsIn() {
         final String[] args = {"-rfr", "target", "-p", "target/examples/config/SampleDomain/REST2FileJsonEvent.json"};
 
         apexMain = new ApexMain(args);
         await().atMost(5, TimeUnit.SECONDS).until(
             () -> Files.readString(Path.of("target/examples/events/SampleDomain/EventsOut.json")).contains(
-                "04\",\n" + "  \"version\": \"0.0.1\",\n" + "  \"nameSpace\": \"org.onap.policy.apex.sample.events\""));
+                """
+                    04",
+                      "version": "0.0.1",
+                      "nameSpace": "org.onap.policy.apex.sample.events\""""));
         assertTrue(apexMain.isAlive());
     }
 
     /**
      * Test file empty events.
-     *
-     * @throws MessagingException the messaging exception
-     * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testFileEmptyEvents() throws MessagingException, ApexException, IOException {
+    void testFileEmptyEvents() {
 
         final String[] args = {"src/test/resources/prodcons/REST2FileJsonEmptyEvents.json"};
         apexMain = new ApexMain(args);
@@ -145,13 +137,9 @@
 
     /**
      * Test file events no url.
-     *
-     * @throws MessagingException the messaging exception
-     * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testFileEventsNoUrl() throws MessagingException, ApexException, IOException {
+    void testFileEventsNoUrl() {
 
         final String[] args = {"src/test/resources/prodcons/REST2FileJsonEventNoURL.json"};
         apexMain = new ApexMain(args);
@@ -162,13 +150,9 @@
 
     /**
      * Test file events bad url.
-     *
-     * @throws MessagingException the messaging exception
-     * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testFileEventsBadUrl() throws MessagingException, ApexException, IOException {
+    void testFileEventsBadUrl() {
 
         final String[] args = {"src/test/resources/prodcons/REST2FileJsonEventBadURL.json"};
         apexMain = new ApexMain(args);
@@ -180,13 +164,9 @@
 
     /**
      * Test file events bad http method.
-     *
-     * @throws MessagingException the messaging exception
-     * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testFileEventsBadHttpMethod() throws MessagingException, ApexException, IOException {
+    void testFileEventsBadHttpMethod() {
 
         final String[] args = {"src/test/resources/prodcons/REST2FileJsonEventBadHTTPMethod.json"};
         apexMain = new ApexMain(args);
@@ -199,13 +179,9 @@
 
     /**
      * Test file events bad response.
-     *
-     * @throws MessagingException the messaging exception
-     * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testFileEventsBadResponse() throws MessagingException, ApexException, IOException {
+    void testFileEventsBadResponse() {
 
         final String[] args = {"src/test/resources/prodcons/REST2FileJsonEventBadResponse.json"};
         apexMain = new ApexMain(args);
@@ -221,7 +197,7 @@
      * Check if a required string exists in the output.
      *
      * @param outputEventText the text to examine
-     * @param requiredString the string to search for
+     * @param requiredString  the string to search for
      */
     private void checkRequiredString(String outputEventText, String requiredString) {
         if (!outputEventText.contains(requiredString)) {
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/restserver/TestRestServer.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/restserver/TestRestServer.java
index 8a506e1..0c88a5b 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/restserver/TestRestServer.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/restserver/TestRestServer.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2020, 2023 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2020, 2023-2024 Nordix Foundation.
  *  Modifications Copyright (C) 2020-2021 Bell Canada. All rights reserved.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
@@ -25,8 +25,9 @@
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.awaitility.Awaitility.await;
-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.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import com.google.gson.Gson;
 import jakarta.ws.rs.client.Client;
@@ -34,15 +35,13 @@
 import jakarta.ws.rs.client.Entity;
 import jakarta.ws.rs.core.Response;
 import java.io.ByteArrayOutputStream;
-import java.io.IOException;
 import java.io.PrintStream;
 import java.util.Map;
 import java.util.Random;
 import java.util.concurrent.TimeUnit;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.policy.apex.core.infrastructure.messaging.MessagingException;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.service.engine.main.ApexMain;
 import org.onap.policy.common.utils.network.NetworkUtil;
@@ -52,7 +51,7 @@
 /**
  * The Class TestRestServer.
  */
-public class TestRestServer {
+class TestRestServer {
     private static final XLogger LOGGER = XLoggerFactory.getXLogger(TestRestServer.class);
 
     private final ByteArrayOutputStream outContent = new ByteArrayOutputStream();
@@ -66,8 +65,8 @@
     /**
      * Before Test.
      */
-    @Before
-    public void beforeTest() {
+    @BeforeEach
+    void beforeTest() {
         System.clearProperty("APEX_RELATIVE_FILE_ROOT");
         System.setOut(new PrintStream(outContent));
         System.setErr(new PrintStream(errContent));
@@ -76,8 +75,8 @@
     /**
      * After test.
      */
-    @After
-    public void afterTest() {
+    @AfterEach
+    void afterTest() {
         System.setOut(stdout);
         System.setErr(stderr);
     }
@@ -85,14 +84,12 @@
     /**
      * Test rest server put.
      *
-     * @throws MessagingException the messaging exception
-     * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
+     * @throws ApexException        the apex exception
      * @throws InterruptedException interrupted exception
      */
     @SuppressWarnings("unchecked")
     @Test
-    public void testRestServerPut() throws MessagingException, ApexException, IOException, InterruptedException {
+    void testRestServerPut() throws ApexException, InterruptedException {
         LOGGER.debug("testRestServerPut start");
 
         final String[] args = {"-rfr", "target", "-p", "target/examples/config/SampleDomain/RESTServerJsonEvent.json"};
@@ -116,6 +113,7 @@
             final String responseString = response.readEntity(String.class);
 
             jsonMap = new Gson().fromJson(responseString, Map.class);
+            response.close();
         }
 
         apexMain.shutdown();
@@ -123,22 +121,22 @@
         await().atMost(10L, TimeUnit.SECONDS).until(() -> !apexMain.isAlive());
 
         assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
+        assertNotNull(jsonMap);
         assertEquals("org.onap.policy.apex.sample.events", jsonMap.get("nameSpace"));
         assertEquals("Test slogan for External Event0", jsonMap.get("TestSlogan"));
         LOGGER.debug("testRestServerPut end");
+        client.close();
     }
 
     /**
      * Test rest server post.
      *
-     * @throws MessagingException the messaging exception
-     * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
+     * @throws ApexException        the apex exception
      * @throws InterruptedException interrupted exception
      */
     @SuppressWarnings("unchecked")
     @Test
-    public void testRestServerPost() throws MessagingException, ApexException, IOException, InterruptedException {
+    void testRestServerPost() throws ApexException, InterruptedException {
         LOGGER.debug("testRestServerPost start");
         final String[] args = {"-rfr", "target", "-p", "target/examples/config/SampleDomain/RESTServerJsonEvent.json"};
         final ApexMain apexMain = new ApexMain(args);
@@ -161,28 +159,29 @@
             final String responseString = response.readEntity(String.class);
 
             jsonMap = new Gson().fromJson(responseString, Map.class);
+            response.close();
         }
 
         apexMain.shutdown();
 
         await().atMost(10L, TimeUnit.SECONDS).until(() -> !apexMain.isAlive());
 
+        assertNotNull(jsonMap);
         assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
         assertEquals("org.onap.policy.apex.sample.events", jsonMap.get("nameSpace"));
         assertEquals("Test slogan for External Event0", jsonMap.get("TestSlogan"));
         LOGGER.debug("testRestServerPost end");
+        client.close();
     }
 
     /**
      * Test rest server get status.
      *
-     * @throws MessagingException the messaging exception
-     * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
+     * @throws ApexException        the apex exception
      * @throws InterruptedException interrupted exception
      */
     @Test
-    public void testRestServerGetStatus() throws MessagingException, ApexException, IOException, InterruptedException {
+    void testRestServerGetStatus() throws ApexException, InterruptedException {
         LOGGER.debug("testRestServerGetStatus start");
         final String[] args = {"-rfr", "target", "-p", "target/examples/config/SampleDomain/RESTServerJsonEvent.json"};
         final ApexMain apexMain = new ApexMain(args);
@@ -207,6 +206,8 @@
             if (Response.Status.OK.getStatusCode() != putResponse.getStatus()) {
                 break;
             }
+            postResponse.close();
+            putResponse.close();
         }
 
         final Response statResponse =
@@ -219,30 +220,30 @@
         await().atMost(10L, TimeUnit.SECONDS).until(() -> !apexMain.isAlive());
 
         assertEquals(Response.Status.OK.getStatusCode(), postResponse.getStatus());
+        assertNotNull(putResponse);
         assertEquals(Response.Status.OK.getStatusCode(), putResponse.getStatus());
         assertEquals(Response.Status.OK.getStatusCode(), statResponse.getStatus());
 
-        @SuppressWarnings("unchecked")
-        final Map<String, Object> jsonMap = new Gson().fromJson(responseString, Map.class);
+        @SuppressWarnings("unchecked") final Map<String, Object> jsonMap =
+            new Gson().fromJson(responseString, Map.class);
         assertEquals("[FirstConsumer", ((String) jsonMap.get("INPUTS")).substring(0, 14));
         assertEquals(1.0, jsonMap.get("STAT"));
         assertTrue((double) jsonMap.get("POST") >= 10.0);
         assertTrue((double) jsonMap.get("PUT") >= 10.0);
         LOGGER.debug("testRestServerGetStatus end");
+        client.close();
     }
 
     /**
      * Test rest server multi inputs.
      *
-     * @throws MessagingException the messaging exception
-     * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
+     * @throws ApexException        the apex exception
      * @throws InterruptedException interrupted exception
      */
     @SuppressWarnings("unchecked")
     @Test
-    public void testRestServerMultiInputs()
-        throws MessagingException, ApexException, IOException, InterruptedException {
+    void testRestServerMultiInputs()
+        throws ApexException, InterruptedException {
         LOGGER.debug("testRestServerMultiInputs start");
         final String[] args =
             {"-rfr", "target", "-p", "target/examples/config/SampleDomain/RESTServerJsonEventMultiIn.json"};
@@ -280,33 +281,34 @@
             final String secondResponseString = secondResponse.readEntity(String.class);
 
             secondJsonMap = new Gson().fromJson(secondResponseString, Map.class);
+            firstResponse.close();
+            secondResponse.close();
         }
 
         apexMain.shutdown();
 
         await().atMost(10L, TimeUnit.SECONDS).until(() -> !apexMain.isAlive());
 
+        assertNotNull(firstJsonMap);
         assertEquals(Response.Status.OK.getStatusCode(), firstResponse.getStatus());
         assertEquals("org.onap.policy.apex.sample.events", firstJsonMap.get("nameSpace"));
         assertEquals("Test slogan for External Event0", firstJsonMap.get("TestSlogan"));
 
+        assertNotNull(secondJsonMap);
         assertEquals(Response.Status.OK.getStatusCode(), secondResponse.getStatus());
         assertEquals("org.onap.policy.apex.sample.events", secondJsonMap.get("nameSpace"));
         assertEquals("Test slogan for External Event0", secondJsonMap.get("TestSlogan"));
         LOGGER.debug("testRestServerMultiInputs end");
+        client.close();
     }
 
     /**
      * Test rest server producer standalone.
      *
-     * @throws MessagingException the messaging exception
      * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
-     * @throws InterruptedException interrupted exception
      */
     @Test
-    public void testRestServerProducerStandalone()
-        throws MessagingException, ApexException, IOException, InterruptedException {
+    void testRestServerProducerStandalone() throws ApexException {
         LOGGER.debug("testRestServerProducerStandalone start");
         final String[] args = {"src/test/resources/prodcons/RESTServerJsonEventProducerStandalone.json"};
 
@@ -324,14 +326,10 @@
     /**
      * Test rest server producer host.
      *
-     * @throws MessagingException the messaging exception
      * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
-     * @throws InterruptedException interrupted exception
      */
     @Test
-    public void testRestServerProducerHost()
-        throws MessagingException, ApexException, IOException, InterruptedException {
+    void testRestServerProducerHost() throws ApexException {
         LOGGER.debug("testRestServerProducerHost start");
         final String[] args = {"src/test/resources/prodcons/RESTServerJsonEventProducerHost.json"};
 
@@ -348,14 +346,10 @@
     /**
      * Test rest server producer port.
      *
-     * @throws MessagingException the messaging exception
      * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
-     * @throws InterruptedException interrupted exception
      */
     @Test
-    public void testRestServerProducerPort()
-        throws MessagingException, ApexException, IOException, InterruptedException {
+    void testRestServerProducerPort() throws ApexException {
         LOGGER.debug("testRestServerProducerPort start");
         final String[] args = {"src/test/resources/prodcons/RESTServerJsonEventProducerPort.json"};
 
@@ -372,12 +366,10 @@
     /**
      * Test rest server consumer standalone no host.
      *
-     * @throws MessagingException the messaging exception
      * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testRestServerConsumerStandaloneNoHost() throws MessagingException, ApexException, IOException {
+    void testRestServerConsumerStandaloneNoHost() throws ApexException {
         LOGGER.debug("testRestServerConsumerStandaloneNoHost start");
         final String[] args = {"src/test/resources/prodcons/RESTServerJsonEventConsumerStandaloneNoHost.json"};
 
@@ -394,12 +386,10 @@
     /**
      * Test rest server consumer standalone no port.
      *
-     * @throws MessagingException the messaging exception
      * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testRestServerConsumerStandaloneNoPort() throws MessagingException, ApexException, IOException {
+    void testRestServerConsumerStandaloneNoPort() throws ApexException {
         LOGGER.debug("testRestServerConsumerStandaloneNoPort start");
         final String[] args = {"src/test/resources/prodcons/RESTServerJsonEventConsumerStandaloneNoPort.json"};
 
@@ -417,12 +407,10 @@
     /**
      * Test rest server producer not sync.
      *
-     * @throws MessagingException the messaging exception
      * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testRestServerProducerNotSync() throws MessagingException, ApexException, IOException {
+    void testRestServerProducerNotSync() throws ApexException {
         LOGGER.debug("testRestServerProducerNotSync start");
         final String[] args = {"src/test/resources/prodcons/RESTServerJsonEventProducerNotSync.json"};
 
@@ -441,12 +429,10 @@
     /**
      * Test rest server consumer not sync.
      *
-     * @throws MessagingException the messaging exception
      * @throws ApexException the apex exception
-     * @throws IOException Signals that an I/O exception has occurred.
      */
     @Test
-    public void testRestServerConsumerNotSync() throws MessagingException, ApexException, IOException {
+    void testRestServerConsumerNotSync() throws ApexException {
         LOGGER.debug("testRestServerConsumerNotSync start");
         final String[] args = {"src/test/resources/prodcons/RESTServerJsonEventConsumerNotSync.json"};
 
@@ -473,12 +459,10 @@
         final int nextMatchCase = rand.nextInt(4);
         final String nextEventName = "Event0" + rand.nextInt(2) + "00";
 
-        final String eventString = "{\n" + "\"nameSpace\": \"org.onap.policy.apex.sample.events\",\n" + "\"name\": \""
+        return "{\n" + "\"nameSpace\": \"org.onap.policy.apex.sample.events\",\n" + "\"name\": \""
             + nextEventName + "\",\n" + "\"version\": \"0.0.1\",\n" + "\"source\": \"REST_" + eventsSent++ + "\",\n"
             + "\"target\": \"apex\",\n" + "\"TestSlogan\": \"Test slogan for External Event0\",\n"
             + "\"TestMatchCase\": " + nextMatchCase + ",\n" + "\"TestTimestamp\": " + System.currentTimeMillis() + ",\n"
             + "\"TestTemperature\": 9080.866\n" + "}";
-
-        return eventString;
     }
 }
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/context/EventAlbumContextTest.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/context/EventAlbumContextTest.java
index b2ae68f..7ca8e1a 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/context/EventAlbumContextTest.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/context/EventAlbumContextTest.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2020, 2024 Nordix Foundation.
  *  Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,15 +22,16 @@
 
 package org.onap.policy.apex.testsuites.integration.uservice.context;
 
-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.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.File;
 import java.io.IOException;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import java.nio.file.Path;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 import org.onap.policy.apex.auth.clieditor.tosca.ApexCliToscaEditorMain;
 import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
@@ -38,7 +39,7 @@
 import org.onap.policy.common.utils.resources.ResourceUtils;
 import org.onap.policy.common.utils.resources.TextFileUtils;
 
-public class EventAlbumContextTest {
+class EventAlbumContextTest {
     private File tempCommandFile;
     private File tempLogFile;
     private File tempPolicyFile;
@@ -47,22 +48,22 @@
     private String outputFile;
     private String compareFile;
 
-    @Rule
-    public TemporaryFolder tempTestDir = new TemporaryFolder();
+    @TempDir
+    Path tempTestDir;
 
     /**
      * Clear relative file root environment variable.
      */
-    @Before
-    public void clearRelativeFileRoot() {
+    @BeforeEach
+    void clearRelativeFileRoot() {
         System.clearProperty("APEX_RELATIVE_FILE_ROOT");
     }
 
     @Test
-    public void testJavaEventAlbumContextTest() throws IOException, ApexException {
-        tempCommandFile = tempTestDir.newFile("TestPolicyJavaEventContext.apex");
-        tempLogFile = tempTestDir.newFile("TestPolicyJavaEventContext.log");
-        tempPolicyFile = tempTestDir.newFile("TestPolicyJavaEventContext.json");
+    void testJavaEventAlbumContextTest() throws IOException, ApexException {
+        tempCommandFile = tempTestDir.resolve("TestPolicyJavaEventContext.apex").toFile();
+        tempLogFile = tempTestDir.resolve("TestPolicyJavaEventContext.log").toFile();
+        tempPolicyFile = tempTestDir.resolve("TestPolicyJavaEventContext.json").toFile();
 
         eventContextString = ResourceUtils.getResourceAsString("examples/scripts/TestPolicyJavaEventContext.apex");
 
@@ -74,10 +75,10 @@
     }
 
     @Test
-    public void testAvroEventAlbumContextTest() throws IOException, ApexException {
-        tempCommandFile = tempTestDir.newFile("TestPolicyAvroEventContext.apex");
-        tempLogFile = tempTestDir.newFile("TestPolicyAvroEventContext.log");
-        tempPolicyFile = tempTestDir.newFile("TestPolicyAvroEventContext.json");
+    void testAvroEventAlbumContextTest() throws IOException, ApexException {
+        tempCommandFile = tempTestDir.resolve("TestPolicyAvroEventContext.apex").toFile();
+        tempLogFile = tempTestDir.resolve("TestPolicyAvroEventContext.log").toFile();
+        tempPolicyFile = tempTestDir.resolve("TestPolicyAvroEventContext.json").toFile();
 
         eventContextString = ResourceUtils.getResourceAsString("examples/scripts/TestPolicyAvroEventContext.apex");
 
@@ -107,7 +108,7 @@
             if (outputEventFile.exists() && outputEventFile.length() > 0) {
                 // The output event is in this file
                 receivedApexOutputString =
-                        TextFileUtils.getTextFileAsString(outputEventFile.getCanonicalPath()).replaceAll("\\s+", "");
+                    TextFileUtils.getTextFileAsString(outputEventFile.getCanonicalPath()).replaceAll("\\s+", "");
                 break;
             }
 
@@ -117,10 +118,10 @@
         // Shut down Apex
         apexMain.shutdown();
 
-        assertTrue("Test failed, the output event file was not created", outputEventFile.exists());
-        outputEventFile.delete();
+        assertTrue(outputEventFile.exists(), "Test failed, the output event file was not created");
+        assertTrue(outputEventFile.delete());
 
-        assertTrue("Test failed, the output event file was empty", receivedApexOutputString.length() > 0);
+        assertFalse(receivedApexOutputString.isEmpty(), "Test failed, the output event file was empty");
 
         // We compare the output to what we expect to get
         final String expectedFileContent = TextFileUtils.getTextFileAsString(compareFile);
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/engine/ApexServiceModelUpdateTest.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/engine/ApexServiceModelUpdateTest.java
index b3f9faa..9af22ce 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/engine/ApexServiceModelUpdateTest.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/engine/ApexServiceModelUpdateTest.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2020, 2024 Nordix Foundation.
  *  Modifications Copyright (C) 2020-2022 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,18 +23,18 @@
 package org.onap.policy.apex.testsuites.integration.uservice.engine;
 
 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.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.util.Date;
 import java.util.HashMap;
 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.apex.context.parameters.ContextParameterConstants;
 import org.onap.policy.apex.context.parameters.ContextParameters;
 import org.onap.policy.apex.context.parameters.DistributorParameters;
@@ -70,14 +70,13 @@
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
-public class ApexServiceModelUpdateTest {
+class ApexServiceModelUpdateTest {
     // Logger for this class
     private static final XLogger LOGGER = XLoggerFactory.getXLogger(ApexServiceModelUpdateTest.class);
 
     private final AxArtifactKey engineServiceKey = new AxArtifactKey("Machine-1_process-1_engine-1", "0.0.0");
     private final EngineServiceParameters parameters = new EngineServiceParameters();
     private EngineService service = null;
-    private TestListener listener = null;
     private int actionEventsReceived = 0;
 
     private AxPolicyModel apexSamplePolicyModel = null;
@@ -86,8 +85,8 @@
     /**
      * Set up parameters.
      */
-    @Before
-    public void setupParameters() {
+    @BeforeEach
+    void setupParameters() {
         ParameterService.register(new SchemaParameters());
         ParameterService.register(new ContextParameters());
         ParameterService.register(new DistributorParameters());
@@ -103,8 +102,8 @@
     /**
      * Clear down parameters.
      */
-    @After
-    public void teardownParameters() {
+    @AfterEach
+    void teardownParameters() {
         ParameterService.deregister(EngineParameterConstants.MAIN_GROUP_NAME);
         ParameterService.deregister(ApexParameterConstants.ENGINE_SERVICE_GROUP_NAME);
         ParameterService.deregister(ContextParameterConstants.PERSISTENCE_GROUP_NAME);
@@ -118,10 +117,10 @@
      * Sets up the test by creating an engine and reading in the test policy.
      *
      * @throws ApexException if something goes wrong
-     * @throws IOException on IO exceptions
+     * @throws IOException   on IO exceptions
      */
-    @Before
-    public void setUp() throws ApexException, IOException {
+    @BeforeEach
+    void setUp() throws ApexException, IOException {
         // create engine with 3 threads
         parameters.setInstanceCount(3);
         parameters.setName(engineServiceKey.getName());
@@ -140,17 +139,17 @@
         LOGGER.debug("Running TestApexEngine. . .");
 
         // create engine
-        listener = new TestListener();
+        TestListener listener = new TestListener();
         service.registerActionListener("MyListener", listener);
     }
 
     /**
-     * Tear down the the test infrastructure.
+     * Tear down the test infrastructure.
      *
      * @throws ApexException if there is an error
      */
-    @After
-    public void tearDown() throws Exception {
+    @AfterEach
+    void tearDown() throws Exception {
         if (service != null) {
             service.stop();
         }
@@ -161,10 +160,10 @@
      * Test start with no model.
      */
     @Test
-    public void testNoModelStart() {
+    void testNoModelStart() {
         assertThatThrownBy(service::startAll)
             .hasMessage("start()<-Machine-1_process-1_engine-1-0:0.0.0,STOPPED,  cannot start engine, "
-                    + "engine has not been initialized, its model is not loaded");
+                + "engine has not been initialized, its model is not loaded");
     }
 
     /**
@@ -173,7 +172,7 @@
      * @throws ApexException if there is an error
      */
     @Test
-    public void testModelUpdateStringNewNoForce() throws ApexException {
+    void testModelUpdateStringNewNoForce() throws ApexException {
         service.updateModel(parameters.getEngineKey(), apexSampleModelString, false);
 
         assertEquals(apexSamplePolicyModel.getKey(), ModelService.getModel(AxPolicyModel.class).getKey());
@@ -185,7 +184,7 @@
      * @throws ApexException if there is an error
      */
     @Test
-    public void testModelUpdateStringNewForce() throws ApexException {
+    void testModelUpdateStringNewForce() throws ApexException {
         service.updateModel(parameters.getEngineKey(), apexSampleModelString, true);
 
         assertEquals(apexSamplePolicyModel.getKey(), ModelService.getModel(AxPolicyModel.class).getKey());
@@ -197,7 +196,7 @@
      * @throws ApexException if there is an error
      */
     @Test
-    public void testModelUpdateStringNewNewNoForce() throws ApexException {
+    void testModelUpdateStringNewNewNoForce() throws ApexException {
         service.updateModel(parameters.getEngineKey(), apexSampleModelString, false);
 
         assertEquals(apexSamplePolicyModel.getKey(), ModelService.getModel(AxPolicyModel.class).getKey());
@@ -216,7 +215,7 @@
      * @throws ApexException if there is an error
      */
     @Test
-    public void testModelUpdateIncoNoForce() throws ApexException {
+    void testModelUpdateIncoNoForce() throws ApexException {
         service.updateModel(parameters.getEngineKey(), apexSamplePolicyModel, false);
 
         assertEquals(apexSamplePolicyModel.getKey(), ModelService.getModel(AxPolicyModel.class).getKey());
@@ -227,8 +226,8 @@
 
         assertThatThrownBy(() -> service.updateModel(parameters.getEngineKey(), incoPolicyModel0, false))
             .hasMessage("apex model update failed, supplied model with key \"INCOMPATIBLE:0.0.1\" is "
-                    + "not a compatible model update from the existing engine model " + "with key "
-                    + "\"SamplePolicyModelJAVASCRIPT:0.0.1\"");
+                + "not a compatible model update from the existing engine model " + "with key "
+                + "\"SamplePolicyModelJAVASCRIPT:0.0.1\"");
         // Still on old model
         sendEvents();
 
@@ -238,8 +237,8 @@
 
         assertThatThrownBy(() -> service.updateModel(parameters.getEngineKey(), incoPolicyModel1, false))
             .hasMessage("apex model update failed, supplied model with key \"SamplePolicyModelJAVASCRIPT:"
-                    + "1.0.1\" is not a compatible model update from the existing engine model with key "
-                    + "\"SamplePolicyModelJAVASCRIPT:0.0.1\"");
+                + "1.0.1\" is not a compatible model update from the existing engine model with key "
+                + "\"SamplePolicyModelJAVASCRIPT:0.0.1\"");
         // Still on old model
         sendEvents();
 
@@ -267,7 +266,7 @@
      * @throws ApexException if there is an error
      */
     @Test
-    public void testModelUpdateIncoForce() throws ApexException {
+    void testModelUpdateIncoForce() throws ApexException {
         service.updateModel(parameters.getEngineKey(), apexSamplePolicyModel, false);
 
         assertEquals(apexSamplePolicyModel.getKey(), ModelService.getModel(AxPolicyModel.class).getKey());
@@ -316,19 +315,19 @@
 
         // Send some events
         final Date testStartTime = new Date();
-        final Map<String, Object> eventDataMap = new HashMap<String, Object>();
+        final Map<String, Object> eventDataMap = new HashMap<>();
         eventDataMap.put("TestSlogan", "This is a test slogan");
         eventDataMap.put("TestMatchCase", (byte) 123);
         eventDataMap.put("TestTimestamp", testStartTime.getTime());
         eventDataMap.put("TestTemperature", 34.5445667);
 
         final ApexEvent event =
-                new ApexEvent("Event0000", "0.0.1", "org.onap.policy.apex.domains.sample.events", "test", "apex", "");
+            new ApexEvent("Event0000", "0.0.1", "org.onap.policy.apex.domains.sample.events", "test", "apex", "");
         event.putAll(eventDataMap);
         engineServiceEventInterface.sendEvent(event);
 
         final ApexEvent event2 =
-                new ApexEvent("Event0100", "0.0.1", "org.onap.policy.apex.domains.sample.events", "test", "apex", "");
+            new ApexEvent("Event0100", "0.0.1", "org.onap.policy.apex.domains.sample.events", "test", "apex", "");
         event2.putAll(eventDataMap);
         engineServiceEventInterface.sendEvent(event2);
 
@@ -352,14 +351,14 @@
          */
         @Override
         public synchronized void onApexEvent(final ApexEvent event) {
-            LOGGER.debug("result 1 is:" + event);
+            LOGGER.debug("result 1 is:{}", event);
             checkResult(event);
             actionEventsReceived++;
 
             final Date testStartTime = new Date((Long) event.get("TestTimestamp"));
             final Date testEndTime = new Date();
 
-            LOGGER.info("policy execution time: " + (testEndTime.getTime() - testStartTime.getTime()) + "ms");
+            LOGGER.info("policy execution time: {}ms", testEndTime.getTime() - testStartTime.getTime());
         }
 
         /**
@@ -374,13 +373,13 @@
             assertEquals((byte) 123, result.get("TestMatchCase"));
             assertEquals(34.5445667, result.get("TestTemperature"));
             assertTrue(((byte) result.get("TestMatchCaseSelected")) >= 0
-                    && ((byte) result.get("TestMatchCaseSelected") <= 3));
+                && ((byte) result.get("TestMatchCaseSelected") <= 3));
             assertTrue(((byte) result.get("TestEstablishCaseSelected")) >= 0
-                    && ((byte) result.get("TestEstablishCaseSelected") <= 3));
+                && ((byte) result.get("TestEstablishCaseSelected") <= 3));
             assertTrue(((byte) result.get("TestDecideCaseSelected")) >= 0
-                    && ((byte) result.get("TestDecideCaseSelected") <= 3));
+                && ((byte) result.get("TestDecideCaseSelected") <= 3));
             assertTrue(
-                    ((byte) result.get("TestActCaseSelected")) >= 0 && ((byte) result.get("TestActCaseSelected") <= 3));
+                ((byte) result.get("TestActCaseSelected")) >= 0 && ((byte) result.get("TestActCaseSelected") <= 3));
         }
     }
 
@@ -390,11 +389,11 @@
      * @param policyModel the eca policy model
      * @return the model string
      * @throws ApexModelException the apex model exception
-     * @throws IOException Signals that an I/O exception has occurred.
+     * @throws IOException        Signals that an I/O exception has occurred.
      */
     private String getModelString(final AxPolicyModel policyModel) throws ApexModelException, IOException {
         try (final ByteArrayOutputStream baOutputStream = new ByteArrayOutputStream()) {
-            new ApexModelWriter<AxPolicyModel>(AxPolicyModel.class).write(policyModel, baOutputStream);
+            new ApexModelWriter<>(AxPolicyModel.class).write(policyModel, baOutputStream);
             return baOutputStream.toString();
         }
     }
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/engine/ApexServiceTest.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/engine/ApexServiceTest.java
index e2464e3..386f042 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/engine/ApexServiceTest.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/engine/ApexServiceTest.java
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2020, 2024 Nordix Foundation.
  *  Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,21 +22,21 @@
 
 package org.onap.policy.apex.testsuites.integration.uservice.engine;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-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.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.apex.context.parameters.ContextParameterConstants;
 import org.onap.policy.apex.context.parameters.ContextParameters;
 import org.onap.policy.apex.context.parameters.DistributorParameters;
@@ -71,7 +71,7 @@
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
-public class ApexServiceTest {
+class ApexServiceTest {
     // Logger for this class
     private static final XLogger LOGGER = XLoggerFactory.getXLogger(ApexServiceTest.class);
 
@@ -82,16 +82,14 @@
     private static final AxArtifactKey engineServiceKey = new AxArtifactKey("Machine-1_process-1_engine-1", "0.0.0");
     private static final EngineServiceParameters parameters = new EngineServiceParameters();
     private static EngineService service = null;
-    private static TestListener listener = null;
-    private static AxPolicyModel apexPolicyModel = null;
     private static int actionEventsReceived = 0;
 
     private static String apexModelString;
 
     private boolean waitFlag = true;
 
-    @BeforeClass
-    public static void beforeSetUp() throws Exception {
+    @BeforeAll
+    static void beforeSetUp() throws Exception {
         // create engine with 3 threads
         parameters.setInstanceCount(3);
         parameters.setName(engineServiceKey.getName());
@@ -103,26 +101,26 @@
 
         LOGGER.debug("Running TestApexEngine. . .");
 
-        apexPolicyModel = new SampleDomainModelFactory().getSamplePolicyModel("JAVASCRIPT");
+        AxPolicyModel apexPolicyModel = new SampleDomainModelFactory().getSamplePolicyModel("JAVASCRIPT");
         assertNotNull(apexPolicyModel);
 
         apexModelString = getModelString(apexPolicyModel);
 
         // create engine
-        listener = new TestListener();
+        TestListener listener = new TestListener();
         service.registerActionListener("Listener", listener);
     }
 
-    @AfterClass
-    public static void afterCleardown() throws Exception {
+    @AfterAll
+    static void afterClearDown() {
         ModelService.clear();
     }
 
     /**
      * Set up parameters.
      */
-    @Before
-    public void setupParameters() {
+    @BeforeEach
+    void setupParameters() {
         ParameterService.register(new SchemaParameters());
         ParameterService.register(new ContextParameters());
         ParameterService.register(new DistributorParameters());
@@ -138,8 +136,8 @@
     /**
      * Clear down parameters.
      */
-    @After
-    public void teardownParameters() {
+    @AfterEach
+    void teardownParameters() {
         ParameterService.deregister(EngineParameterConstants.MAIN_GROUP_NAME);
         ParameterService.deregister(ApexParameterConstants.ENGINE_SERVICE_GROUP_NAME);
         ParameterService.deregister(ContextParameterConstants.PERSISTENCE_GROUP_NAME);
@@ -155,7 +153,7 @@
      * @throws ApexException if there is a problem
      */
     @Test
-    public void testExecutionSet1() throws ApexException {
+    void testExecutionSet1() throws ApexException {
         service.updateModel(parameters.getEngineKey(), apexModelString, true);
 
         final long starttime = System.currentTimeMillis();
@@ -173,20 +171,20 @@
 
         // Send some events
         final Date testStartTime = new Date();
-        final Map<String, Object> eventDataMap = new HashMap<String, Object>();
+        final Map<String, Object> eventDataMap = new HashMap<>();
         eventDataMap.put("TestSlogan", "This is a test slogan");
         eventDataMap.put("TestMatchCase", (byte) 123);
         eventDataMap.put("TestTimestamp", testStartTime.getTime());
         eventDataMap.put("TestTemperature", 34.5445667);
 
         final ApexEvent event =
-                new ApexEvent("Event0000", "0.0.1", "org.onap.policy.apex.domains.sample.events", "test", "apex", "");
+            new ApexEvent("Event0000", "0.0.1", "org.onap.policy.apex.domains.sample.events", "test", "apex", "");
         event.setExecutionId(System.nanoTime());
         event.putAll(eventDataMap);
         engineServiceEventInterface.sendEvent(event);
 
         final ApexEvent event2 =
-                new ApexEvent("Event0100", "0.0.1", "org.onap.policy.apex.domains.sample.events", "test", "apex", "");
+            new ApexEvent("Event0100", "0.0.1", "org.onap.policy.apex.domains.sample.events", "test", "apex", "");
         event2.setExecutionId(System.nanoTime());
         event2.putAll(eventDataMap);
         engineServiceEventInterface.sendEvent(event2);
@@ -217,7 +215,7 @@
      * @throws ApexException if there is a problem
      */
     @Test
-    public void testExecutionSet1Sync() throws ApexException {
+    void testExecutionSet1Sync() throws ApexException {
         service.updateModel(parameters.getEngineKey(), apexModelString, true);
 
         final long starttime = System.currentTimeMillis();
@@ -233,24 +231,21 @@
 
         // Send some events
         final Date testStartTime = new Date();
-        final Map<String, Object> eventDataMap = new HashMap<String, Object>();
+        final Map<String, Object> eventDataMap = new HashMap<>();
         eventDataMap.put("TestSlogan", "This is a test slogan");
         eventDataMap.put("TestMatchCase", (byte) 123);
         eventDataMap.put("TestTimestamp", testStartTime.getTime());
         eventDataMap.put("TestTemperature", 34.5445667);
 
         final ApexEvent event1 =
-                new ApexEvent("Event0000", "0.0.1", "org.onap.policy.apex.domains.sample.events", "test", "apex", "");
+            new ApexEvent("Event0000", "0.0.1", "org.onap.policy.apex.domains.sample.events", "test", "apex", "");
         event1.putAll(eventDataMap);
         event1.setExecutionId(System.nanoTime());
 
-        final ApexEventListener myEventListener1 = new ApexEventListener() {
-            @Override
-            public void onApexEvent(final ApexEvent responseEvent) {
-                assertNotNull("Synchronous sendEventWait failed", responseEvent);
-                assertEquals(event1.getExecutionId(), responseEvent.getExecutionId());
-                waitFlag = false;
-            }
+        final ApexEventListener myEventListener1 = responseEvent -> {
+            assertNotNull(responseEvent, "Synchronous sendEventWait failed");
+            assertEquals(event1.getExecutionId(), responseEvent.getExecutionId());
+            waitFlag = false;
         };
 
         waitFlag = true;
@@ -262,18 +257,15 @@
         }
 
         final ApexEvent event2 =
-                new ApexEvent("Event0100", "0.0.1", "org.onap.policy.apex.domains.sample.events", "test", "apex", "");
+            new ApexEvent("Event0100", "0.0.1", "org.onap.policy.apex.domains.sample.events", "test", "apex", "");
         event2.setExecutionId(System.nanoTime());
         event2.putAll(eventDataMap);
 
-        final ApexEventListener myEventListener2 = new ApexEventListener() {
-            @Override
-            public void onApexEvent(final ApexEvent responseEvent) {
-                assertNotNull("Synchronous sendEventWait failed", responseEvent);
-                assertEquals(event2.getExecutionId(), responseEvent.getExecutionId());
-                assertEquals(2, actionEventsReceived);
-                waitFlag = false;
-            }
+        final ApexEventListener myEventListener2 = responseEvent -> {
+            assertNotNull(responseEvent, "Synchronous sendEventWait failed");
+            assertEquals(event2.getExecutionId(), responseEvent.getExecutionId());
+            assertEquals(2, actionEventsReceived);
+            waitFlag = false;
         };
 
         waitFlag = true;
@@ -305,69 +297,7 @@
      * @throws ApexException if there is a problem
      */
     @Test
-    public void testExecutionSet2() throws ApexException {
-        service.updateModel(parameters.getEngineKey(), apexModelString, true);
-
-        final long starttime = System.currentTimeMillis();
-        for (final AxArtifactKey engineKey : service.getEngineKeys()) {
-            LOGGER.debug("{}", service.getStatus(engineKey));
-        }
-        while (!service.isStarted() && System.currentTimeMillis() - starttime < MAX_START_WAIT) {
-            ThreadUtilities.sleep(200);
-        }
-        if (!service.isStarted()) {
-            fail("Apex Service " + service.getKey() + " failed to start after " + MAX_START_WAIT + " ms");
-        }
-
-        final EngineServiceEventInterface engineServiceEventInterface = service.getEngineServiceEventInterface();
-
-        // Send some events
-        final Date testStartTime = new Date();
-        final Map<String, Object> eventDataMap = new HashMap<String, Object>();
-        eventDataMap.put("TestSlogan", "This is a test slogan");
-        eventDataMap.put("TestMatchCase", (byte) 123);
-        eventDataMap.put("TestTimestamp", testStartTime.getTime());
-        eventDataMap.put("TestTemperature", 34.5445667);
-
-        final ApexEvent event =
-                new ApexEvent("Event0000", "0.0.1", "org.onap.policy.apex.domains.sample.events", "test", "apex", "");
-        event.setExecutionId(System.nanoTime());
-        event.putAll(eventDataMap);
-        engineServiceEventInterface.sendEvent(event);
-
-        final ApexEvent event2 =
-                new ApexEvent("Event0100", "0.0.1", "org.onap.policy.apex.domains.sample.events", "test", "apex", "");
-        event2.setExecutionId(System.nanoTime());
-        event2.putAll(eventDataMap);
-        engineServiceEventInterface.sendEvent(event2);
-
-        // Wait for results
-        final long recvtime = System.currentTimeMillis();
-        while (actionEventsReceived < 2 && System.currentTimeMillis() - recvtime < MAX_RECV_WAIT) {
-            ThreadUtilities.sleep(100);
-        }
-        ThreadUtilities.sleep(500);
-        assertEquals(2, actionEventsReceived);
-        actionEventsReceived = 0;
-
-        // Stop all engines on this engine service
-        final long stoptime = System.currentTimeMillis();
-        service.stop();
-        while (!service.isStopped() && System.currentTimeMillis() - stoptime < MAX_STOP_WAIT) {
-            ThreadUtilities.sleep(200);
-        }
-        if (!service.isStopped()) {
-            fail("Apex Service " + service.getKey() + " failed to stop after " + MAX_STOP_WAIT + " ms");
-        }
-    }
-
-    /**
-     * Update the engine then test the engine with 2 sample events - again.
-     *
-     * @throws ApexException if there is a problem
-     */
-    @Test
-    public void testExecutionSet2Sync() throws ApexException {
+    void testExecutionSet2Sync() throws ApexException {
         service.updateModel(parameters.getEngineKey(), apexModelString, true);
 
         final long starttime = System.currentTimeMillis();
@@ -383,23 +313,20 @@
 
         // Send some events
         final Date testStartTime = new Date();
-        final Map<String, Object> eventDataMap = new HashMap<String, Object>();
+        final Map<String, Object> eventDataMap = new HashMap<>();
         eventDataMap.put("TestSlogan", "This is a test slogan");
         eventDataMap.put("TestMatchCase", (byte) 123);
         eventDataMap.put("TestTimestamp", testStartTime.getTime());
         eventDataMap.put("TestTemperature", 34.5445667);
 
         final ApexEvent event1 =
-                new ApexEvent("Event0000", "0.0.1", "org.onap.policy.apex.domains.sample.events", "test", "apex", "");
+            new ApexEvent("Event0000", "0.0.1", "org.onap.policy.apex.domains.sample.events", "test", "apex", "");
         event1.putAll(eventDataMap);
 
-        final ApexEventListener myEventListener1 = new ApexEventListener() {
-            @Override
-            public void onApexEvent(final ApexEvent responseEvent) {
-                assertNotNull("Synchronous sendEventWait failed", responseEvent);
-                assertEquals(event1.getExecutionId(), responseEvent.getExecutionId());
-                waitFlag = false;
-            }
+        final ApexEventListener myEventListener1 = responseEvent -> {
+            assertNotNull(responseEvent, "Synchronous sendEventWait failed");
+            assertEquals(event1.getExecutionId(), responseEvent.getExecutionId());
+            waitFlag = false;
         };
 
         waitFlag = true;
@@ -411,16 +338,13 @@
         }
 
         final ApexEvent event2 =
-                new ApexEvent("Event0100", "0.0.1", "org.onap.policy.apex.domains.sample.events", "test", "apex", "");
+            new ApexEvent("Event0100", "0.0.1", "org.onap.policy.apex.domains.sample.events", "test", "apex", "");
         event2.putAll(eventDataMap);
 
-        final ApexEventListener myEventListener2 = new ApexEventListener() {
-            @Override
-            public void onApexEvent(final ApexEvent responseEvent) {
-                assertNotNull("Synchronous sendEventWait failed", responseEvent);
-                assertEquals(event2.getExecutionId(), responseEvent.getExecutionId());
-                waitFlag = false;
-            }
+        final ApexEventListener myEventListener2 = responseEvent -> {
+            assertNotNull(responseEvent, "Synchronous sendEventWait failed");
+            assertEquals(event2.getExecutionId(), responseEvent.getExecutionId());
+            waitFlag = false;
         };
 
         waitFlag = true;
@@ -454,8 +378,8 @@
      *
      * @throws ApexException if there is an error
      */
-    @AfterClass
-    public static void tearDown() throws Exception {
+    @AfterAll
+    static void tearDown() throws Exception {
         // Stop all engines on this engine service
         final long stoptime = System.currentTimeMillis();
         service.stop();
@@ -481,14 +405,14 @@
          */
         @Override
         public synchronized void onApexEvent(final ApexEvent event) {
-            LOGGER.debug("result 1 is:" + event);
+            LOGGER.debug("result 1 is:{}", event);
             checkResult(event);
             actionEventsReceived++;
 
             final Date testStartTime = new Date((Long) event.get("TestTimestamp"));
             final Date testEndTime = new Date();
 
-            LOGGER.debug("policy execution time: " + (testEndTime.getTime() - testStartTime.getTime()) + "ms");
+            LOGGER.debug("policy execution time: {}ms", testEndTime.getTime() - testStartTime.getTime());
         }
 
         /**
@@ -503,13 +427,13 @@
             assertEquals((byte) 123, result.get("TestMatchCase"));
             assertEquals(34.5445667, result.get("TestTemperature"));
             assertTrue(((byte) result.get("TestMatchCaseSelected")) >= 0
-                    && ((byte) result.get("TestMatchCaseSelected") <= 3));
+                && ((byte) result.get("TestMatchCaseSelected") <= 3));
             assertTrue(((byte) result.get("TestEstablishCaseSelected")) >= 0
-                    && ((byte) result.get("TestEstablishCaseSelected") <= 3));
+                && ((byte) result.get("TestEstablishCaseSelected") <= 3));
             assertTrue(((byte) result.get("TestDecideCaseSelected")) >= 0
-                    && ((byte) result.get("TestDecideCaseSelected") <= 3));
+                && ((byte) result.get("TestDecideCaseSelected") <= 3));
             assertTrue(
-                    ((byte) result.get("TestActCaseSelected")) >= 0 && ((byte) result.get("TestActCaseSelected") <= 3));
+                ((byte) result.get("TestActCaseSelected")) >= 0 && ((byte) result.get("TestActCaseSelected") <= 3));
         }
     }
 
@@ -519,11 +443,11 @@
      * @param policyModel the eca policy model
      * @return the model string
      * @throws ApexModelException the apex model exception
-     * @throws IOException Signals that an I/O exception has occurred.
+     * @throws IOException        Signals that an I/O exception has occurred.
      */
     private static String getModelString(final AxPolicyModel policyModel) throws ApexModelException, IOException {
         try (final ByteArrayOutputStream baOutputStream = new ByteArrayOutputStream()) {
-            new ApexModelWriter<AxPolicyModel>(AxPolicyModel.class).write(policyModel, baOutputStream);
+            new ApexModelWriter<>(AxPolicyModel.class).write(policyModel, baOutputStream);
             return baOutputStream.toString();
         }
     }
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/executionproperties/DummyApexEventConsumer.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/executionproperties/DummyApexEventConsumer.java
index 226756b..0a9d69b 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/executionproperties/DummyApexEventConsumer.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/executionproperties/DummyApexEventConsumer.java
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2024 Nordix Foundation.
  *  Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
@@ -22,7 +22,6 @@
 
 package org.onap.policy.apex.testsuites.integration.uservice.executionproperties;
 
-import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.util.EnumMap;
@@ -56,27 +55,28 @@
     private String name = null;
 
     // The peer references for this event handler
-    private Map<EventHandlerPeeredMode, PeeredReference> peerReferenceMap = new EnumMap<>(EventHandlerPeeredMode.class);
+    private final Map<EventHandlerPeeredMode, PeeredReference> peerReferenceMap =
+        new EnumMap<>(EventHandlerPeeredMode.class);
 
     private DummyCarrierTechnologyParameters dummyConsumerProperties = null;
 
     @Override
     public void init(final String consumerName, final EventHandlerParameters consumerParameters,
-                    final ApexEventReceiver incomingEventReceiver) throws ApexEventException {
+                     final ApexEventReceiver incomingEventReceiver) throws ApexEventException {
         this.eventReceiver = incomingEventReceiver;
         this.name = consumerName;
 
         // Check and get the properties
         if (!(consumerParameters.getCarrierTechnologyParameters() instanceof DummyCarrierTechnologyParameters)) {
             String message = "specified consumer properties of type \""
-                            + consumerParameters.getCarrierTechnologyParameters().getClass().getName()
-                            + "\" are not applicable to a dummy consumer";
+                + consumerParameters.getCarrierTechnologyParameters().getClass().getName()
+                + "\" are not applicable to a dummy consumer";
             LOGGER.warn(message);
             throw new ApexEventException(message);
         }
 
         dummyConsumerProperties = (DummyCarrierTechnologyParameters) consumerParameters
-                        .getCarrierTechnologyParameters();
+            .getCarrierTechnologyParameters();
     }
 
     @Override
@@ -109,10 +109,10 @@
         public void run() {
             Properties executionProperties = new Properties();
             try {
-                executionProperties.load(new FileInputStream(new File(dummyConsumerProperties.getPropertyFileName())));
+                executionProperties.load(new FileInputStream(dummyConsumerProperties.getPropertyFileName()));
             } catch (IOException e1) {
                 String message = "reading of executor properties for testing failed from file: "
-                                + dummyConsumerProperties.getPropertyFileName();
+                    + dummyConsumerProperties.getPropertyFileName();
                 LOGGER.warn(message);
                 throw new ApexEventRuntimeException(message);
             }
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/executionproperties/DummyApexEventProducer.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/executionproperties/DummyApexEventProducer.java
index b22b258..ca25aea 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/executionproperties/DummyApexEventProducer.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/executionproperties/DummyApexEventProducer.java
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2024 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -56,11 +56,12 @@
     private String name = null;
 
     // The peer references for this event handler
-    private Map<EventHandlerPeeredMode, PeeredReference> peerReferenceMap = new EnumMap<>(EventHandlerPeeredMode.class);
+    private final Map<EventHandlerPeeredMode, PeeredReference> peerReferenceMap =
+        new EnumMap<>(EventHandlerPeeredMode.class);
 
     @Override
     public void init(final String producerName, final EventHandlerParameters producerParameters)
-            throws ApexEventException {
+        throws ApexEventException {
         this.name = producerName;
 
         // Check and get the Properties
@@ -70,7 +71,7 @@
             throw new ApexEventException(message);
         }
         dummyProducerProperties =
-                (DummyCarrierTechnologyParameters) producerParameters.getCarrierTechnologyParameters();
+            (DummyCarrierTechnologyParameters) producerParameters.getCarrierTechnologyParameters();
 
         new File(dummyProducerProperties.getPropertyFileName()).delete();
     }
@@ -96,10 +97,10 @@
      */
     @Override
     public void sendEvent(final long executionId, final Properties executionProperties, final String eventName,
-            final Object eventAsJsonString) {
+                          final Object eventAsJsonString) {
         // Check if this is a synchronized event, if so we have received a reply
         final SynchronousEventCache synchronousEventCache =
-                (SynchronousEventCache) peerReferenceMap.get(EventHandlerPeeredMode.SYNCHRONOUS);
+            (SynchronousEventCache) peerReferenceMap.get(EventHandlerPeeredMode.SYNCHRONOUS);
         if (synchronousEventCache != null) {
             synchronousEventCache.removeCachedEventToApexIfExists(executionId);
         }
@@ -114,17 +115,17 @@
         }
         if (!dummyProducerProperties.getTestToRun().equals(testEvent.getTestToRun())) {
             String message = "tests in received test event and parameters do not match " + testEvent.getTestToRun()
-                    + ":" + dummyProducerProperties.getTestToRun();
+                + ":" + dummyProducerProperties.getTestToRun();
             LOGGER.warn(message);
             throw new ApexEventRuntimeException(message);
         }
 
         try {
-            executionProperties.store(new FileOutputStream(new File(dummyProducerProperties.getPropertyFileName())),
-                    "");
+            executionProperties.store(new FileOutputStream(dummyProducerProperties.getPropertyFileName()),
+                "");
         } catch (IOException ioe) {
             String message = "writing of executor properties for testing failed from file: "
-                    + dummyProducerProperties.getPropertyFileName();
+                + dummyProducerProperties.getPropertyFileName();
             LOGGER.warn(message, ioe);
             throw new ApexEventRuntimeException(message, ioe);
         }
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/executionproperties/TestExecutionProperties.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/executionproperties/TestExecutionProperties.java
index d4855f9..e5cdcdc 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/executionproperties/TestExecutionProperties.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/executionproperties/TestExecutionProperties.java
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2020 Nordix Foundation.
+ *  Copyright (C) 2019-2020, 2024 Nordix Foundation.
  *  Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,27 +22,27 @@
 package org.onap.policy.apex.testsuites.integration.uservice.executionproperties;
 
 import static org.awaitility.Awaitility.await;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.io.File;
 import java.io.FileInputStream;
 import java.util.Properties;
 import java.util.concurrent.TimeUnit;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.apex.auth.clieditor.tosca.ApexCliToscaEditorMain;
 import org.onap.policy.apex.service.engine.main.ApexMain;
 
 /**
  * This class runs integration tests for execution properties.
  */
-public class TestExecutionProperties {
+class TestExecutionProperties {
 
     /**
      * Clear relative file root environment variable.
      */
-    @Before
-    public void clearRelativeFileRoot() {
+    @BeforeEach
+    void clearRelativeFileRoot() {
         System.clearProperty("APEX_RELATIVE_FILE_ROOT");
     }
 
@@ -50,7 +50,7 @@
      * Test read only execution properties are returned from policy.
      */
     @Test
-    public void testReadOnly() throws Exception {
+    void testReadOnly() throws Exception {
         testExecutionProperties("readOnly");
     }
 
@@ -58,7 +58,7 @@
      * Test where execution properties set in task.
      */
     @Test
-    public void testEmptyToDefined() throws Exception {
+    void testEmptyToDefined() throws Exception {
         testExecutionProperties("emptyToDefined");
     }
 
@@ -66,7 +66,7 @@
      * Test where execution properties cleared in task.
      */
     @Test
-    public void testDefinedToEmpty() throws Exception {
+    void testDefinedToEmpty() throws Exception {
         testExecutionProperties("definedToEmpty");
     }
 
@@ -74,7 +74,7 @@
      * Test where an execution properties added in task.
      */
     @Test
-    public void testAddProperty() throws Exception {
+    void testAddProperty() throws Exception {
         testExecutionProperties("addProperty");
     }
 
@@ -82,7 +82,7 @@
      * Test empty properties are transferred correctly.
      */
     @Test
-    public void testEmptyToEmpty() throws Exception {
+    void testEmptyToEmpty() throws Exception {
         testExecutionProperties("emptyToEmpty");
     }
 
@@ -117,15 +117,15 @@
         // @formatter:on
         final ApexMain apexMain = new ApexMain(args);
 
-        await().atMost(1, TimeUnit.SECONDS).until(() -> apexMain.isAlive());
-        await().atMost(10, TimeUnit.SECONDS).until(() -> outFile.exists());
+        await().atMost(1, TimeUnit.SECONDS).until(apexMain::isAlive);
+        await().atMost(10, TimeUnit.SECONDS).until(outFile::exists);
         await().atMost(1, TimeUnit.SECONDS).until(() -> outFile.length() > 0);
 
         apexMain.shutdown();
 
         Properties expectedProperties = new Properties();
         expectedProperties.load(new FileInputStream(
-                new File("src/test/resources/testdata/executionproperties/" + testName + "_out_expected.properties")));
+            "src/test/resources/testdata/executionproperties/" + testName + "_out_expected.properties"));
 
         Properties actualProperties = new Properties();
         actualProperties.load(new FileInputStream(outFile));
diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/taskparameters/TestTaskParameters.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/taskparameters/TestTaskParameters.java
index f78fd12..44908f4 100644
--- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/taskparameters/TestTaskParameters.java
+++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/taskparameters/TestTaskParameters.java
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2020,2023 Nordix Foundation.
+ *  Copyright (C) 2020, 2023-2024 Nordix Foundation.
  *  Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,16 +22,16 @@
 package org.onap.policy.apex.testsuites.integration.uservice.taskparameters;
 
 import static org.awaitility.Awaitility.await;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import jakarta.ws.rs.client.Client;
 import jakarta.ws.rs.client.ClientBuilder;
 import jakarta.ws.rs.core.Response;
 import java.util.concurrent.TimeUnit;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.onap.policy.apex.auth.clieditor.tosca.ApexCliToscaEditorMain;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.service.engine.main.ApexMain;
@@ -48,7 +48,7 @@
  * dynamically populated using executionProperties is hit and values get updated in
  * {@link RestClientEndpointForTaskParameters} which acts as a temporary server for requests.
  */
-public class TestTaskParameters {
+class TestTaskParameters {
 
     private static final XLogger LOGGER = XLoggerFactory.getXLogger(TestTaskParameters.class);
 
@@ -61,8 +61,8 @@
      *
      * @throws Exception the exception
      */
-    @BeforeClass
-    public static void setUp() throws Exception {
+    @BeforeAll
+    static void setUp() throws Exception {
         if (NetworkUtil.isTcpPortOpen(HOST, PORT, 3, 50L)) {
             throw new IllegalStateException("port " + PORT + " is still in use");
         }
@@ -85,10 +85,9 @@
     /**
      * Tear down.
      *
-     * @throws Exception the exception
      */
-    @AfterClass
-    public static void tearDown() throws Exception {
+    @AfterAll
+    static void tearDown() {
         if (server != null) {
             server.stop();
         }
@@ -97,8 +96,8 @@
     /**
      * Clear relative file root environment variable.
      */
-    @Before
-    public void clearRelativeFileRoot() {
+    @BeforeEach
+    void clearRelativeFileRoot() {
         System.clearProperty("APEX_RELATIVE_FILE_ROOT");
     }
 
@@ -107,7 +106,7 @@
      * updated to all tasks.
      */
     @Test
-    public void testTaskParameters_with_noTaskIds() throws Exception {
+    void testTaskParameters_with_noTaskIds() throws Exception {
         String responseEntity = testTaskParameters(
             "src/test/resources/testdata/taskparameters/TaskParameterTestConfig_with_noTaskIds.json");
         assertTrue(responseEntity.contains("{\"closedLoopId\": closedLoopId123,\"serviceId\": serviceId123}"));
@@ -118,7 +117,7 @@
      * that particular task alone.
      */
     @Test
-    public void testTaskParameters_with_validTaskIds() throws Exception {
+    void testTaskParameters_with_validTaskIds() throws Exception {
         String responseEntity = testTaskParameters(
             "src/test/resources/testdata/taskparameters/TaskParameterTestConfig_with_validTaskIds.json");
         assertTrue(responseEntity.contains("{\"closedLoopId\": closedLoopIdxyz,\"serviceId\": serviceIdxyz}"));
@@ -130,7 +129,7 @@
      * accessible in the task
      */
     @Test
-    public void testTaskParameters_with_invalidTaskIds() throws Exception {
+    void testTaskParameters_with_invalidTaskIds() throws Exception {
         String responseEntity = testTaskParameters(
             "src/test/resources/testdata/taskparameters/TaskParameterTestConfig_with_invalidTaskIds.json");
         assertTrue(responseEntity.contains("{\"closedLoopId\": INVALID - closedLoopId not available in TaskParameters,"
@@ -170,6 +169,7 @@
         String responseEntity = response.readEntity(String.class);
 
         LOGGER.info("testTaskParameters-OUTSTRING=\n {}", responseEntity);
+        client.close();
         return responseEntity;
     }
 }
