X-Git-Url: https://gerrit.onap.org/r/gitweb?p=cps.git;a=blobdiff_plain;f=cps-ncmp-service%2Fsrc%2Ftest%2Fgroovy%2Forg%2Fonap%2Fcps%2Fncmp%2Fapi%2Fimpl%2Foperations%2FYangModelCmHandleRetrieverSpec.groovy;h=5ecc8b0da376ea5466224663ab051f38f8e8e7b9;hp=beea1faada64a0c17bd1029eaf712066c4a70a48;hb=ef62391fb034f599f92b113e27f90f7cedc1a5c0;hpb=324eb16687756f1850ffa484f652e117878cf33f diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/YangModelCmHandleRetrieverSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/YangModelCmHandleRetrieverSpec.groovy index beea1faad..5ecc8b0da 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/YangModelCmHandleRetrieverSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/YangModelCmHandleRetrieverSpec.groovy @@ -79,4 +79,16 @@ class YangModelCmHandleRetrieverSpec extends Specification { and: 'the result is not returned' result == null } + + def "Handling missing service names as null CPS-1043."() { + given: 'the cps data service returns a data node from the DMI registry with empty child and leaf attributes' + def dataNode = new DataNode(childDataNodes:[], leaves: [:]) + mockCpsDataService.getDataNode('NCMP-Admin', 'ncmp-dmi-registry', xpath, INCLUDE_ALL_DESCENDANTS) >> dataNode + when: 'retrieving the yang modelled cm handle' + def result = objectUnderTest.getYangModelCmHandle(cmHandleId) + then: 'the service names ae returned as null' + result.dmiServiceName == null + result.dmiDataServiceName == null + result.dmiModelServiceName == null + } }