aboutsummaryrefslogtreecommitdiffstats
path: root/datarouter-prov/src/test
diff options
context:
space:
mode:
authorFiachra Corcoran <fiachra.corcoran@est.tech>2019-10-31 13:56:14 +0000
committerGerrit Code Review <gerrit@onap.org>2019-10-31 13:56:14 +0000
commit4c5b91b5ce0901bf3044709fb2a172c2ae7763fc (patch)
tree9b5e5b0ea05d0d724d81885d9a0775e4afbd4632 /datarouter-prov/src/test
parentb9110d4a3c2fe2652dd2d1ef24e3d09bcaffea56 (diff)
parentadb2ad2d16e851fbf8dcc71af68949a74463204d (diff)
Merge "More bug fix and refactoring"
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,