X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=cps-ncmp-service%2Fsrc%2Ftest%2Fgroovy%2Forg%2Fonap%2Fcps%2Fncmp%2Fapi%2Finventory%2Fsync%2FSyncUtilsSpec.groovy;h=c80263ef05db1892e48e44f798524bcfdc9a7c5e;hb=09156406ac7201a7329663e8fedb29dc28547048;hp=e5d3652d2177a8525ef1e35a334fce5d0640f0a2;hpb=806d31aed57c798cba0ecc33d92e5b43fa1d957b;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 e5d3652d2..c80263ef0 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 @@ -25,6 +25,7 @@ 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.ncmp.api.inventory.CompositeState import org.onap.cps.spi.CpsDataPersistenceService import org.onap.cps.spi.FetchDescendantsOption import org.onap.cps.spi.model.DataNode @@ -68,8 +69,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: CmHandleState.ADVISED) - def expectedJsonData = '{"cm-handles":[{"id":"Some-Cm-Handle","state":"READY"}]}' + def compositeState = new CompositeState() + compositeState.cmhandleState = CmHandleState.ADVISED + def yangModelCmHandle = new YangModelCmHandle(id: 'Some-Cm-Handle', compositeState: compositeState ) + def expectedJsonData = '{"cm-handles":[{"id":"Some-Cm-Handle","state":{"cm-handle-state":"READY"}}]}' when: 'update cm handle state is called' objectUnderTest.updateCmHandleState(yangModelCmHandle, CmHandleState.READY) then: 'update data note leaves is invoked with the correct params'