diff options
author | Priyank Maheshwari <priyank.maheshwari@est.tech> | 2023-11-23 10:23:45 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2023-11-23 10:23:45 +0000 |
commit | b5d03c741caac8c255e20a1245f709045c238e90 (patch) | |
tree | 43e35935fcd6b5c3e36639bb07527dc9f511ec40 /cps-ncmp-service/src/test/groovy/org | |
parent | c6dfb03f66eb4573c6fcea761e2414aadaaf7878 (diff) | |
parent | 8090317460b8076f128fd8da46873135b007e2fd (diff) |
Merge "Onboard merge subscriptions model"
Diffstat (limited to 'cps-ncmp-service/src/test/groovy/org')
-rw-r--r-- | cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/EventPublisherSpec.groovy | 4 | ||||
-rw-r--r-- | cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/AbstractModelLoaderSpec.groovy | 4 | ||||
-rw-r--r-- | cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/CmDataSubscriptionModelLoaderSpec.groovy (renamed from cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/SubscriptionModelLoaderSpec.groovy) | 16 | ||||
-rw-r--r-- | cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/InventoryModelLoaderSpec.groovy | 4 |
4 files changed, 14 insertions, 14 deletions
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/EventPublisherSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/EventPublisherSpec.groovy index d0f1afd5d5..0e063834e4 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/EventPublisherSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/EventPublisherSpec.groovy @@ -26,7 +26,7 @@ import ch.qos.logback.core.read.ListAppender import org.apache.kafka.clients.producer.ProducerRecord import org.apache.kafka.clients.producer.RecordMetadata import org.apache.kafka.common.TopicPartition -import org.onap.cps.ncmp.init.SubscriptionModelLoader +import org.onap.cps.ncmp.init.CmDataSubscriptionModelLoader import org.slf4j.LoggerFactory import org.springframework.kafka.support.SendResult import spock.lang.Ignore @@ -46,7 +46,7 @@ class EventPublisherSpec extends Specification { } void cleanup() { - ((Logger) LoggerFactory.getLogger(SubscriptionModelLoader.class)).detachAndStopAllAppenders() + ((Logger) LoggerFactory.getLogger(CmDataSubscriptionModelLoader.class)).detachAndStopAllAppenders() } @Ignore diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/AbstractModelLoaderSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/AbstractModelLoaderSpec.groovy index 28eae8df14..e5ed21f1c4 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/AbstractModelLoaderSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/AbstractModelLoaderSpec.groovy @@ -49,7 +49,7 @@ class AbstractModelLoaderSpec extends Specification { def loggingListAppender void setup() { - yangResourceToContentMap = objectUnderTest.createYangResourceToContentMap('subscription.yang') + yangResourceToContentMap = objectUnderTest.createYangResourcesToContentMap('subscription.yang') logger.setLevel(Level.DEBUG) loggingListAppender = new ListAppender() logger.addAppender(loggingListAppender) @@ -58,7 +58,7 @@ class AbstractModelLoaderSpec extends Specification { } void cleanup() { - ((Logger) LoggerFactory.getLogger(SubscriptionModelLoader.class)).detachAndStopAllAppenders() + ((Logger) LoggerFactory.getLogger(CmDataSubscriptionModelLoader.class)).detachAndStopAllAppenders() applicationContext.close() } diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/SubscriptionModelLoaderSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/CmDataSubscriptionModelLoaderSpec.groovy index 3486316a0a..06627129a9 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/SubscriptionModelLoaderSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/CmDataSubscriptionModelLoaderSpec.groovy @@ -34,21 +34,21 @@ import org.springframework.boot.context.event.ApplicationReadyEvent import org.springframework.context.annotation.AnnotationConfigApplicationContext import spock.lang.Specification -class SubscriptionModelLoaderSpec extends Specification { +class CmDataSubscriptionModelLoaderSpec extends Specification { def mockCpsAdminService = Mock(CpsAdminService) def mockCpsModuleService = Mock(CpsModuleService) def mockCpsDataService = Mock(CpsDataService) - def objectUnderTest = new SubscriptionModelLoader(mockCpsAdminService, mockCpsModuleService, mockCpsDataService) + def objectUnderTest = new CmDataSubscriptionModelLoader(mockCpsAdminService, mockCpsModuleService, mockCpsDataService) def applicationContext = new AnnotationConfigApplicationContext() - def expectedYangResourceToContentMap + def expectedYangResourcesToContentMap def logger = (Logger) LoggerFactory.getLogger(objectUnderTest.class) def loggingListAppender void setup() { - expectedYangResourceToContentMap = objectUnderTest.createYangResourceToContentMap('subscription.yang') + expectedYangResourcesToContentMap = objectUnderTest.createYangResourcesToContentMap('cm-data-subscriptions@2023-11-13.yang') logger.setLevel(Level.DEBUG) loggingListAppender = new ListAppender() logger.addAppender(loggingListAppender) @@ -57,7 +57,7 @@ class SubscriptionModelLoaderSpec extends Specification { } void cleanup() { - ((Logger) LoggerFactory.getLogger(SubscriptionModelLoader.class)).detachAndStopAllAppenders() + ((Logger) LoggerFactory.getLogger(CmDataSubscriptionModelLoader.class)).detachAndStopAllAppenders() applicationContext.close() } @@ -69,11 +69,11 @@ class SubscriptionModelLoaderSpec extends Specification { when: 'the application is ready' objectUnderTest.onApplicationEvent(Mock(ApplicationReadyEvent)) then: 'the module service to create schema set is called once' - 1 * mockCpsModuleService.createSchemaSet(NCMP_DATASPACE_NAME, 'subscriptions', expectedYangResourceToContentMap) + 1 * mockCpsModuleService.createSchemaSet(NCMP_DATASPACE_NAME, 'cm-data-subscriptions', expectedYangResourcesToContentMap) and: 'the admin service to create an anchor set is called once' - 1 * mockCpsAdminService.createAnchor(NCMP_DATASPACE_NAME, 'subscriptions', 'AVC-Subscriptions') + 1 * mockCpsAdminService.createAnchor(NCMP_DATASPACE_NAME, 'cm-data-subscriptions', 'cm-data-subscriptions') and: 'the data service to create a top level datanode is called once' - 1 * mockCpsDataService.saveData(NCMP_DATASPACE_NAME, 'AVC-Subscriptions', '{"subscription-registry":{}}', _) + 1 * mockCpsDataService.saveData(NCMP_DATASPACE_NAME, 'cm-data-subscriptions', '{"datastores":{}}', _) } def 'Subscription model loader disabled.' () { diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/InventoryModelLoaderSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/InventoryModelLoaderSpec.groovy index 16ab0b8846..43e0f69b3f 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/InventoryModelLoaderSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/InventoryModelLoaderSpec.groovy @@ -49,7 +49,7 @@ class InventoryModelLoaderSpec extends Specification { def loggingListAppender void setup() { - expectedYangResourceToContentMap = objectUnderTest.createYangResourceToContentMap('dmi-registry@2023-08-23.yang') + expectedYangResourceToContentMap = objectUnderTest.createYangResourcesToContentMap('dmi-registry@2023-08-23.yang') logger.setLevel(Level.DEBUG) loggingListAppender = new ListAppender() logger.addAppender(loggingListAppender) @@ -58,7 +58,7 @@ class InventoryModelLoaderSpec extends Specification { } void cleanup() { - ((Logger) LoggerFactory.getLogger(SubscriptionModelLoader.class)).detachAndStopAllAppenders() + ((Logger) LoggerFactory.getLogger(CmDataSubscriptionModelLoader.class)).detachAndStopAllAppenders() applicationContext.close() } |