X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cps-ncmp-service%2Fsrc%2Ftest%2Fgroovy%2Forg%2Fonap%2Fcps%2Fncmp%2Fapi%2Finventory%2Fsync%2FSyncUtilsSpec.groovy;h=e5d3652d2177a8525ef1e35a334fce5d0640f0a2;hb=f16b9614298e7f0a820435f2dab2a856b487bf45;hp=04b2d551330b4899708e2321d9983f918bac71d7;hpb=47d6b392e984181418b920d0ea8fe658f6375acc;p=cps.git diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/sync/SyncUtilsSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/sync/SyncUtilsSpec.groovy index 04b2d5513..e5d3652d2 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/sync/SyncUtilsSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/sync/SyncUtilsSpec.groovy @@ -24,6 +24,7 @@ import com.fasterxml.jackson.databind.ObjectMapper import org.onap.cps.api.CpsDataService import org.onap.cps.ncmp.api.impl.operations.YangModelCmHandleRetriever import org.onap.cps.ncmp.api.impl.yangmodels.YangModelCmHandle +import org.onap.cps.ncmp.api.inventory.CmHandleState import org.onap.cps.spi.CpsDataPersistenceService import org.onap.cps.spi.FetchDescendantsOption import org.onap.cps.spi.model.DataNode @@ -67,10 +68,10 @@ class SyncUtilsSpec extends Specification{ def 'Update cm handle state from Advised to Ready'() { given: 'a yang model cm handle and the expected json data' - def yangModelCmHandle = new YangModelCmHandle('id': 'Some-Cm-Handle', 'cmHandleState': 'ADVISED') + def yangModelCmHandle = new YangModelCmHandle(id: 'Some-Cm-Handle', cmHandleState: CmHandleState.ADVISED) def expectedJsonData = '{"cm-handles":[{"id":"Some-Cm-Handle","state":"READY"}]}' when: 'update cm handle state is called' - objectUnderTest.updateCmHandleState(yangModelCmHandle, 'READY') + objectUnderTest.updateCmHandleState(yangModelCmHandle, CmHandleState.READY) then: 'update data note leaves is invoked with the correct params' 1 * mockCpsDataService.updateNodeLeaves('NCMP-Admin', 'ncmp-dmi-registry', '/dmi-registry', expectedJsonData, _ as OffsetDateTime) }