X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cps-ncmp-service%2Fsrc%2Ftest%2Fgroovy%2Forg%2Fonap%2Fcps%2Fncmp%2Fapi%2Fimpl%2FNetworkCmProxyDataServiceImplSpec.groovy;fp=cps-ncmp-service%2Fsrc%2Ftest%2Fgroovy%2Forg%2Fonap%2Fcps%2Fncmp%2Fapi%2Fimpl%2FNetworkCmProxyDataServiceImplSpec.groovy;h=076016718138a43169dedbc5b9c1f01a255d4c0f;hb=0b0a89eec95e2cb2671bdd393e94fdaa89b9cc66;hp=c6c955fba79fb5eb2c6c38d39fb31b95610537a4;hpb=e999b02056c3b4f4a7d891d105d75435d101e6ad;p=cps.git diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy index c6c955fba..076016718 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy @@ -136,6 +136,21 @@ class NetworkCmProxyDataServiceImplSpec extends Specification { 'create, update and delete' | [persistenceCmHandle ] | [persistenceCmHandle ] | cmHandlesArray || 1 | 1 | 1 } + + def 'Register a DMI Plugin for the given cmHandle without additional properties.'() { + given: 'a registration without cmHandle properties ' + def dmiPluginRegistration = new DmiPluginRegistration() + dmiPluginRegistration.dmiPlugin = 'my-server' + persistenceCmHandle.cmHandleID = '123' + persistenceCmHandle.cmHandleProperties = null + dmiPluginRegistration.createdCmHandles = [persistenceCmHandle ] + def expectedJsonData = '{"cm-handles":[{"id":"123","dmi-service-name":"my-server","additional-properties":[]}]}' + when: 'registration is updated' + objectUnderTest.updateDmiPluginRegistration(dmiPluginRegistration) + then: 'the CPS save list node data is invoked with the expected parameters' + 1 * mockCpsDataService.saveListNodeData('NCMP-Admin', 'ncmp-dmi-registry', '/dmi-registry', expectedJsonData) + } + def 'Get resource data for pass-through operational from dmi.'() { given: 'xpath' def xpath = "/dmi-registry/cm-handles[@id='testCmHandle']"