summaryrefslogtreecommitdiffstats
path: root/datarouter-node/src/test
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
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')
-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
-rw-r--r--datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.cred.props17
-rw-r--r--datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.keyfile27
-rw-r--r--datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.location.props8
-rw-r--r--datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.p12bin4217 -> 0 bytes
-rw-r--r--datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.props24
-rw-r--r--datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.trust.jksbin1413 -> 0 bytes
-rw-r--r--datarouter-node/src/test/resources/certs/org.onap.dmaap-dr-node.p12bin0 -> 4596 bytes
-rw-r--r--datarouter-node/src/test/resources/certs/truststore.jksbin0 -> 3234 bytes
-rw-r--r--datarouter-node/src/test/resources/node_test.properties43
-rw-r--r--datarouter-node/src/test/resources/org.onap.dmaap-dr-test-cert.jksbin3647 -> 0 bytes
-rw-r--r--datarouter-node/src/test/resources/prov_data.json2
25 files changed, 107 insertions, 192 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;
diff --git a/datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.cred.props b/datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.cred.props
deleted file mode 100644
index 452a0112..00000000
--- a/datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.cred.props
+++ /dev/null
@@ -1,17 +0,0 @@
-############################################################
-# Properties Generated by AT&T Certificate Manager
-# by root
-# on 2022-03-22T12:31:16.865+0000
-# @copyright 2019, AT&T
-############################################################
-Challenge=enc:2dZO7B2UVelU01IezilQ9hUYptjIvurC6JWO9vJHOiiqg9qUna3AdEMxzBpXcgIO
-cadi_alias=dmaap-dr-node@dmaap-dr.onap.org
-cadi_key_password=enc:ow380FBQU5xvQEDzTiXdfx-BD_0dEWbRCXjnUPxVFatk_7KaejgiLCVew6C6x8_9
-cadi_keyfile=src/test/resources/aaf/org.onap.dmaap-dr.keyfile
-cadi_keystore=src/test/resources/aaf/org.onap.dmaap-dr.p12
-cadi_keystore_password=enc:Urky1AuqpokGwoSl72ypmhVONokY0H1Gy28S9P8jfvK1-d7W8SODXf87K37EubDo
-cadi_keystore_password_jks=enc:lwXWmxaVAHy207uNeiHPYLho3qezj4xu7_iH4myTitXuj_bo9esv0e1L19HluXlM
-cadi_keystore_password_p12=enc:Urky1AuqpokGwoSl72ypmhVONokY0H1Gy28S9P8jfvK1-d7W8SODXf87K37EubDo
-cadi_truststore=src/test/resources/aaf/org.onap.dmaap-dr.trust.jks
-cadi_truststore_password=enc:stAsWWKk5FOcWxyWsNqyQlSdkwWSxcy3Jed6RW_r4jyZosqV8kmSCJLSHNLyWyTH
-cadi_x509_issuers=CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_7, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_9, OU=OSAAF, O=ONAP, C=US
diff --git a/datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.keyfile b/datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.keyfile
deleted file mode 100644
index 987cae1f..00000000
--- a/datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.keyfile
+++ /dev/null
@@ -1,27 +0,0 @@
-uXr3OodaCvEvTDHfkpgh-_5UdpEkBowSRpKF18WNxMG0A9Y9k2REr-d075mNHshr5gOUYAlykgaX
-ImvY-oFtG71N-Q0uqYnYuU7eX7zgcOOFNpeT4q2db3wkiScaZgdv2UnfDOVX2Aq53GzyYeKcGB1W
-u0jKX8ryHVC0uvj69y1boiJBxQY1HwAqsh9q39Ut1XxyB42D7xDM7sa9G1I6YosQlthXPMt7Q_i0
-0CUHrozT6Wtnxfb8-qR6rM5PNmAxp8r5Jb4cnSbxJGEWpx1DkZPPZNvLjE9bBfinVftzrpIlqHd3
-2CCp3k6xrqui2c_0HaNILtKHX5VVKttRf9zoADk_l5_MowEJgh1fgu8m0r-iEB6oH18AWZ_PCtSr
-A0cqEDGbP-h7e8w-Dwb0yS_oSfeDISarZ1Q46CQFcDz7f4bVB3AW67YGM4SQBaFGivWS_Lz_juOx
-fhyo55HW_wL_92xRvAyXD1Eg64Lw0Cx0f9rn4uM7NkKaSCP8MmIvs84egCvDzCiWkT6SGzUTeZ7M
-qI0ow2tJPFUuvhozcYxJW9sFzTqTFL7iLtrO5nHmo7YUVf2WU8ByGOfC-ylZPjw0fiKpe-7MXVSz
-MIOxl3pgWSYt6kImBtZCateif6TgF_A-91yAOoQLm72baJKhOo-F-aJ4k6ToT4bZ-9-Hjs5Wk9sO
-4thYzDcMaGrWsssnR9QMBjl9x3uw5bfOYGduyyRCWC_TYNorrW6Bvh7gFZAWk_f6cK-pPahRo_3O
-erNlUHx6xaektjqUsmp91LzjCEWbmt5nDGw16VUSPhrtkca2ReWDL0vTnpjvPuRI7mWHdfyoVYMw
-KUDkRgn61QvELC0Rl0C12polUEjqSxCRvGzL8QiOrU_Z1hXhVyp2gVIYvDKyuyguvJlniEBQ2qbM
-3Y5savSaANj-b2-_J0ofhvYFGz1k_bjcCE6Wx2RSWk1nSJFJ0gFjp1Ky2cyKhhVMXCiWcbbA3vC8
-E1cE9Ixn4z5WYyHOAFyzrsiiapdn5MhB_kI-ObR2HuRy_GRJHMVpxqX15Bv3OXxWy51bXeYeRfit
-SVCoyfXMXbx12eVG4tvf3WyYg9RqK_QN57VAmnffq09MAXuzFB1NuxSeJeBHGtBW6XIvb6E32K6I
-rL7vfxGHhD7ZHqQzzie5I42HufANtBb1KNKHikeeACxxlpjOIHjjEZ6yffhoyhNbSHx4TNs7UYOf
-FUKs0TCO9ffSJ8JT67X-baqlnSYFkdqR6QTGhltZq1ssPYq6Y6NGN1iEHJMfapev07AQgp6mBBxJ
-dEwDZMAwlmb1yVkU1gfzcrGdAUeAAuM6LowPHUKYLJJvvaFLQJKbwwLvjnm_Tf9UR5QJ8a3JKiLt
-F0Ykc1AeO-fyiNPUVRnkc3--Gs0bLUpLe0_medGOZ_LLk45GarEzBCGajgF_joz8fsndKtDrEnB0
-z-8iiQ4bTZb_ALjKnnhcdKjoJNhZ-e3AsmadYO7ve2K3ApwOelWWh24iZ-ZSUbnlw-OQMu4RvI9h
-9KOTbu4gWokep3O2uT8-cVN-ax1FYRpmexHgIxZy-tmYjDdJTJQv3dMp5UngUs6xmIy5nyIBr51B
-YORSQmXRvbdvYeY7jOEQUGfXfS2yYtzLfJ07f8ODQJ24APDKsVEGWVBcBMqp53o9W7cPJ-4vnMLU
-mVYCKqVrT2bThRWb38OtaaJuA4A8GboDDe5Q0IZao0v3gqwgfCzJIjQx97AEHzEbLzEBxio_z8a0
-AYLi-_f7kMtgrMsj61gcRVUan5NVqnL7oVwFn8FuqeTRzMMbgJHUHfFzrgLxpRwnscGRzygZf39Q
-JqqOLGriWe_IOhXQ7aIp3uyBF-brJnrXcQIp3PF0fbVTGK_VyKDB6J0BjJyjmyL0TA37hDr8usna
-TgMtjF1qq9kOrJr2582n8TW-ogpyqm1ft7R18VT9_1JjtnCcTCudW-oJX87jv3UTJdaEkBMhc1Pe
-euLti-qSG3Q5QeO5AxM8mP_9YbLHB9YQboRWnbfC9oIFRmVgGAcdbHNFn0hfILBOTIYStQL4 \ No newline at end of file
diff --git a/datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.location.props b/datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.location.props
deleted file mode 100644
index c30adee4..00000000
--- a/datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.location.props
+++ /dev/null
@@ -1,8 +0,0 @@
-############################################################
-# Properties Generated by AT&T Certificate Manager
-# by root
-# on 2022-03-22T12:31:14.170+0000
-# @copyright 2019, AT&T
-############################################################
-cadi_latitude=0.0
-cadi_longitude=0.0
diff --git a/datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.p12 b/datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.p12
deleted file mode 100644
index 4238c868..00000000
--- a/datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.p12
+++ /dev/null
Binary files differ
diff --git a/datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.props b/datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.props
deleted file mode 100644
index c408b9ca..00000000
--- a/datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.props
+++ /dev/null
@@ -1,24 +0,0 @@
-############################################################
-# Properties Generated by AT&T Certificate Manager
-# by root
-# on 2022-03-22T12:31:14.169+0000
-# @copyright 2019, AT&T
-############################################################
-aaf_env=DEV
-aaf_id=dmaap-dr-node@dmaap-dr.onap.org
-aaf_locate_url=https://aaf-locate.onap:8095
-aaf_locator_app_ns=org.osaaf.aaf
-aaf_locator_container=oom
-aaf_locator_container_ns=onap
-aaf_locator_fqdn=dmaap-dr-node
-aaf_locator_public_fqdn=dmaap-dr.onap.org
-aaf_oauth2_introspect_url=https://AAF_LOCATE_URL/%CNS.%AAF_NS.introspect:2.1/introspect
-aaf_oauth2_token_url=https://AAF_LOCATE_URL/%CNS.%AAF_NS.token:2.1/token
-aaf_url=https://AAF_LOCATE_URL/%CNS.%AAF_NS.service:2.1
-aaf_url_cm=https://AAF_LOCATE_URL/%CNS.%AAF_NS.cm:2.1
-aaf_url_fs=https://AAF_LOCATE_URL/%CNS.%AAF_NS.fs:2.1
-aaf_url_gui=https://AAF_LOCATE_URL/%CNS.%AAF_NS.gui:2.1
-aaf_url_hello=https://aaf-locate.onap:8095/locate/onap.org.osaaf.aaf.hello:2.1
-aaf_url_oauth=https://AAF_LOCATE_URL/%CNS.%AAF_NS.oauth:2.1
-cadi_prop_files=src/test/resources/aaf/org.onap.dmaap-dr.location.props:src/test/resources/aaf/org.onap.dmaap-dr.cred.props
-cadi_protocols=TLSv1.1,TLSv1.2
diff --git a/datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.trust.jks b/datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.trust.jks
deleted file mode 100644
index e09e2e61..00000000
--- a/datarouter-node/src/test/resources/aaf/org.onap.dmaap-dr.trust.jks
+++ /dev/null
Binary files differ
diff --git a/datarouter-node/src/test/resources/certs/org.onap.dmaap-dr-node.p12 b/datarouter-node/src/test/resources/certs/org.onap.dmaap-dr-node.p12
new file mode 100644
index 00000000..3793a9d4
--- /dev/null
+++ b/datarouter-node/src/test/resources/certs/org.onap.dmaap-dr-node.p12
Binary files differ
diff --git a/datarouter-node/src/test/resources/certs/truststore.jks b/datarouter-node/src/test/resources/certs/truststore.jks
new file mode 100644
index 00000000..91547c60
--- /dev/null
+++ b/datarouter-node/src/test/resources/certs/truststore.jks
Binary files differ
diff --git a/datarouter-node/src/test/resources/node_test.properties b/datarouter-node/src/test/resources/node_test.properties
index 407d37c6..7560bd78 100644
--- a/datarouter-node/src/test/resources/node_test.properties
+++ b/datarouter-node/src/test/resources/node_test.properties
@@ -56,36 +56,35 @@ SpoolDir = src/test/resources/spool
# The path to the redirection data file
RedirectionFile = src/test/redirections.dat
#
+# https security required for publish request
+TlsEnabled = false
+#
+# Enabled TLS protocols
+NodeHttpsProtocols = TLSv1.1|TLSv1.2
+#
# The type of keystore for https
KeyStoreType = PKCS12
#
+# The path to your KeyStoreFile
+KeyStorePath = src/test/resources/certs/org.onap.dmaap-dr-node.p12
+#
+# The key store password
+KeyStorePass = secret
+#
+# The key manager password
+KeyManagerPass = secret
+#
# The type of truststore for https
TrustStoreType = jks
#
+# The path to your trust store
+TrustStorePath = src/test/certs/truststore.jks
+#
+# The trust store password
+TrustStorePass = secret
+#
# The path to the file used to trigger an orderly shutdown
QuiesceFile = etc/SHUTDOWN
#
# The key used to generate passwords for node to node transfers
NodeAuthKey = Node123!
-#
-# DR_NODE DEFAULT ENABLED TLS PROTOCOLS
-NodeHttpsProtocols = TLSv1.1|TLSv1.2
-#
-# AAF CADI enabled flag
-CadiEnabled = true
-#
-# AAF type to generate permission string
-AAFType = org.onap.dmaap-dr.feed
-#
-# AAF default instance to generate permission string - default should be legacy
-AAFInstance = legacy
-#
-# AAF action to generate permission string - default should be publish
-AAFAction = publish
-#
-# AAF Props file path
-AAFPropsFilePath = src/test/resources/aaf/org.onap.dmaap-dr.props
-
-# https security required for publish request
-TlsEnabled = true
-
diff --git a/datarouter-node/src/test/resources/org.onap.dmaap-dr-test-cert.jks b/datarouter-node/src/test/resources/org.onap.dmaap-dr-test-cert.jks
deleted file mode 100644
index 2320dc9f..00000000
--- a/datarouter-node/src/test/resources/org.onap.dmaap-dr-test-cert.jks
+++ /dev/null
Binary files differ
diff --git a/datarouter-node/src/test/resources/prov_data.json b/datarouter-node/src/test/resources/prov_data.json
index cf455c71..8b9985c3 100644
--- a/datarouter-node/src/test/resources/prov_data.json
+++ b/datarouter-node/src/test/resources/prov_data.json
@@ -22,7 +22,6 @@
"feedid": 1,
"name": "Default PM Feed",
"business_description": "Default Feed",
- "aaf_instance": "legacy",
"publisher": "dradmin",
"links": {
"subscribe": "https://dmaap-dr-prov/subscribe/1",
@@ -60,7 +59,6 @@
"feedid": 1,
"follow_redirect": false,
"decompress": true,
- "aaf_instance": "legacy",
"links": {
"feed": "https://dmaap-dr-prov/feed/1",
"log": "https://dmaap-dr-prov/sublog/1",