Removing deprecated DMAAP library
[policy/drools-pdp.git] / feature-pooling-messages / src / test / java / org / onap / policy / drools / pooling / EndToEndFeatureTest.java
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2018-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.
@@ -20,8 +21,8 @@
 
 package org.onap.policy.drools.pooling;
 
-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 static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.mock;
@@ -41,12 +42,12 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-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.Disabled;
+import org.junit.jupiter.api.Test;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
@@ -77,17 +78,17 @@ public class EndToEndFeatureTest {
     /**
      * UEB servers for both internal & external topics.
      */
-    private static final String UEB_SERVERS = "";
+    private static final String UEB_SERVERS = "ueb-server";
 
     /**
      * Name of the topic used for inter-host communication.
      */
-    private static final String INTERNAL_TOPIC = "";
+    private static final String INTERNAL_TOPIC = "internal-topic";
 
     /**
      * Name of the topic from which "external" events "arrive".
      */
-    private static final String EXTERNAL_TOPIC = "";
+    private static final String EXTERNAL_TOPIC = "external-topic";
 
     /**
      * Consumer group to use when polling the external topic.
@@ -141,7 +142,7 @@ public class EndToEndFeatureTest {
      * Setup before class.
      *
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         externalSink = TopicEndpointManager.getManager().addTopicSinks(makeSinkProperties(EXTERNAL_TOPIC)).get(0);
         externalSink.start();
@@ -154,7 +155,7 @@ public class EndToEndFeatureTest {
      * Tear down after class.
      *
      */
-    @AfterClass
+    @AfterAll
     public static void tearDownAfterClass() {
         externalSink.stop();
         internalSink.stop();
@@ -163,7 +164,7 @@ public class EndToEndFeatureTest {
     /**
      * Setup.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         ctx = null;
     }
@@ -171,7 +172,7 @@ public class EndToEndFeatureTest {
     /**
      * Tear down.
      */
-    @After
+    @AfterEach
     public void tearDown() {
         if (ctx != null) {
             ctx.destroy();
@@ -179,30 +180,30 @@ public class EndToEndFeatureTest {
     }
 
     /*
-     * This test should only be run manually, after configuring all of the fields,
+     * This test should only be run manually, after configuring all the fields,
      * thus it is ignored.
      */
-    @Ignore
+    @Disabled
     @Test
     public void test_SingleHost() throws Exception {    // NOSONAR
         run(70, 1);
     }
 
     /*
-     * This test should only be run manually, after configuring all of the fields,
+     * This test should only be run manually, after configuring all the fields,
      * thus it is ignored.
      */
-    @Ignore
+    @Disabled
     @Test
     public void test_TwoHosts() throws Exception {      // NOSONAR
         run(200, 2);
     }
 
     /*
-     * This test should only be run manually, after configuring all of the fields,
+     * This test should only be run manually, after configuring all the fields,
      * thus it is ignored.
      */
-    @Ignore
+    @Disabled
     @Test
     public void test_ThreeHosts() throws Exception {    // NOSONAR
         run(200, 3);
@@ -363,7 +364,7 @@ public class EndToEndFeatureTest {
         public void checkAllSawAMsg() {
             int msgs = 0;
             for (Host host : hosts) {
-                assertTrue("msgs=" + msgs, host.messageSeen());
+                assertTrue(host.messageSeen(), "msgs=" + msgs);
                 ++msgs;
             }
         }
@@ -758,8 +759,8 @@ public class EndToEndFeatureTest {
         }
 
         @Override
-        protected DmaapManager makeDmaapManager(String topic) throws PoolingFeatureException {
-            return new DmaapManagerImpl(topic);
+        protected TopicMessageManager makeTopicMessagesManager(String topic) throws PoolingFeatureException {
+            return new TopicMessageManagerImpl(topic);
         }
 
         @Override
@@ -776,7 +777,7 @@ public class EndToEndFeatureTest {
     /**
      * DMaaP Manager with overrides.
      */
-    private static class DmaapManagerImpl extends DmaapManager {
+    private static class TopicMessageManagerImpl extends TopicMessageManager {
 
         /**
          * Constructor.
@@ -784,7 +785,7 @@ public class EndToEndFeatureTest {
          * @param topic the topic
          * @throws PoolingFeatureException if an error occurs
          */
-        public DmaapManagerImpl(String topic) throws PoolingFeatureException {
+        public TopicMessageManagerImpl(String topic) throws PoolingFeatureException {
             super(topic);
         }