From 71e4f8339e0240f90ad0a42a9360be52553f0d82 Mon Sep 17 00:00:00 2001 From: "rajesh.kumar" Date: Wed, 14 Sep 2022 05:11:32 +0000 Subject: Added API to get all schema sets for a given dataspace. Issue-ID: CPS-1187 Change-ID: I73f97f986a817d423f93a8d922dcd9647b0914aa Signed-off-by: rajesh.kumar --- .../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 f9ebc52f1..bcb080726 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 @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2021-2022 Nordix Foundation * Modifications Copyright (C) 2021-2022 Bell Canada. + * Modifications Copyright (C) 2022 TechMahindra Ltd. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. @@ -28,6 +29,7 @@ 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.model.SchemaSet import org.onap.cps.spi.repository.AnchorRepository import org.onap.cps.spi.repository.SchemaSetRepository import org.onap.cps.spi.repository.SchemaSetYangResourceRepositoryImpl @@ -208,6 +210,14 @@ class CpsModulePersistenceServiceIntegrationSpec extends CpsPersistenceSpecBase existingResourceRevision, existingResourceContent, existingResourceChecksum) } + @Sql([CLEAR_DATA, SET_DATA]) + def 'Retrieve schema sets for a given dataspace name'() { + when: 'the schema set resources for a given dataspace name is retrieved' + def result = objectUnderTest.getSchemaSetsByDataspaceName(DATASPACE_NAME) + then: 'the correct resources are returned' + result.contains(new SchemaSet(name: 'SCHEMA-SET-001', dataspaceName: 'DATASPACE-001')) + } + @Sql([CLEAR_DATA, SET_DATA]) def 'Delete schema set'() { when: 'a schema set is deleted with cascade-prohibited option' -- cgit 1.2.3-korg