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
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'