aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy
diff options
context:
space:
mode:
authormpriyank <priyank.maheshwari@est.tech>2022-07-11 12:15:55 +0100
committermpriyank <priyank.maheshwari@est.tech>2022-07-14 09:05:31 +0100
commita6fa6c368f04c85bf553fce2cf89d25ec366116e (patch)
treecc69b8995470a7c4af0eaf4ce2a830ffea98b5a2 /cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy
parent97c875cf3fea520563e1819209ab826f8c03fd5e (diff)
Code Refactoring Ncmp* to Lcm* as per new scope
- Refactored code to reflect the LcmEvents scope now. - Test cases updated and dependencies reviewed. - You can find few occurences of NcmpEvent for now but that will be cleaned up once we implement CPS-1104 which is for LcmEvent schema - UPCOMING: LcmEvent schema and then the code to publish the events on cmHandleStates - LATER : LcmEvents based on public properties update. Issue-ID: CPS-1137 Change-Id: I9f395ed733b4028e706205894c36a38412e3452e Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
Diffstat (limited to 'cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy')
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy10
1 files changed, 6 insertions, 4 deletions
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy
index 1c8b56114..3febaa51b 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy
@@ -69,7 +69,7 @@ class NetworkCmProxyDataServiceImplSpec extends Specification {
@Shared
def OPTIONS_PARAM = '(a=1,b=2)'
@Shared
- def ncmpServiceCmHandle = new NcmpServiceCmHandle(cmHandleId: 'some-cm-handle-id')
+ def ncmpServiceCmHandle = new NcmpServiceCmHandle(cmHandleId: 'test-cm-handle-id')
def objectUnderTest = new NetworkCmProxyDataServiceImpl(spiedJsonObjectMapper, mockDmiDataOperations,
nullNetworkCmProxyDataServicePropertyHandler, mockInventoryPersistence, mockCpsCmHandlerQueryService)
@@ -270,10 +270,12 @@ class NetworkCmProxyDataServiceImplSpec extends Specification {
mockDmiPluginRegistration.getCreatedCmHandles() >> [ncmpServiceCmHandle]
when: 'parse and create cm handle in dmi registration then sync module'
objectUnderTest.parseAndCreateCmHandlesInDmiRegistrationAndSyncModules(mockDmiPluginRegistration)
- then: 'validate params for creating anchor and list elements'
- 1 * mockInventoryPersistence.saveListElements(_) >> {
+ then: 'system persists the cm handle state'
+ 1 * mockInventoryPersistence.saveCmHandle(_) >> {
args -> {
- assert args[0].startsWith('{"cm-handles":[{"id":"some-cm-handle-id","state":{"cm-handle-state":"ADVISED","last-update-time":"20')
+ def result = (args[0] as YangModelCmHandle)
+ assert result.id == 'test-cm-handle-id'
+ assert result.compositeState.cmHandleState == CmHandleState.ADVISED
}
}
}