diff options
author | Fiachra Corcoran <fiachra.corcoran@est.tech> | 2019-10-31 13:56:14 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-10-31 13:56:14 +0000 |
commit | 4c5b91b5ce0901bf3044709fb2a172c2ae7763fc (patch) | |
tree | 9b5e5b0ea05d0d724d81885d9a0775e4afbd4632 /datarouter-prov/src/test/java | |
parent | b9110d4a3c2fe2652dd2d1ef24e3d09bcaffea56 (diff) | |
parent | adb2ad2d16e851fbf8dcc71af68949a74463204d (diff) |
Merge "More bug fix and refactoring"
Diffstat (limited to 'datarouter-prov/src/test/java')
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 |