Filling Code Coverage gaps in CPS-NCMP-Service 60/142460/2
authorToineSiebelink <toine.siebelink@est.tech>
Thu, 20 Nov 2025 15:37:25 +0000 (15:37 +0000)
committerToineSiebelink <toine.siebelink@est.tech>
Mon, 24 Nov 2025 10:47:12 +0000 (10:47 +0000)
commitc41866f694174669411182ca4bceb0256e7ac5b4
treecf38934504e5382135460a4c950bbe4b1a4f23a1
parent426c4b506982beeb3725778bb43afb27094b005c
Filling Code Coverage gaps in CPS-NCMP-Service

- Removed unused variation of ProvMnS exception
- Cover error scenarios on Inventory Facade Impl
- Refactored LCM Event sending to always use (batch) of CmHandleTransitionPair
  (this meant I could avoid a different variations that was hard to test, and simply removed redundant duplicated code
- Add tested for simple data object no used in any current test
- Added some additional (typically negative) scenarios in existing test
- Change LCM Event related methods signatures to use term 'current' and 'target' and in that order consistently
- Refactored (simplified) Lcm Event Helper had a lot of unnecessary method splitting ending up in bad names like populateX & create
- Simplified arg[] handle and some other groovy improvement in related tests

Issue-ID:CPS-475

Change-Id: Ifd1ec6246a316098dec62a8f6737f90cfda36de5
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
22 files changed:
cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyRestExceptionHandlerSpec.groovy
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/exceptions/ProvMnSException.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/models/CompositeStateBuilder.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/NetworkCmProxyInventoryFacadeImpl.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/CmHandleRegistrationServicePropertyHandler.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/lcm/CmHandleStateMonitor.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/lcm/CmHandleTransitionPair.java [new file with mode: 0644]
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/lcm/LcmEventsCmHandleStateHandlerImpl.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/lcm/LcmEventsHelper.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/lcm/LcmEventsProducerHelper.java
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/datajobs/models/DataJobRequestSpec.groovy [new file with mode: 0644]
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/exceptions/ServerNcmpExceptionSpec.groovy [new file with mode: 0644]
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/models/CompositeStateBuilderSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/cache/AdminCacheConfigSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/cache/AlternateIdCacheConfigSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/datajobs/subscription/cache/CmSubscriptionConfigSpec.groovy [deleted file]
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/CmHandleRegistrationServicePropertyHandlerSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImplSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/NetworkCmProxyInventoryFacadeSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/lcm/CmHandleStateMonitorSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/lcm/LcmEventsCmHandleStateHandlerImplSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/lcm/LcmEventsProducerHelperSpec.groovy