diff options
author | niamhcore <niamh.core@est.tech> | 2021-09-01 17:12:28 +0100 |
---|---|---|
committer | aditya puthuparambil <aditya.puthuparambil@bell.ca> | 2021-09-06 14:06:16 +0000 |
commit | d0422226b45f752086c9920bdead753c644d9289 (patch) | |
tree | 219118e284927589ad69dc4ded6d520e76e77530 /cps-service/src/test/groovy | |
parent | c27465347d10b573e7a211c0b11b7c8a6fd792c0 (diff) |
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 <niamh.core@est.tech>
Change-Id: I0d0da7742ceef3a68e83a5dd4852091e6adf138b
Diffstat (limited to 'cps-service/src/test/groovy')
-rw-r--r-- | cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy | 12 |
1 files changed, 6 insertions, 6 deletions
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 } } |