- assertSchemaSetPersisted(DATASPACE_NAME, SCHEMA_SET_NAME_NEW, NEW_RESOURCE_ABSTRACT_ID, NEW_RESOURCE_NAME,
- NEW_RESOURCE_CONTENT, NEW_RESOURCE_CHECKSUM)
+ assertSchemaSetPersisted(DATASPACE_NAME, SCHEMA_SET_NAME_NEW, NEW_RESOURCE_NAME,
+ NEW_RESOURCE_CONTENT, NEW_RESOURCE_CHECKSUM, NEW_RESOURCE_MODULE_NAME, NEW_RESOURCE_REVISION)
+ }
+
+ @Sql([CLEAR_DATA, SET_DATA])
+ def 'Store and retrieve new schema set from new modules and existing modules.'() {
+ given: 'map of new modules, a list of existing modules, module reference'
+ def mapOfNewModules = [newModule1: 'module newmodule { yang-version 1.1; revision "2021-10-12" { } }']
+ def moduleReferenceForExistingModule = new ModuleReference("test","2021-10-12")
+ def listOfExistingModulesModuleReference = [moduleReferenceForExistingModule]
+ def mapOfExistingModule = [test: 'module test { yang-version 1.1; revision "2021-10-12" { } }']
+ objectUnderTest.storeSchemaSet(DATASPACE_NAME, "someSchemaSetName", mapOfExistingModule)
+ when: 'a new schema set is created from these new modules and existing modules'
+ objectUnderTest.storeSchemaSetFromModules(DATASPACE_NAME, "newSchemaSetName" , mapOfNewModules, listOfExistingModulesModuleReference)
+ then: 'the schema set can be retrieved'
+ def expectedYangResourcesMapAfterSchemaSetHasBeenCreated = mapOfNewModules + mapOfExistingModule
+ def actualYangResourcesMapAfterSchemaSetHasBeenCreated =
+ objectUnderTest.getYangSchemaResources(DATASPACE_NAME, "newSchemaSetName")
+ actualYangResourcesMapAfterSchemaSetHasBeenCreated == expectedYangResourcesMapAfterSchemaSetHasBeenCreated