package org.onap.cps.integration.performance.base
+import static org.onap.cps.ncmp.api.impl.ncmppersistence.NcmpPersistence.NCMP_DATASPACE_NAME
+import static org.onap.cps.ncmp.api.impl.ncmppersistence.NcmpPersistence.NCMP_DMI_REGISTRY_ANCHOR
+
import org.onap.cps.integration.ResourceMeter
import org.onap.cps.spi.FetchDescendantsOption
def createInitialData() {
addRegistryData()
+ addRegistryDataWithAlternateIdAsPath()
addCmSubscriptionData()
}
}
}
+ def addRegistryDataWithAlternateIdAsPath() {
+ def innerNodeJsonTemplate = readResourceDataFile('ncmp-registry/innerCmHandleNode.json')
+ def batchSize = 10
+ for (def i = 0; i < TOTAL_CM_HANDLES; i += batchSize) {
+ def data = '{ "cm-handles": [' + (1..batchSize).collect {
+ innerNodeJsonTemplate.replace('CM_HANDLE_ID_HERE', (it + i).toString())
+ .replace('ALTERNATE_ID_AS_PATH', (it + i).toString())
+ }.join(',') + ']}'
+ cpsDataService.saveListElements(NCMP_DATASPACE_NAME, NCMP_DMI_REGISTRY_ANCHOR, '/dmi-registry', data, now)
+ }
+ }
+
def createCmDataSubscriptionsSchemaSet() {
def modelAsString = readResourceDataFile('cm-data-subscriptions/cm-data-subscriptions@2023-09-21.yang')
cpsModuleService.createSchemaSet(NCMP_PERFORMANCE_TEST_DATASPACE, CM_DATA_SUBSCRIPTIONS_SCHEMA_SET, [registry: modelAsString])