diff options
author | emaclee <lee.anjella.macabuhay@est.tech> | 2022-06-17 17:42:56 +0100 |
---|---|---|
committer | emaclee <lee.anjella.macabuhay@est.tech> | 2022-06-30 12:08:14 +0100 |
commit | e1f73e264e2dca1f10c273620653f541c2f25d69 (patch) | |
tree | f9adc065420549de0368842ae1f4e7df30c4effe /cps-ri/src/test | |
parent | f7c7848d4cd7654ab94d9c31b62a71ed2bc4b9e8 (diff) |
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 <lee.anjella.macabuhay@est.tech>
Change-Id: I6bf419141a1b33f09871946445cdfff422c8c354
Diffstat (limited to 'cps-ri/src/test')
-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 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, |