diff options
Diffstat (limited to 'cps-ncmp-service/src/test/groovy')
2 files changed, 9 insertions, 9 deletions
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 b42db57233..ff3e0cd157 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 @@ -357,23 +357,23 @@ class NetworkCmProxyDataServiceImplSpec extends Specification { def 'Sync model for a (new) cm handle with #scenario'() { given: 'DMI PLug-in returns a list of module references' getModulesForCmHandle() - def knownModule1 = new ModuleReference('module1', NO_NAMESPACE, '1') - def knownOtherModule = new ModuleReference('some other module', NO_NAMESPACE, 'some revision') + def knownModule1 = new ModuleReference('module1', '1') + def knownOtherModule = new ModuleReference('some other module', 'some revision') and: 'CPS-Core returns list of known modules' - mockCpsModuleService.getAllYangResourcesModuleReferences() >> [knownModule1, knownOtherModule] + mockCpsModuleService.getAllYangResourceModuleReferences(_) >> [knownModule1, knownOtherModule] and: 'DMI-Plugin returns resource(s) for "new" module(s)' def moduleResources = new ResponseEntity<String>(sdncReponseBody, HttpStatus.OK) mockDmiOperations.getResourceFromDmi(_, cmHandleForModelSync.getId(), 'moduleResources') >> moduleResources when: 'module Sync is triggered' objectUnderTest.createAnchorAndSyncModel(cmHandleForModelSync) then: 'the CPS module service is called once with the correct parameters' - 1 * mockCpsModuleService.createSchemaSetFromModules(expectedDataspaceNameForModleSync, cmHandleForModelSync.getId(), expectedYangResourceToContentMap , [knownModule1]) + 1 * mockCpsModuleService.createSchemaSetFromModules(expectedDataspaceNameForModleSync, cmHandleForModelSync.getId(), expectedYangResourceToContentMap, [knownModule1]) and: 'admin service create anchor method has been called with correct parameters' 1 * mockCpsAdminService.createAnchor(expectedDataspaceNameForModleSync, cmHandleForModelSync.getId(), cmHandleForModelSync.getId()) where: 'the following responses are recieved from SDNC' - scenario | sdncReponseBody || expectedYangResourceToContentMap + scenario | sdncReponseBody || expectedYangResourceToContentMap 'one unknown module' | '[{"moduleName" : "someModule", "revision" : "1","yangSource": "someResource"}]' || [someModule: 'someResource'] - 'no unknown module' | '[]' || [:] + 'no unknown module' | '[]' || [:] } def getModulesForCmHandle() { diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/models/moduleReferenceSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/models/moduleReferenceSpec.groovy index d6cb4635d8..9f161a9e53 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/models/moduleReferenceSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/models/moduleReferenceSpec.groovy @@ -1,14 +1,14 @@ package org.onap.cps.ncmp.api.models -import org.onap.cps.spi.model.ModuleReference +import org.onap.cps.spi.model.ExtendedModuleReference import spock.lang.Specification class moduleReferenceSpec extends Specification { def 'lombok data annotation correctly implements toString() and hashCode() methods'() { given: 'two moduleReference objects' - def moduleReference1 = new ModuleReference('module1', "some namespace", '1') - def moduleReference2 = new ModuleReference('module1', "some namespace", '1') + def moduleReference1 = new ExtendedModuleReference('module1', "some namespace", '1') + def moduleReference2 = new ExtendedModuleReference('module1', "some namespace", '1') when: 'lombok generated methods are called' then: 'the methods exist and behaviour is accurate' assert moduleReference1.toString() == moduleReference2.toString() |