aboutsummaryrefslogtreecommitdiffstats
path: root/datarouter-node/src/test/java/org
diff options
context:
space:
mode:
authorefiacor <fiachra.corcoran@est.tech>2022-12-16 12:12:30 +0000
committerefiacor <fiachra.corcoran@est.tech>2022-12-19 23:53:47 +0000
commit63b13a0cddf45b4cfd1691dd5b95a205af355898 (patch)
tree99bc32917f9c8f0aa826fc85bd29c23280a9eb95 /datarouter-node/src/test/java/org
parentbda6aeaa60607ab4fe5af508156019d7bd5c0ce4 (diff)
[DMAAP-DR] Remove cadi/aaf from dr-node
Signed-off-by: efiacor <fiachra.corcoran@est.tech> Change-Id: Iba1b7d8c087a4f68c3a8a517145abf70848ee030 Issue-ID: DMAAP-1642
Diffstat (limited to 'datarouter-node/src/test/java/org')
-rw-r--r--datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryQueueTest.java3
-rw-r--r--datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryTaskTest.java2
-rw-r--r--datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryTest.java5
-rw-r--r--datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/LogManagerTest.java4
-rw-r--r--datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeAafPropsUtilsTest.java41
-rw-r--r--datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeConfigManagerTest.java13
-rw-r--r--datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeConfigTest.java5
-rw-r--r--datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeServerTest.java20
-rw-r--r--datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeServletTest.java15
-rw-r--r--datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeTlsManagerTest.java51
-rw-r--r--datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeUtilsTest.java15
-rw-r--r--datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/PathFinderTest.java2
-rw-r--r--datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/ProvDataTest.java1
-rw-r--r--datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/StatusLogTest.java1
14 files changed, 86 insertions, 92 deletions
diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryQueueTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryQueueTest.java
index d1194279..ea221cbd 100644
--- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryQueueTest.java
+++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryQueueTest.java
@@ -44,6 +44,9 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
+import org.onap.dmaap.datarouter.node.delivery.DeliveryQueue;
+import org.onap.dmaap.datarouter.node.delivery.DeliveryQueueHelper;
+import org.onap.dmaap.datarouter.node.delivery.DeliveryTask;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor;
diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryTaskTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryTaskTest.java
index 0f019161..b749afec 100644
--- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryTaskTest.java
+++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryTaskTest.java
@@ -33,6 +33,8 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
+import org.onap.dmaap.datarouter.node.delivery.DeliveryQueue;
+import org.onap.dmaap.datarouter.node.delivery.DeliveryTask;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryTest.java
index 25830cdd..61c53180 100644
--- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryTest.java
+++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryTest.java
@@ -29,7 +29,6 @@ import static org.mockito.Mockito.verify;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
-import java.util.Hashtable;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.junit.After;
import org.junit.Assert;
@@ -37,7 +36,9 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
-import org.onap.dmaap.datarouter.node.Delivery.DelItem;
+import org.onap.dmaap.datarouter.node.delivery.Delivery;
+import org.onap.dmaap.datarouter.node.delivery.Delivery.DelItem;
+import org.onap.dmaap.datarouter.node.delivery.DeliveryQueue;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor;
diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/LogManagerTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/LogManagerTest.java
index cb3c88a4..1875a220 100644
--- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/LogManagerTest.java
+++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/LogManagerTest.java
@@ -30,13 +30,13 @@ import java.io.IOException;
import java.util.Timer;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.reflect.FieldUtils;
-import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
-import org.onap.dmaap.datarouter.node.LogManager.Uploader;
+import org.onap.dmaap.datarouter.node.log.LogManager;
+import org.onap.dmaap.datarouter.node.log.LogManager.Uploader;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor;
diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeAafPropsUtilsTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeAafPropsUtilsTest.java
deleted file mode 100644
index fbb93324..00000000
--- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeAafPropsUtilsTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 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.dmaap.datarouter.node;
-
-import java.io.File;
-import java.io.IOException;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-public class NodeAafPropsUtilsTest {
-
- private NodeAafPropsUtils nodeAafPropsUtils;
-
- @Before
- public void setUp() throws IOException {
- nodeAafPropsUtils = new NodeAafPropsUtils(new File("src/test/resources/aaf/org.onap.dmaap-dr.props"));
- }
-
- @Test
- public void Veirfy_Aaf_Pass_Decryp_Successful() {
- Assert.assertEquals("w7(O#.QV#kQ;L(8fsaoT7cY&", nodeAafPropsUtils.getDecryptedPass("cadi_keystore_password"));
- }
-}
diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeConfigManagerTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeConfigManagerTest.java
index 046a56e2..10732dfa 100644
--- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeConfigManagerTest.java
+++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeConfigManagerTest.java
@@ -45,6 +45,7 @@ import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.mockito.Mock;
+import org.onap.dmaap.datarouter.node.config.NodeConfig;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor;
@@ -95,10 +96,8 @@ public class NodeConfigManagerTest {
@Test
public void Verify_NodeConfigMan_Getters_Secure() {
NodeConfigManager nodeConfigManager = NodeConfigManager.getInstance();
- Assert.assertEquals("legacy", nodeConfigManager.getAafInstance());
Assert.assertEquals("src/test/resources/spool/f", nodeConfigManager.getSpoolDir());
Assert.assertEquals("src/test/resources/spool", nodeConfigManager.getSpoolBase());
- Assert.assertEquals("PKCS12", nodeConfigManager.getKSType());
Assert.assertEquals(8080, nodeConfigManager.getHttpPort());
Assert.assertEquals(8443, nodeConfigManager.getHttpsPort());
Assert.assertEquals(443, nodeConfigManager.getExtHttpsPort());
@@ -108,12 +107,8 @@ public class NodeConfigManagerTest {
Assert.assertEquals(".log", nodeConfigManager.getEventLogSuffix());
Assert.assertEquals("src/test/resources/logs", nodeConfigManager.getLogDir());
Assert.assertEquals((86400000L * 30), nodeConfigManager.getLogRetention());
- Assert.assertEquals(new String[] {"TLSv1.1", "TLSv1.2"}, nodeConfigManager.getEnabledprotocols());
- Assert.assertEquals("org.onap.dmaap-dr.feed", nodeConfigManager.getAafType());
- Assert.assertEquals("publish", nodeConfigManager.getAafAction());
- Assert.assertTrue(nodeConfigManager.getCadiEnabled());
Assert.assertFalse(nodeConfigManager.isShutdown());
- Assert.assertTrue(nodeConfigManager.isTlsEnabled());
+ Assert.assertFalse(nodeConfigManager.isTlsEnabled());
Assert.assertTrue(nodeConfigManager.isConfigured());
Assert.assertNotNull(nodeConfigManager.getPublishId());
Assert.assertNotNull(nodeConfigManager.getAllDests());
@@ -126,9 +121,6 @@ public class NodeConfigManagerTest {
Assert.assertEquals(60000, nodeConfigManager.getFairTimeLimit());
Assert.assertNotNull(nodeConfigManager.getTargets("1"));
Assert.assertEquals("src/test/resources/spool/f", nodeConfigManager.getSpoolDir());
- Assert.assertEquals("src/test/resources/aaf/org.onap.dmaap-dr.p12", nodeConfigManager.getKSFile());
- Assert.assertEquals("jks", nodeConfigManager.getTstype());
- Assert.assertEquals("src/test/resources/aaf/org.onap.dmaap-dr.trust.jks", nodeConfigManager.getTsfile());
Assert.assertEquals(40, nodeConfigManager.getDeliveryThreads());
Assert.assertEquals("30", nodeConfigManager.getEventLogInterval());
Assert.assertFalse(nodeConfigManager.isFollowRedirects());
@@ -137,7 +129,6 @@ public class NodeConfigManagerTest {
Assert.assertEquals("Basic ZG1hYXAtZHItbm9kZTp2OStFanZpWVBXSURrazVxRlF5ZkoxSC9LdHBuYWo4K0NVTXlNL0lRRUp2UGdjOUxpU2s5ZnpKTjdFazl3SzZkaG11S1E4S3RtcC9kelpBU3BRUGZCdz09", nodeConfigManager.getMyAuth());
Assert.assertEquals(0.05, nodeConfigManager.getFreeDiskStart(), 0.0);
Assert.assertEquals(0.2, nodeConfigManager.getFreeDiskStop(), 0.0);
- Assert.assertEquals("org.onap.dmaap-dr.feed|legacy|publish", nodeConfigManager.getPermission("legacy"));
}
/**
diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeConfigTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeConfigTest.java
index 6804ebfe..1272f3c2 100644
--- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeConfigTest.java
+++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeConfigTest.java
@@ -31,12 +31,14 @@ import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.onap.dmaap.datarouter.node.config.NodeConfig;
+import org.onap.dmaap.datarouter.node.config.ProvData;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor;
import org.powermock.modules.junit4.PowerMockRunner;
@RunWith(PowerMockRunner.class)
-@SuppressStaticInitializationFor({"org.onap.dmaap.datarouter.node.ProvData"})
+@SuppressStaticInitializationFor({"org.onap.dmaap.datarouter.node.config.ProvData"})
@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*"})
public class NodeConfigTest {
@@ -79,7 +81,6 @@ public class NodeConfigTest {
endpointAddrs.put("172.0.0.1");
auth.put("endpoint_addrs", endpointAddrs);
feed.put("authorization", auth);
- feed.put("aaf_instance", "legacy");
feeds.put(feed);
provData.put("feeds", feeds);
}
diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeServerTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeServerTest.java
index af43e5d8..8d0b2a2d 100644
--- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeServerTest.java
+++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeServerTest.java
@@ -27,12 +27,15 @@ import static org.mockito.Mockito.when;
import java.io.File;
import java.io.IOException;
+import java.util.Properties;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.onap.dmaap.datarouter.node.delivery.Delivery;
+import org.onap.dmaap.datarouter.node.utils.NodeTlsManager;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor;
@@ -44,9 +47,11 @@ import org.powermock.modules.junit4.PowerMockRunner;
public class NodeServerTest {
private final NodeConfigManager config = mock(NodeConfigManager.class);
+ private NodeTlsManager nodeTlsManager;
@Before
public void setUp() throws Exception {
setUpConfig();
+ setUpNodeTlsMan();
setUpNodeMainDelivery();
createFilesAndDirectories();
}
@@ -61,7 +66,7 @@ public class NodeServerTest {
Assert.assertNotNull(NodeServer.getServerInstance(config));
}
- private void setUpConfig() throws IllegalAccessException {
+ private void setUpConfig() {
PowerMockito.mockStatic(NodeConfigManager.class);
when(config.isShutdown()).thenReturn(false);
when(config.isConfigured()).thenReturn(true);
@@ -74,15 +79,16 @@ public class NodeServerTest {
when(config.isDeletePermitted("1")).thenReturn(true);
when(config.getAllDests()).thenReturn(new DestInfo[0]);
when(config.isTlsEnabled()).thenReturn(true);
- when(config.getKSType()).thenReturn("PKCS12");
- when(config.getKSFile()).thenReturn("src/test/resources/aaf/org.onap.dmaap-dr.p12");
- when(config.getKSPass()).thenReturn("tVac2#@Stx%tIOE^x[c&2fgZ");
- when(config.getTstype()).thenReturn("jks");
- when(config.getTsfile()).thenReturn("src/test/resources/aaf/org.onap.dmaap-dr.trust.jks");
- when(config.getTspass()).thenReturn("XHX$2Vl?Lk*2CB.i1+ZFAhZd");
PowerMockito.when(NodeConfigManager.getInstance()).thenReturn(config);
}
+ private void setUpNodeTlsMan() throws IOException {
+ Properties nodeProps = new Properties();
+ nodeProps.load(NodeTlsManagerTest.class.getClassLoader().getResourceAsStream("node_test.properties"));
+ nodeTlsManager = new NodeTlsManager(nodeProps);
+ PowerMockito.when(NodeConfigManager.getNodeTlsManager()).thenReturn(nodeTlsManager);
+ }
+
private void setUpNodeMainDelivery() throws IllegalAccessException{
Delivery delivery = mock(Delivery.class);
doNothing().when(delivery).resetQueue(anyObject());
diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeServletTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeServletTest.java
index 0dcc0a19..b48db880 100644
--- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeServletTest.java
+++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeServletTest.java
@@ -24,7 +24,6 @@ package org.onap.dmaap.datarouter.node;
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyObject;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.anyString;
@@ -50,10 +49,8 @@ import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.BDDMockito;
import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.internal.matchers.Any;
+import org.onap.dmaap.datarouter.node.delivery.Delivery;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
@@ -238,16 +235,6 @@ public class NodeServletTest {
verify(response).sendError(eq(HttpServletResponse.SC_BAD_REQUEST), anyString());
}
- @Test
- public void Given_Request_Is_HTTP_PUT_On_Publish_On_AAF_Feed_And_Cadi_Enabled_And_No_Permissions_Then_Forbidden_Response_Is_Generated() throws Exception {
- when(config.getCadiEnabled()).thenReturn(true);
- when(config.getAafInstance("1")).thenReturn("*");
- when(request.getPathInfo()).thenReturn("/publish/1/fileName");
- setHeadersForValidRequest(true);
- nodeServlet.doPut(request, response);
- verify(response).sendError(eq(HttpServletResponse.SC_FORBIDDEN), anyString());
- verifyEnteringExitCalled(listAppender);
- }
@Test
public void Given_Request_Is_HTTP_DELETE_On_Publish_With_Meta_Data_Malformed_Then_Bad_Request_Response_Is_Generated() throws Exception {
diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeTlsManagerTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeTlsManagerTest.java
new file mode 100644
index 00000000..f259d926
--- /dev/null
+++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeTlsManagerTest.java
@@ -0,0 +1,51 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 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.dmaap.datarouter.node;
+
+import java.io.IOException;
+import java.util.Properties;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.dmaap.datarouter.node.utils.NodeTlsManager;
+import org.powermock.core.classloader.annotations.PowerMockIgnore;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+@RunWith(PowerMockRunner.class)
+@PowerMockIgnore({"java.net.ssl", "javax.security.auth.x500.X500Principal", "com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*", "javax.management.*"})
+public class NodeTlsManagerTest {
+
+ private static NodeTlsManager nodeTlsManager;
+
+ @BeforeClass
+ public static void setUpClass() throws IOException {
+ Properties nodeProps = new Properties();
+ nodeProps.load(NodeTlsManagerTest.class.getClassLoader().getResourceAsStream("node_test.properties"));
+ nodeTlsManager = new NodeTlsManager(nodeProps);
+ }
+
+ @Test
+ public void Given_Get_CanonicalName_Called_Valid_CN_Returned_From_JKS() {
+ String canonicalName = nodeTlsManager.getMyNameFromCertificate();
+ Assert.assertEquals("dmaap-dr-node", canonicalName);
+ }
+
+}
diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeUtilsTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeUtilsTest.java
index 40cb11fb..9469ce0f 100644
--- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeUtilsTest.java
+++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeUtilsTest.java
@@ -29,12 +29,13 @@ import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
+import org.onap.dmaap.datarouter.node.utils.NodeUtils;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.modules.junit4.PowerMockRunner;
import org.slf4j.MDC;
@RunWith(PowerMockRunner.class)
-@PowerMockIgnore({"java.net.ssl", "javax.security.auth.x500.X500Principal", "com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*", "javax.management.*"})
+@PowerMockIgnore({"java.net.ssl", "com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*", "javax.management.*"})
public class NodeUtilsTest {
@Mock
@@ -76,16 +77,4 @@ public class NodeUtilsTest {
Assert.assertEquals("123", MDC.get("RequestId"));
Assert.assertEquals("456", MDC.get("InvocationId"));
}
-
- @Test
- public void Given_Get_CanonicalName_Called_Valid_CN_Returned_From_JKS() {
- String canonicalName = NodeUtils.getCanonicalName("jks", "src/test/resources/org.onap.dmaap-dr-test-cert.jks", "WGxd2P6MDo*Bi4+UdzWs{?$8");
- Assert.assertEquals("dmaap-dr-node", canonicalName);
- }
-
- @Test
- public void Given_Get_CanonicalName_Called_Valid_CN_Returned_From_P12() {
- String canonicalName = NodeUtils.getCanonicalName("PKCS12", "src/test/resources/aaf/org.onap.dmaap-dr.p12", "w7(O#.QV#kQ;L(8fsaoT7cY&");
- Assert.assertEquals("dmaap-dr-node", canonicalName);
- }
}
diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/PathFinderTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/PathFinderTest.java
index 25edd0c0..2bf320b3 100644
--- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/PathFinderTest.java
+++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/PathFinderTest.java
@@ -26,6 +26,8 @@ import static org.junit.Assert.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.onap.dmaap.datarouter.node.config.NodeConfig;
+import org.onap.dmaap.datarouter.node.config.PathFinder;
import org.powermock.modules.junit4.PowerMockRunner;
@RunWith(PowerMockRunner.class)
diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/ProvDataTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/ProvDataTest.java
index 1a4564ab..1747fc12 100644
--- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/ProvDataTest.java
+++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/ProvDataTest.java
@@ -29,6 +29,7 @@ import java.io.Reader;
import java.nio.charset.StandardCharsets;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.onap.dmaap.datarouter.node.config.ProvData;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.modules.junit4.PowerMockRunner;
diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/StatusLogTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/StatusLogTest.java
index 28dcba9a..5cd46e88 100644
--- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/StatusLogTest.java
+++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/StatusLogTest.java
@@ -29,6 +29,7 @@ import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.onap.dmaap.datarouter.node.log.StatusLog;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;