From 4f11cf07048250febd6a7c6129c39e1c320919b9 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Fri, 19 Mar 2021 11:38:39 -0400 Subject: 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 --- .../org/onap/policy/api/main/rest/TestApiRestServer.java | 12 ++++++------ main/src/test/resources/ssl/policy-keystore | Bin 4431 -> 0 bytes .../src/main/resources/etc/ssl/policy-keystore | Bin 4431 -> 0 bytes 3 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 main/src/test/resources/ssl/policy-keystore delete mode 100644 packages/policy-api-tarball/src/main/resources/etc/ssl/policy-keystore 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 Binary files a/main/src/test/resources/ssl/policy-keystore and /dev/null differ diff --git a/packages/policy-api-tarball/src/main/resources/etc/ssl/policy-keystore b/packages/policy-api-tarball/src/main/resources/etc/ssl/policy-keystore deleted file mode 100644 index b95e0103..00000000 Binary files a/packages/policy-api-tarball/src/main/resources/etc/ssl/policy-keystore and /dev/null differ -- cgit 1.2.3-korg