diff options
author | Claudio David Gasparini <claudio.gasparini@pantheon.tech> | 2021-01-07 12:21:38 +0100 |
---|---|---|
committer | Claudio David Gasparini <claudio.gasparini@pantheon.tech> | 2021-01-11 10:01:27 +0100 |
commit | fa56d71bb94d88f657a9d73fb91c3036220f32ab (patch) | |
tree | 163bd68ae4a77cdc4412a5354958090e7063f257 /cps-service/src/test | |
parent | 45b0d293c2d625c6d352d71a743f832c5e287c4e (diff) |
Rework CpsModulePersistenceService
- remove getModuleReferences
- provide service returning YangTextSchemaSourceSet
Issue-ID: CPS-21
Signed-off-by: Claudio David Gasparini <claudio.gasparini@pantheon.tech>
Change-Id: I61cf6450c8ed8a5154990ea19467e016dc1155b4
Diffstat (limited to 'cps-service/src/test')
-rw-r--r-- | cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy | 17 |
1 files changed, 13 insertions, 4 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 a93411bfe9..ebe4fe7bce 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 @@ -21,11 +21,9 @@ package org.onap.cps.api.impl import org.onap.cps.TestUtils -import org.onap.cps.spi.CpsModulePersistenceService +import org.onap.cps.spi.CpsModulePersistenceService; import org.onap.cps.spi.exceptions.ModelValidationException -import org.onap.cps.utils.YangUtils -import org.opendaylight.yangtools.yang.common.Revision -import org.opendaylight.yangtools.yang.model.api.SchemaContext +import org.onap.cps.spi.model.ModuleReference import spock.lang.Specification class CpsModuleServiceImplSpec extends Specification { @@ -54,4 +52,15 @@ class CpsModuleServiceImplSpec extends Specification { thrown(ModelValidationException.class) } + def 'Get schema set by name and namespace.'() { + given: 'an already present schema set' + def yangResourcesNameToContentMap = TestUtils.getYangResourcesAsMap('bookstore.yang') + mockModuleStoreService.getYangSchemaResources('someDataspace', 'someSchemaSet') >> yangResourcesNameToContentMap + when: 'get schema set method is invoked' + def result = objectUnderTest.getSchemaSet('someDataspace', 'someSchemaSet') + 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')) + } } |