diff options
Diffstat (limited to 'cps-ri/src/test/groovy/org/onap')
-rw-r--r-- | cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceIntegrationSpec.groovy | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceIntegrationSpec.groovy b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceIntegrationSpec.groovy index c4cfa3d50..8a43e5125 100644 --- a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceIntegrationSpec.groovy +++ b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceIntegrationSpec.groovy @@ -26,9 +26,11 @@ import org.onap.cps.spi.entities.YangResourceEntity import org.onap.cps.spi.exceptions.AlreadyDefinedException import org.onap.cps.spi.exceptions.DataspaceNotFoundException import org.onap.cps.spi.exceptions.SchemaSetNotFoundException +import org.onap.cps.spi.model.ModuleDefinition import org.onap.cps.spi.model.ModuleReference import org.onap.cps.spi.repository.AnchorRepository import org.onap.cps.spi.repository.SchemaSetRepository +import org.onap.cps.spi.repository.YangResourceRepository import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.jdbc.Sql @@ -214,6 +216,14 @@ class CpsModulePersistenceServiceIntegrationSpec extends CpsPersistenceSpecBase yangResourceRepository.findById(sharedResourceId).isPresent() } + @Sql([CLEAR_DATA, SET_DATA]) + def 'Retrieving all yang resources module definition for the given dataspace and anchor name.'() { + when: 'all yang resources module definitions are retrieved for the given dataspace and anchor name' + def result = objectUnderTest.getYangResourceDefinitions('DATASPACE-001', 'ANCHOR3') + then: 'the correct module definitions (moduleName, revision and yang resource content) are returned' + result.sort() == [new ModuleDefinition('MODULE-NAME-004', 'REVISION-004', 'CONTENT-004')] + } + def assertSchemaSetPersisted(expectedDataspaceName, expectedSchemaSetName, expectedYangResourceName, |