diff options
author | 2023-10-17 14:16:25 +0100 | |
---|---|---|
committer | 2023-10-19 11:15:04 +0100 | |
commit | 3ccd62ed40e96dbe2970de1433b2ebdbe014d4aa (patch) | |
tree | 67ef07f6482b465e898d85ebd2be5a1f2aa883ee /cps-ncmp-service/src/main/java/org/onap | |
parent | 964fd24568228c6d9d3b93925b5b27dfed911714 (diff) |
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 <sourabh.sourabh@est.tech>
Change-Id: Ia979be3f43ec8e4bbf6f8cb66a8a5e748118f19b
Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
Diffstat (limited to 'cps-ncmp-service/src/main/java/org/onap')
-rwxr-xr-x | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java | 16 |
1 files changed, 11 insertions, 5 deletions
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 a37b27199..b2c71941c 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<CmHandleRegistrationResponse> 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<CmHandleRegistrationResponse> prepareAndGetCmHandleUpgradeResponses(final Map<YangModelCmHandle, + CmHandleState> cmHandleStatePerCmHandle, final Collection<String> notReadyCmHandles) { + final List<CmHandleRegistrationResponse> cmHandleRegistrationResponses + = upgradeCmHandles(cmHandleStatePerCmHandle); + final List<CmHandleRegistrationResponse> failedCmHandleRegistrationResponses + = CmHandleRegistrationResponse.createFailureResponses(notReadyCmHandles, CM_HANDLES_NOT_READY); + failedCmHandleRegistrationResponses.forEach(cmHandleRegistrationResponses::add); + return cmHandleRegistrationResponses; + } + private List<CmHandleRegistrationResponse> upgradeCmHandles(final Map<YangModelCmHandle, CmHandleState> cmHandleStatePerCmHandle) { final List<String> cmHandleIds = getCmHandleIds(cmHandleStatePerCmHandle); |