aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authormalar <malarvizhi.44@wipro.com>2021-09-01 15:09:10 +0000
committermalar <malarvizhi.44@wipro.com>2021-09-03 04:35:44 +0000
commitee82f3dc04665e8b86ce5c728a34f9701143e518 (patch)
treeb595a59cdf081320ce19b738b2fde37e92d759a0 /src/test
parentafb7bc0c146474e2492d29a70fa1c82689e8e3ed (diff)
Refactored code for standardizing configuration retrieval through common method2.1.4
Issue-ID: DCAEGEN2-2905 Signed-off-by: Malarvizhi Paramasivam <malarvizhi.44@wipro.com> Change-Id: Id268e066093d63f93ba3679831f2875e4afbaada
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/dcaegen2/services/sonhms/child/TestChildThreadUtils.java3
-rw-r--r--src/test/java/org/onap/dcaegen2/services/sonhms/child/TestPnfUtils.java5
-rw-r--r--src/test/java/org/onap/dcaegen2/services/sonhms/utils/ClusterUtilsTest.java4
3 files changed, 5 insertions, 7 deletions
diff --git a/src/test/java/org/onap/dcaegen2/services/sonhms/child/TestChildThreadUtils.java b/src/test/java/org/onap/dcaegen2/services/sonhms/child/TestChildThreadUtils.java
index 8baed64..ba3d4c0 100644
--- a/src/test/java/org/onap/dcaegen2/services/sonhms/child/TestChildThreadUtils.java
+++ b/src/test/java/org/onap/dcaegen2/services/sonhms/child/TestChildThreadUtils.java
@@ -201,8 +201,7 @@ public class TestChildThreadUtils {
}
PowerMockito.whenNew(SdnrRestClient.class).withAnyArguments().thenReturn(sdnr);
- PowerMockito.when(ConfigurationClient.configClient(config.getConfigClientType()))
- .thenReturn(sdnr);
+ PowerMockito.when(config.getConfigurationClient()).thenReturn(sdnr);
PowerMockito.doReturn(3).when(sdnr, "getPci", Mockito.anyString());
PowerMockito.doReturn("pnfName").when(sdnr, "getPnfName", Mockito.anyString());
when(policyDmaapClient.sendNotificationToPolicy(Mockito.anyString())).thenReturn(true);
diff --git a/src/test/java/org/onap/dcaegen2/services/sonhms/child/TestPnfUtils.java b/src/test/java/org/onap/dcaegen2/services/sonhms/child/TestPnfUtils.java
index e54748b..607f0c0 100644
--- a/src/test/java/org/onap/dcaegen2/services/sonhms/child/TestPnfUtils.java
+++ b/src/test/java/org/onap/dcaegen2/services/sonhms/child/TestPnfUtils.java
@@ -136,7 +136,7 @@ public class TestPnfUtils {
.thenReturn(cellInfoNull);
try {
PowerMockito.whenNew(SdnrRestClient.class).withAnyArguments().thenReturn(sdnr);
- PowerMockito.when(ConfigurationClient.configClient(config.getConfigClientType()))
+ PowerMockito.when(config.getConfigurationClient())
.thenReturn(sdnr);
PowerMockito.doReturn(pnfName).when(sdnr, "getPnfName", Mockito.anyString());
PowerMockito.when(cellInfoRepositoryMock.save(new CellInfo(cellId, pnfName))).thenReturn(new CellInfo());
@@ -169,8 +169,7 @@ public class TestPnfUtils {
try {
PowerMockito.whenNew(SdnrRestClient.class).withAnyArguments().thenReturn(sdnr);
- PowerMockito.when(ConfigurationClient.configClient(config.getConfigClientType()))
- .thenReturn(sdnr);
+ PowerMockito.when(config.getConfigurationClient()).thenReturn(sdnr);
PowerMockito.doReturn("ncServer1").when(sdnr, "getPnfName", Mockito.anyString());
actual = pnfUtils.getPnfsForAnrSolutions(anrSolutions);
} catch (ConfigDbNotFoundException e) {
diff --git a/src/test/java/org/onap/dcaegen2/services/sonhms/utils/ClusterUtilsTest.java b/src/test/java/org/onap/dcaegen2/services/sonhms/utils/ClusterUtilsTest.java
index 32d2a47..104ec88 100644
--- a/src/test/java/org/onap/dcaegen2/services/sonhms/utils/ClusterUtilsTest.java
+++ b/src/test/java/org/onap/dcaegen2/services/sonhms/utils/ClusterUtilsTest.java
@@ -57,6 +57,7 @@ import org.onap.dcaegen2.services.sonhms.model.FapServiceList;
import org.onap.dcaegen2.services.sonhms.model.Notification;
import org.onap.dcaegen2.services.sonhms.Configuration;
import org.onap.dcaegen2.services.sonhms.exceptions.CpsNotFoundException;
+import org.onap.dcaegen2.services.sonhms.restclient.ConfigInterface;
import org.onap.dcaegen2.services.sonhms.restclient.ConfigurationClient;
import org.onap.dcaegen2.services.sonhms.restclient.SdnrRestClient;
import org.powermock.api.mockito.PowerMockito;
@@ -172,8 +173,7 @@ public class ClusterUtilsTest {
Configuration config = Configuration.getInstance();
PowerMockito.whenNew(SdnrRestClient.class).withAnyArguments().thenReturn(sdnr);
- PowerMockito.when(ConfigurationClient.configClient(config.getConfigClientType()))
- .thenReturn(sdnr);
+ PowerMockito.when(config.getConfigurationClient()).thenReturn(sdnr);
PowerMockito.doReturn(nbrList).when(sdnr, "getNbrList", Mockito.anyString());
clusterMap.put(new CellPciPair("45", 310), (ArrayList<CellPciPair>) firstNbrList);