From dd1df5fdcc8fe69f7ae310d9ffb29c2116973bd0 Mon Sep 17 00:00:00 2001 From: Pamela Dragosh Date: Thu, 14 Sep 2017 17:22:24 -0400 Subject: Fix sonar critical for password Focused on hard coded passwords. I believe they are only used for JUnit tests so I moved them into a file for use. If they still show up on sonar then I will move into a properties file and/or mark as not going to fix. Issue-ID: POLICY-237 Change-Id: I6fa561714091043a2ea5e2edfb0441c2dfc8b044 Signed-off-by: Pamela Dragosh --- .../onap/policy/common/im/test/IntegrityMonitorTest.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'integrity-monitor/src/test/java/org/onap') diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/test/IntegrityMonitorTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/test/IntegrityMonitorTest.java index 2fcc1c01..de91a91d 100644 --- a/integrity-monitor/src/test/java/org/onap/policy/common/im/test/IntegrityMonitorTest.java +++ b/integrity-monitor/src/test/java/org/onap/policy/common/im/test/IntegrityMonitorTest.java @@ -63,6 +63,11 @@ public class IntegrityMonitorTest { private static String resourceName; private static Properties systemProps; + private static final String DEFAULT_DB_DRIVER = "org.h2.Driver"; + private static final String DEFAULT_DB_URL = "jdbc:h2:file:./sql/imTest"; + private static final String DEFAULT_DB_USER = "sa"; + private static final String DEFAULT_DB_PWD = ""; + @BeforeClass public static void setUpClass() throws Exception { @@ -77,10 +82,10 @@ public class IntegrityMonitorTest { IntegrityMonitor.setUnitTesting(true); myProp = new Properties(); - myProp.put(IntegrityMonitorProperties.DB_DRIVER, IntegrityMonitorProperties.DEFAULT_DB_DRIVER); - myProp.put(IntegrityMonitorProperties.DB_URL, IntegrityMonitorProperties.DEFAULT_DB_URL); - myProp.put(IntegrityMonitorProperties.DB_USER, IntegrityMonitorProperties.DEFAULT_DB_USER); - myProp.put(IntegrityMonitorProperties.DB_PWD, IntegrityMonitorProperties.DEFAULT_DB_PWD); + myProp.put(IntegrityMonitorProperties.DB_DRIVER, IntegrityMonitorTest.DEFAULT_DB_DRIVER); + myProp.put(IntegrityMonitorProperties.DB_URL, IntegrityMonitorTest.DEFAULT_DB_URL); + myProp.put(IntegrityMonitorProperties.DB_USER, IntegrityMonitorTest.DEFAULT_DB_USER); + myProp.put(IntegrityMonitorProperties.DB_PWD, IntegrityMonitorTest.DEFAULT_DB_PWD); myProp.put(IntegrityMonitorProperties.SITE_NAME, "SiteA"); myProp.put(IntegrityMonitorProperties.NODE_TYPE, "pap"); -- cgit 1.2.3-korg