From 3b8e95674682403c4e43ca985964ab86226686c0 Mon Sep 17 00:00:00 2001 From: Joss Armstrong Date: Fri, 11 Jan 2019 16:50:12 +0000 Subject: Fix for unit tests in appc-data-access-lib Increased test coverage from 32% to 82% Removed PrepareForTest annotation from class under test Issue-ID: APPC-1324 Change-Id: I58f7e495d0405d994132eea20ebae248d8887238 Signed-off-by: Joss Armstrong --- .../org/onap/appc/dao/util/api/DBConnectionPoolService.java | 6 ++---- .../java/org/onap/appc/dao/util/dbcp/DBConnectionPoolTest.java | 10 +++------- 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'appc-dispatcher/appc-dispatcher-common/appc-data-access-lib') diff --git a/appc-dispatcher/appc-dispatcher-common/appc-data-access-lib/src/main/java/org/onap/appc/dao/util/api/DBConnectionPoolService.java b/appc-dispatcher/appc-dispatcher-common/appc-data-access-lib/src/main/java/org/onap/appc/dao/util/api/DBConnectionPoolService.java index f497c9aa8..6f51fec3c 100644 --- a/appc-dispatcher/appc-dispatcher-common/appc-data-access-lib/src/main/java/org/onap/appc/dao/util/api/DBConnectionPoolService.java +++ b/appc-dispatcher/appc-dispatcher-common/appc-data-access-lib/src/main/java/org/onap/appc/dao/util/api/DBConnectionPoolService.java @@ -5,6 +5,8 @@ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Copyright (C) 2017 Amdocs + * ================================================================================ + * Modifications (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. @@ -24,12 +26,8 @@ package org.onap.appc.dao.util.api; import org.onap.appc.dao.util.exception.DBConnectionPoolException; -import org.onap.appc.dao.util.exception.DataAccessException; import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; import java.util.Map; /** diff --git a/appc-dispatcher/appc-dispatcher-common/appc-data-access-lib/src/test/java/org/onap/appc/dao/util/dbcp/DBConnectionPoolTest.java b/appc-dispatcher/appc-dispatcher-common/appc-data-access-lib/src/test/java/org/onap/appc/dao/util/dbcp/DBConnectionPoolTest.java index 7c2ca6af9..b9ba1daa7 100644 --- a/appc-dispatcher/appc-dispatcher-common/appc-data-access-lib/src/test/java/org/onap/appc/dao/util/dbcp/DBConnectionPoolTest.java +++ b/appc-dispatcher/appc-dispatcher-common/appc-data-access-lib/src/test/java/org/onap/appc/dao/util/dbcp/DBConnectionPoolTest.java @@ -5,6 +5,8 @@ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Copyright (C) 2017 Amdocs + * ================================================================================ + * Modifications (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. @@ -27,19 +29,13 @@ import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import org.junit.runner.RunWith; import org.onap.appc.dao.util.exception.DBConnectionPoolException; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; import java.sql.Connection; import java.sql.SQLException; import java.util.Map; -@RunWith(PowerMockRunner.class) -@PrepareForTest({DBConnectionPool.class}) -@PowerMockIgnore("javax.management.*") + public class DBConnectionPoolTest { private final String connectURI = "jdbc:h2:mem:~/test;MODE=MYSQL;DB_CLOSE_DELAY=-1"; private final String username = "sa"; -- cgit 1.2.3-korg