From e1f73e264e2dca1f10c273620653f541c2f25d69 Mon Sep 17 00:00:00 2001 From: emaclee Date: Fri, 17 Jun 2022 17:42:56 +0100 Subject: Add method to get YANG module sources for CM handle - part of this commit includes renaming the enum SyncState to DataStoreSyncState Issue-ID: CPS-1064 Signed-off-by: emaclee Change-Id: I6bf419141a1b33f09871946445cdfff422c8c354 --- .../spi/impl/CpsModulePersistenceServiceIntegrationSpec.groovy | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cps-ri/src/test') 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 c4cfa3d50b..8a43e5125d 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, -- cgit 1.2.3-korg