diff options
author | Niamh Core <niamh.core@est.tech> | 2021-08-18 10:40:26 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-08-18 10:40:26 +0000 |
commit | 24112c0a500e94dc6068be71105874f8d81678b7 (patch) | |
tree | 5db8eb2edc8938d72f98529e61a8210020bda111 /cps-service/src/test/groovy | |
parent | ddf661254f711d78b480b8f5623632443a8f6ebc (diff) | |
parent | 4c52e1a31c1424a954b2a1540117b4fbb443c578 (diff) |
Merge "CPS-508: Create anchor/schemaset from new modules and existing modules"
Diffstat (limited to 'cps-service/src/test/groovy')
-rw-r--r-- | cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy | 13 |
1 files changed, 12 insertions, 1 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 b8bfd4593e..d719b3d24e 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 @@ -52,7 +52,7 @@ class CpsModuleServiceImplSpec extends Specification { @Autowired CpsModuleServiceImpl objectUnderTest - def 'Create schema set'() { + def 'Create schema set.'() { given: 'Valid yang resource as name-to-content map' def yangResourcesNameToContentMap = TestUtils.getYangResourcesAsMap('bookstore.yang') when: 'Create schema set method is invoked' @@ -61,6 +61,17 @@ class CpsModuleServiceImplSpec extends Specification { 1 * mockModuleStoreService.storeSchemaSet('someDataspace', 'someSchemaSet', yangResourcesNameToContentMap) } + 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 listOfExistingModulesModuleReference = [moduleReferenceForExistingModule] + when: 'create schema set from modules method is invoked' + objectUnderTest.createSchemaSetFromModules("someDataspaceName", "someSchemaSetName", [newModule: "newContent"], listOfExistingModulesModuleReference) + then: 'processing is delegated to persistence service' + 1 * mockModuleStoreService.storeSchemaSetFromModules("someDataspaceName", "someSchemaSetName", [newModule: "newContent"], listOfExistingModulesModuleReference) + + } + def 'Create schema set from invalid resources'() { given: 'Invalid yang resource as name-to-content map' def yangResourcesNameToContentMap = TestUtils.getYangResourcesAsMap('invalid.yang') |