diff options
author | Luke Gleeson <luke.gleeson@est.tech> | 2023-07-14 11:25:14 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2023-07-14 11:25:14 +0000 |
commit | efd255d61b0414d9cd44267779d144b78d1eb294 (patch) | |
tree | 1d2650fd624dc79863c862bcd2ffda98d5dbbf7c /cps-ncmp-service/src/main | |
parent | 1de01a856f4e655ae82c945c5229d7f4d2ab37ad (diff) | |
parent | 5b4e07234654a4c12e28fea63d96b8a7ee053fcb (diff) |
Merge "Improved code coverage for NetworkCmProxyDataServiceImpl"
Diffstat (limited to 'cps-ncmp-service/src/main')
-rwxr-xr-x | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java | 29 |
1 files changed, 10 insertions, 19 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 6c1a1b464a..ea2f72fef7 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 @@ -295,26 +295,17 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService */ public List<CmHandleRegistrationResponse> parseAndCreateCmHandlesInDmiRegistrationAndSyncModules( final DmiPluginRegistration dmiPluginRegistration) { - List<CmHandleRegistrationResponse> cmHandleRegistrationResponses = new ArrayList<>(); final Map<YangModelCmHandle, CmHandleState> cmHandleStatePerCmHandle = new HashMap<>(); - try { - dmiPluginRegistration.getCreatedCmHandles() - .forEach(cmHandle -> { - final YangModelCmHandle yangModelCmHandle = YangModelCmHandle.toYangModelCmHandle( - dmiPluginRegistration.getDmiPlugin(), - dmiPluginRegistration.getDmiDataPlugin(), - dmiPluginRegistration.getDmiModelPlugin(), - cmHandle); - cmHandleStatePerCmHandle.put(yangModelCmHandle, CmHandleState.ADVISED); - }); - cmHandleRegistrationResponses = registerNewCmHandles(cmHandleStatePerCmHandle); - } catch (final DataValidationException dataValidationException) { - cmHandleRegistrationResponses.add(CmHandleRegistrationResponse.createFailureResponse(dmiPluginRegistration - .getCreatedCmHandles().stream() - .map(NcmpServiceCmHandle::getCmHandleId).findFirst().orElse(null), - RegistrationError.CM_HANDLE_INVALID_ID)); - } - return cmHandleRegistrationResponses; + dmiPluginRegistration.getCreatedCmHandles() + .forEach(cmHandle -> { + final YangModelCmHandle yangModelCmHandle = YangModelCmHandle.toYangModelCmHandle( + dmiPluginRegistration.getDmiPlugin(), + dmiPluginRegistration.getDmiDataPlugin(), + dmiPluginRegistration.getDmiModelPlugin(), + cmHandle); + cmHandleStatePerCmHandle.put(yangModelCmHandle, CmHandleState.ADVISED); + }); + return registerNewCmHandles(cmHandleStatePerCmHandle); } protected List<CmHandleRegistrationResponse> parseAndRemoveCmHandlesInDmiRegistration( |