aboutsummaryrefslogtreecommitdiffstats
path: root/datarouter-prov/src/test/java
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/java
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/java')
-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
2 files changed, 58 insertions, 2 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