summaryrefslogtreecommitdiffstats
path: root/datarouter-prov/src/test
diff options
context:
space:
mode:
authorefiacor <fiachra.corcoran@est.tech>2019-10-23 15:31:43 +0100
committerefiacor <fiachra.corcoran@est.tech>2019-10-29 10:45:36 +0000
commitadb2ad2d16e851fbf8dcc71af68949a74463204d (patch)
treed5d2e4a7411d011843b34cdb1c21a92d482c5f23 /datarouter-prov/src/test
parent68a9ca240970fceaf12bbe91b7bad8e1d98ecd93 (diff)
More bug fix and refactoring
Signed-off-by: efiacor <fiachra.corcoran@est.tech> Change-Id: I4fce4e73faa86573d0c716882bb014b9f83026ee Issue-ID: DMAAP-1284
Diffstat (limited to 'datarouter-prov/src/test')
-rw-r--r--datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/ProvServerTest.java57
-rw-r--r--datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/utils/AafPropsUtilsTest.java3
-rw-r--r--datarouter-prov/src/test/resources/aaf/org.onap.dmaap-dr.p12bin0 -> 4233 bytes
-rw-r--r--datarouter-prov/src/test/resources/aaf/org.onap.dmaap-dr.trust.jksbin0 -> 1413 bytes
-rwxr-xr-xdatarouter-prov/src/test/resources/h2Database.properties1
-rw-r--r--datarouter-prov/src/test/resources/prov_data.json2
6 files changed, 60 insertions, 3 deletions
diff --git a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/ProvServerTest.java b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/ProvServerTest.java
new file mode 100644
index 00000000..78d2eaa7
--- /dev/null
+++ b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/ProvServerTest.java
@@ -0,0 +1,57 @@
+/*-
+ * ============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.provisioning;
+
+import java.io.File;
+import java.io.IOException;
+import org.apache.commons.lang3.reflect.FieldUtils;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.onap.dmaap.datarouter.provisioning.utils.AafPropsUtils;
+
+public class ProvServerTest {
+
+ private AafPropsUtils aafPropsUtils;
+
+ @Before
+ public void setUp() {
+ try {
+ aafPropsUtils = new AafPropsUtils(new File("src/test/resources/aaf/org.onap.dmaap-dr.props"));
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @BeforeClass
+ public static void init() {
+ System.setProperty(
+ "org.onap.dmaap.datarouter.provserver.properties",
+ "src/test/resources/h2Database.properties");
+ }
+
+ @Test
+ public void Verify_Prov_Server_Is_Configured_Correctly() throws IllegalAccessException {
+ FieldUtils.writeDeclaredStaticField(ProvRunner.class, "aafPropsUtils", aafPropsUtils, true);
+ Assert.assertNotNull(ProvServer.getServerInstance());
+ }
+}
diff --git a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/utils/AafPropsUtilsTest.java b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/utils/AafPropsUtilsTest.java
index 09d4a819..64c5e492 100644
--- a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/utils/AafPropsUtilsTest.java
+++ b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/utils/AafPropsUtilsTest.java
@@ -32,8 +32,7 @@ public class AafPropsUtilsTest {
@BeforeClass
public static void init() throws Exception {
- AafPropsUtils.init(new File("src/test/resources/aaf/org.onap.dmaap-dr.props"));
- aafPropsUtils = AafPropsUtils.getInstance();
+ aafPropsUtils = new AafPropsUtils(new File("src/test/resources/aaf/org.onap.dmaap-dr.props"));
}
@Test
diff --git a/datarouter-prov/src/test/resources/aaf/org.onap.dmaap-dr.p12 b/datarouter-prov/src/test/resources/aaf/org.onap.dmaap-dr.p12
new file mode 100644
index 00000000..bd60d26e
--- /dev/null
+++ b/datarouter-prov/src/test/resources/aaf/org.onap.dmaap-dr.p12
Binary files differ
diff --git a/datarouter-prov/src/test/resources/aaf/org.onap.dmaap-dr.trust.jks b/datarouter-prov/src/test/resources/aaf/org.onap.dmaap-dr.trust.jks
new file mode 100644
index 00000000..0c9da2e5
--- /dev/null
+++ b/datarouter-prov/src/test/resources/aaf/org.onap.dmaap-dr.trust.jks
Binary files differ
diff --git a/datarouter-prov/src/test/resources/h2Database.properties b/datarouter-prov/src/test/resources/h2Database.properties
index a9c831a3..61d76fac 100755
--- a/datarouter-prov/src/test/resources/h2Database.properties
+++ b/datarouter-prov/src/test/resources/h2Database.properties
@@ -25,6 +25,7 @@
org.onap.dmaap.datarouter.db.driver = org.h2.Driver
org.onap.dmaap.datarouter.db.url = jdbc:h2:mem:test;DB_CLOSE_DELAY=-1
org.onap.dmaap.datarouter.provserver.isaddressauthenabled = true
+org.onap.dmaap.datarouter.provserver.cadi.enabled = true
org.onap.dmaap.datarouter.provserver.https.relaxation = false
org.onap.dmaap.datarouter.provserver.accesslog.dir = unit-test-logs
org.onap.dmaap.datarouter.provserver.spooldir = src/test/resources
diff --git a/datarouter-prov/src/test/resources/prov_data.json b/datarouter-prov/src/test/resources/prov_data.json
index 32536316..cf455c71 100644
--- a/datarouter-prov/src/test/resources/prov_data.json
+++ b/datarouter-prov/src/test/resources/prov_data.json
@@ -71,7 +71,7 @@
],
"parameters": {
"ACTIVE_POD": "dmaap-dr-prov",
- "DELIVERY_FILE_PROCESS_INTERVAL": 10,
+ "DELIVERY_FILE_PROCESS_INTERVAL": 600,
"DELIVERY_INIT_RETRY_INTERVAL": 10,
"DELIVERY_MAX_AGE": 86400,
"DELIVERY_MAX_RETRY_INTERVAL": 3600,