Unable to change state from LOCKED to ADVISED
[cps.git] / cps-ncmp-service / src / test / groovy / org / onap / cps / ncmp / api / inventory / sync / SyncUtilsSpec.groovy
index 14f2015..2c45ab7 100644 (file)
@@ -30,6 +30,7 @@ import org.onap.cps.ncmp.api.inventory.CompositeState
 import org.onap.cps.ncmp.api.inventory.InventoryPersistence
 import org.onap.cps.ncmp.api.inventory.LockReasonCategory
 import org.onap.cps.ncmp.api.inventory.SyncState
+import org.onap.cps.spi.FetchDescendantsOption
 import org.onap.cps.spi.model.DataNode
 import org.onap.cps.utils.JsonObjectMapper
 import org.springframework.http.HttpStatus
@@ -83,7 +84,8 @@ class SyncUtilsSpec extends Specification{
     def 'Get all locked Cm-Handle where Lock Reason is LOCKED_MISBEHAVING cm handle #scenario'() {
         given: 'the cps (persistence service) returns a collection of data nodes'
             mockInventoryPersistence.getCmHandleDataNodesByCpsPath(
-                    '//lock-reason[@reason="LOCKED_MISBEHAVING"]/ancestor::cm-handles') >> [dataNode ]
+                    '//lock-reason[@reason="LOCKED_MISBEHAVING"]/ancestor::cm-handles',
+                FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS) >> [dataNode ]
         when: 'get locked Misbehaving cm handle is called'
             def result = objectUnderTest.getLockedMisbehavingYangModelCmHandles()
         then: 'the returned cm handle collection is the correct size'