- assertSchemaSetPersisted(DATASPACE_NAME, SCHEMA_SET_NAME_NEW, NEW_RESOURCE_NAME,
- NEW_RESOURCE_CONTENT, NEW_RESOURCE_CHECKSUM, NEW_RESOURCE_MODULE_NAME, NEW_RESOURCE_REVISION)
+ assertSchemaSetWithOneModuleIsPersistedCorrectly(NEW_RESOURCE_NAME,
+ NEW_RESOURCE_MODULE_NAME, NEW_RESOURCE_REVISION, NEW_RESOURCE_CONTENT, NEW_RESOURCE_CHECKSUM)
+ }
+
+ @Sql([CLEAR_DATA, SET_DATA])
+ def 'Store new schema set with multiple modules.'() {
+ given: 'a new schema set with #numberOfModules modules'
+ def numberOfModules = 2
+ String schemaSetName = "NewSchemaWith${numberOfModules}Modules"
+ def newYangResourcesNameToContentMap = [:]
+ (1..numberOfModules).each {
+ def uniqueRevision = String.valueOf(2000 + it) + '-01-01'
+ def uniqueContent = NEW_RESOURCE_CONTENT.replace(NEW_RESOURCE_REVISION, uniqueRevision)
+ newYangResourcesNameToContentMap.put(uniqueRevision, uniqueContent)
+ }
+ when: 'the new schema set is stored'
+ objectUnderTest.storeSchemaSet(DATASPACE_NAME, schemaSetName, newYangResourcesNameToContentMap)
+ then: 'the correct number of modules are persisted'
+ assert getYangResourceEntities(schemaSetName).size() == numberOfModules