From d0422226b45f752086c9920bdead753c644d9289 Mon Sep 17 00:00:00 2001 From: niamhcore Date: Wed, 1 Sep 2021 17:12:28 +0100 Subject: P1 - Get module name and revision persistence layer Rename ModuleReference to ExtendedModuleReference Create new ModuleReference class (moduleName and revision) Update existing sync model flow to use new module reference class Create native query to get module name and revision Issue-ID: CPS-485 Signed-off-by: niamhcore Change-Id: I0d0da7742ceef3a68e83a5dd4852091e6adf138b --- .../org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'cps-service/src/test') diff --git a/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy index d719b3d24e..31df479e42 100644 --- a/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy +++ b/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy @@ -25,7 +25,7 @@ package org.onap.cps.api.impl import org.onap.cps.TestUtils import org.onap.cps.spi.CpsModulePersistenceService import org.onap.cps.spi.exceptions.ModelValidationException -import org.onap.cps.spi.model.ModuleReference +import org.onap.cps.spi.model.ExtendedModuleReference import org.spockframework.spring.SpringBean import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest @@ -63,7 +63,7 @@ class CpsModuleServiceImplSpec extends Specification { def 'Create schema set from new modules and existing modules.'() { given: 'a list of existing modules module reference' - def moduleReferenceForExistingModule = new ModuleReference("test", "test.org", "2021-10-12") + def moduleReferenceForExistingModule = new ExtendedModuleReference("test", "test.org", "2021-10-12") def listOfExistingModulesModuleReference = [moduleReferenceForExistingModule] when: 'create schema set from modules method is invoked' objectUnderTest.createSchemaSetFromModules("someDataspaceName", "someSchemaSetName", [newModule: "newContent"], listOfExistingModulesModuleReference) @@ -90,7 +90,7 @@ class CpsModuleServiceImplSpec extends Specification { then: 'the correct schema set is returned' result.getName().contains('someSchemaSet') result.getDataspaceName().contains('someDataspace') - result.getModuleReferences().contains(new ModuleReference('stores', 'org:onap:ccsdk:sample', '2020-09-15')) + result.getExtendedModuleReferences().contains(new ExtendedModuleReference('stores', 'org:onap:ccsdk:sample', '2020-09-15')) } def 'Schema set caching.'() { @@ -117,9 +117,9 @@ class CpsModuleServiceImplSpec extends Specification { def 'Get all yang resources module references.'(){ given: 'an already present module reference' - def moduleReferences = [new ModuleReference()] - mockModuleStoreService.getAllYangResourcesModuleReferences() >> moduleReferences + def moduleReferences = [new ExtendedModuleReference()] + mockModuleStoreService.getAllYangResourceModuleReferences('someDataspaceName') >> moduleReferences expect: 'the list provided by persistence service is returned as result' - objectUnderTest.getAllYangResourcesModuleReferences() == moduleReferences + objectUnderTest.getAllYangResourceModuleReferences('someDataspaceName') == moduleReferences } } -- cgit 1.2.3-korg