From 3ccd62ed40e96dbe2970de1433b2ebdbe014d4aa Mon Sep 17 00:00:00 2001 From: sourabh_sourabh Date: Tue, 17 Oct 2023 14:16:25 +0100 Subject: Code coverage: Update YANG schema set using moduleSetTag - Code coverage is increased to 98. - New groovy test is added to cover new code. Issue-ID: CPS-1798 Signed-off-by: sourabh_sourabh Change-Id: Ia979be3f43ec8e4bbf6f8cb66a8a5e748118f19b Signed-off-by: sourabh_sourabh --- .../cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'cps-ncmp-service/src/main/java/org') diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java index a37b27199c..b2c71941c5 100755 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java @@ -389,11 +389,7 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService } }); - final List cmHandleRegistrationResponses - = upgradeCmHandles(cmHandleStatePerCmHandle); - cmHandleRegistrationResponses.addAll(CmHandleRegistrationResponse.createFailureResponses(notReadyCmHandles, - CM_HANDLES_NOT_READY)); - return cmHandleRegistrationResponses; + return prepareAndGetCmHandleUpgradeResponses(cmHandleStatePerCmHandle, notReadyCmHandles); } private CmHandleRegistrationResponse deleteCmHandleAndGetCmHandleRegistrationResponse(final String cmHandleId) { @@ -462,6 +458,16 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService } } + private List prepareAndGetCmHandleUpgradeResponses(final Map cmHandleStatePerCmHandle, final Collection notReadyCmHandles) { + final List cmHandleRegistrationResponses + = upgradeCmHandles(cmHandleStatePerCmHandle); + final List failedCmHandleRegistrationResponses + = CmHandleRegistrationResponse.createFailureResponses(notReadyCmHandles, CM_HANDLES_NOT_READY); + failedCmHandleRegistrationResponses.forEach(cmHandleRegistrationResponses::add); + return cmHandleRegistrationResponses; + } + private List upgradeCmHandles(final Map cmHandleStatePerCmHandle) { final List cmHandleIds = getCmHandleIds(cmHandleStatePerCmHandle); -- cgit 1.2.3-korg