diff options
author | ToineSiebelink <toine.siebelink@est.tech> | 2023-07-13 17:55:32 +0100 |
---|---|---|
committer | ToineSiebelink <toine.siebelink@est.tech> | 2023-07-13 18:01:32 +0100 |
commit | 5b4e07234654a4c12e28fea63d96b8a7ee053fcb (patch) | |
tree | 5f691338e2bbc5aff75605d58ad9ce68a0f16fed /cps-ncmp-service/src/main | |
parent | a3aba7c370817c1df7c6188ebe825252b935c4ae (diff) |
Improved code coverage for NetworkCmProxyDataServiceImpl
- Production code had catch block that is no longer needed
- Cleaned up some test somewhat (close to the new tests)
Issue-ID: CPS-475
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
Change-Id: Iaa409e752a496bf088a58ccd422fe3d850442b59
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( |