summaryrefslogtreecommitdiffstats
path: root/appc-dispatcher/appc-dispatcher-common/appc-data-access-lib/src/main
diff options
context:
space:
mode:
authorJoss Armstrong <joss.armstrong@ericsson.com>2019-02-06 14:58:20 +0000
committerPatrick Brady <patrick.brady@att.com>2019-02-06 21:46:13 +0000
commit8fdee1fb6c2ce27f245a921536739ef2d4f678a2 (patch)
treecbd481e17a168789c1da7efb0f0bd08dcd1a1482 /appc-dispatcher/appc-dispatcher-common/appc-data-access-lib/src/main
parent8ceb16a925d8ebd0ae05f6745a68507e990d9395 (diff)
Increase coverage in AppcDatabaseConnectionPool
Add test cases and increase coverage to 94% Issue-ID: APPC-1394 Change-Id: I7ec2b0cb4fe5a22ebd8020eb7f5636075e1c5ac5 Signed-off-by: Joss Armstrong <joss.armstrong@ericsson.com>
Diffstat (limited to 'appc-dispatcher/appc-dispatcher-common/appc-data-access-lib/src/main')
-rw-r--r--appc-dispatcher/appc-dispatcher-common/appc-data-access-lib/src/main/java/org/onap/appc/dao/util/AppcDatabaseConnectionPool.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/appc-dispatcher/appc-dispatcher-common/appc-data-access-lib/src/main/java/org/onap/appc/dao/util/AppcDatabaseConnectionPool.java b/appc-dispatcher/appc-dispatcher-common/appc-data-access-lib/src/main/java/org/onap/appc/dao/util/AppcDatabaseConnectionPool.java
index ec8898113..1f4a75911 100644
--- a/appc-dispatcher/appc-dispatcher-common/appc-data-access-lib/src/main/java/org/onap/appc/dao/util/AppcDatabaseConnectionPool.java
+++ b/appc-dispatcher/appc-dispatcher-common/appc-data-access-lib/src/main/java/org/onap/appc/dao/util/AppcDatabaseConnectionPool.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Copyright (C) 2017 Amdocs
+ * ================================================================================
+ * Modifications Copyright (C) 2019 Ericsson
* =============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -80,8 +82,7 @@ public class AppcDatabaseConnectionPool implements DBConnectionPoolService {
String password = getConnectionProperty(configuration, PropertyPattern.PASSWORD);
String jdbcDriver = getJDBCDriver(configuration);
- dbConnectionPool = new DBConnectionPool(dbUrl, userName, password, jdbcDriver);
-
+ dbConnectionPool = getDBConnectionPool(dbUrl, userName, password, jdbcDriver);
// a simple health check
Connection connection = null;
try {
@@ -141,4 +142,8 @@ public class AppcDatabaseConnectionPool implements DBConnectionPoolService {
private String getJDBCDriver(Configuration configuration) {
return configuration.getProperty(PropertyPattern.DRIVER.getPattern(), "");
}
+
+ protected DBConnectionPool getDBConnectionPool(String dbUrl, String userName, String password, String jdbcDriver) {
+ return new DBConnectionPool(dbUrl, userName, password, jdbcDriver);
+ }
}