aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-03-19 11:38:39 -0400
committerJim Hahn <jrh3@att.com>2021-03-19 11:42:00 -0400
commit4f11cf07048250febd6a7c6129c39e1c320919b9 (patch)
tree89dd80c62ea8ab006f6d1c8f7dff8a828c42d7ed /main
parent04dfb5533d798978aaaf8cee2a1b6d9f02a66223 (diff)
Delete keystores from policy-api
The Keystore is no longer needed in the tarball, as it is supplied externally by the CSITs and Helm charts. Deleted that file. Also modified the junits to use utils-test to generates keystores at runtime, thus deleted the junit keystore file, too. Issue-ID: POLICY-3143 Change-Id: Ib3e2001f2dc41a528d1be2e81091a278cc31dff8 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'main')
-rw-r--r--main/src/test/java/org/onap/policy/api/main/rest/TestApiRestServer.java12
-rw-r--r--main/src/test/resources/ssl/policy-keystorebin4431 -> 0 bytes
2 files changed, 6 insertions, 6 deletions
diff --git a/main/src/test/java/org/onap/policy/api/main/rest/TestApiRestServer.java b/main/src/test/java/org/onap/policy/api/main/rest/TestApiRestServer.java
index c706d2c5..aac37f19 100644
--- a/main/src/test/java/org/onap/policy/api/main/rest/TestApiRestServer.java
+++ b/main/src/test/java/org/onap/policy/api/main/rest/TestApiRestServer.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Samsung Electronics Co., Ltd. All rights reserved.
- * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2019-2020 Nordix Foundation.
* Modifications Copyright (C) 2020 Bell Canada.
* ================================================================================
@@ -67,6 +67,7 @@ import org.onap.policy.common.utils.coder.StandardYamlCoder;
import org.onap.policy.common.utils.network.NetworkUtil;
import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.common.utils.resources.TextFileUtils;
+import org.onap.policy.common.utils.security.SelfSignedKeyStore;
import org.onap.policy.models.base.PfModelException;
import org.onap.policy.models.errors.concepts.ErrorResponse;
import org.onap.policy.models.provider.PolicyModelsProviderParameters;
@@ -121,8 +122,6 @@ public class TestApiRestServer {
private static final String POLICIES = "policies";
- private static final String KEYSTORE = System.getProperty("user.dir") + "/src/test/resources/ssl/policy-keystore";
-
// @formatter:off
private static final String[] TOSCA_POLICY_RESOURCE_NAMES = {"policies/vCPE.policy.monitoring.input.tosca.json",
"policies/vCPE.policy.monitoring.input.tosca.yaml", "policies/vDNS.policy.monitoring.input.tosca.json",
@@ -180,9 +179,10 @@ public class TestApiRestServer {
*
* @throws PfModelException the PfModel parsing exception
* @throws IOException on I/O exceptions
+ * @throws InterruptedException if interrupted
*/
@BeforeClass
- public static void setupParameters() throws PfModelException, IOException {
+ public static void setupParameters() throws PfModelException, IOException, InterruptedException {
providerParams = new PolicyModelsProviderParameters();
// H2, use "org.mariadb.jdbc.Driver" and "jdbc:mariadb://localhost:3306/policy" for locally installed MariaDB
providerParams.setDatabaseDriver("org.h2.Driver");
@@ -201,8 +201,8 @@ public class TestApiRestServer {
final String[] apiConfigParameters = new String[2];
final Properties systemProps = System.getProperties();
- systemProps.put("javax.net.ssl.keyStore", KEYSTORE);
- systemProps.put("javax.net.ssl.keyStorePassword", "Pol1cy_0nap");
+ systemProps.put("javax.net.ssl.keyStore", new SelfSignedKeyStore().getKeystoreName());
+ systemProps.put("javax.net.ssl.keyStorePassword", SelfSignedKeyStore.KEYSTORE_PASSWORD);
System.setProperties(systemProps);
new CommonTestData().makeParameters("src/test/resources/parameters/ApiConfigParameters_Https.json",
"src/test/resources/parameters/ApiConfigParameters_HttpsXXX.json", apiPort);
diff --git a/main/src/test/resources/ssl/policy-keystore b/main/src/test/resources/ssl/policy-keystore
deleted file mode 100644
index b95e0103..00000000
--- a/main/src/test/resources/ssl/policy-keystore
+++ /dev/null
Binary files differ