From d4fadc988246eb172ce8333bb3a06443591c5f19 Mon Sep 17 00:00:00 2001 From: Brinda Santh Date: Wed, 11 Dec 2019 18:32:24 -0500 Subject: [PATCH] Metadata for name, version, tags and type Mandate Tosca.meta template name, version, type and tags. Auto copy metadata from Tosca.meta to ServiceTemplate definitions. Optimize Blueprint context and runtime creation from file path. Removed attached CBA zip file in test repository dirs Issue-ID: CCSDK-1992 Signed-off-by: Brinda Santh Change-Id: I5d9d7a4599234a38d431328dbd9b74bd831e0115 --- .../baseconfiguration/TOSCA-Metadata/TOSCA.meta | 3 +- .../capability_cli/TOSCA-Metadata/TOSCA.meta | 1 + .../resource-audit/TOSCA-Metadata/TOSCA.meta | 1 + .../uat-blueprints/echo/TOSCA-Metadata/TOSCA.meta | 2 +- .../executor/ComponentRemoteAnsibleExecutorTest.kt | 2 +- .../ComponentConfigSnapshotsExecutorTest.kt | 2 +- .../executor/ComponentRemotePythonExecutorTest.kt | 15 ++- .../resolution/mock/MockDatabaseConfiguration.kt | 6 +- .../utils/ResourceAssignmentUtilsTest.kt | 13 ++- .../core/BluePrintConstants.kt | 5 + .../core/data/BluePrintModel.kt | 7 +- .../core/interfaces/BlueprintValidator.kt | 4 +- .../core/utils/BluePrintFileUtils.kt | 3 +- .../core/utils/BluePrintMetadataUtils.kt | 104 +++++++++++++++++---- .../core/service/BluePrintContextTest.kt | 17 ++-- .../core/service/BluePrintRuntimeServiceTest.kt | 47 +++++++--- .../core/service/BluePrintTemplateServiceTest.kt | 2 +- .../core/utils/BluePrintMetadataUtilsTest.kt | 26 +++--- .../resources/compile/TOSCA-Metadata/TOSCA.meta | 3 +- .../BluePrintDesignTimeValidatorService.kt | 6 +- .../BluePrintDesignTimeValidatorServiceTest.kt | 25 +++-- .../db/BlueprintProcessorCatalogServiceImplTest.kt | 25 +++-- .../MockBlueprintProcessorCatalogServiceImpl.kt | 6 +- .../commons/db-lib/src/test/resources/test-cba.zip | Bin 9554 -> 0 bytes .../api/BluePrintManagementGRPCHandlerTest.kt | 19 ++-- .../enhancer/BluePrintEnhancerServiceImplTest.kt | 18 ++-- .../designer-api/src/test/resources/test-cba.zip | Bin 9554 -> 0 bytes .../api/ExecutionServiceControllerTest.kt | 7 +- .../BluePrintRuntimeValidatorServiceTest.kt | 11 ++- .../src/test/resources/test-cba.zip | Bin 9554 -> 0 bytes 30 files changed, 257 insertions(+), 123 deletions(-) delete mode 100644 ms/blueprintsprocessor/modules/commons/db-lib/src/test/resources/test-cba.zip delete mode 100644 ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/test-cba.zip delete mode 100644 ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/test-cba.zip diff --git a/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/TOSCA-Metadata/TOSCA.meta b/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/TOSCA-Metadata/TOSCA.meta index 854c20ba2..7d3d919d5 100644 --- a/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/TOSCA-Metadata/TOSCA.meta +++ b/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/TOSCA-Metadata/TOSCA.meta @@ -2,7 +2,8 @@ TOSCA-Meta-File-Version: 1.0.0 CSAR-Version: 1.0 Created-By: Brinda Santh Entry-Definitions: Definitions/activation-blueprint.json -Template-Tags: Brinda Santh, activation-blueprint Template-Name: baseconfiguration Template-Version: 1.0.0 +Template-Type: DEFAULT +Template-Tags: Brinda Santh, activation-blueprint diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_cli/TOSCA-Metadata/TOSCA.meta b/components/model-catalog/blueprint-model/test-blueprint/capability_cli/TOSCA-Metadata/TOSCA.meta index 6c4bb36f8..178034bbc 100644 --- a/components/model-catalog/blueprint-model/test-blueprint/capability_cli/TOSCA-Metadata/TOSCA.meta +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_cli/TOSCA-Metadata/TOSCA.meta @@ -4,4 +4,5 @@ Created-By: Brinda Santh Entry-Definitions: Definitions/capability-cli-blueprint.json Template-Name: capability-cli Template-Version: 1.0.0 +Template-Type: DEFAULT Template-Tags: capability-cli-blueprint diff --git a/components/model-catalog/blueprint-model/test-blueprint/resource-audit/TOSCA-Metadata/TOSCA.meta b/components/model-catalog/blueprint-model/test-blueprint/resource-audit/TOSCA-Metadata/TOSCA.meta index d2f533cbd..ed032d5e9 100644 --- a/components/model-catalog/blueprint-model/test-blueprint/resource-audit/TOSCA-Metadata/TOSCA.meta +++ b/components/model-catalog/blueprint-model/test-blueprint/resource-audit/TOSCA-Metadata/TOSCA.meta @@ -4,4 +4,5 @@ Created-By: Brinda Santh Entry-Definitions: cba.resource.audit.ResourceAuditDefinitions.kt Template-Name: resource-audit Template-Version: 1.0.0 +Template-Type: KOTLIN_DSL Template-Tags: resource-audit \ No newline at end of file diff --git a/components/model-catalog/blueprint-model/uat-blueprints/echo/TOSCA-Metadata/TOSCA.meta b/components/model-catalog/blueprint-model/uat-blueprints/echo/TOSCA-Metadata/TOSCA.meta index 83fffa440..fe425c1c2 100644 --- a/components/model-catalog/blueprint-model/uat-blueprints/echo/TOSCA-Metadata/TOSCA.meta +++ b/components/model-catalog/blueprint-model/uat-blueprints/echo/TOSCA-Metadata/TOSCA.meta @@ -2,6 +2,6 @@ TOSCA-Meta-File-Version: 1.0.0 CSAR-Version: 1.0 Created-By: Rodrigo Ottero Entry-Definitions: Definitions/echo-test.json -Template-Name: echo-test +Template-Name: echo_test Template-Version: 1.0.0 Template-Tags: echo-test diff --git a/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutorTest.kt b/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutorTest.kt index 262563d1f..db7128394 100644 --- a/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutorTest.kt +++ b/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutorTest.kt @@ -194,7 +194,7 @@ class ComponentRemoteAnsibleExecutorTest { awxRemoteExecutor: ComponentRemoteAnsibleExecutor, executionServiceInput: ExecutionServiceInput ): BluePrintRuntimeService> { - val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime( + val bluePrintRuntimeService = BluePrintMetadataUtils.bluePrintRuntime( "123456-1000", "./../../../../components/model-catalog/blueprint-model/test-blueprint/remote_ansible" ) diff --git a/ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/ComponentConfigSnapshotsExecutorTest.kt b/ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/ComponentConfigSnapshotsExecutorTest.kt index 450da1c9f..c6166ebbc 100644 --- a/ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/ComponentConfigSnapshotsExecutorTest.kt +++ b/ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/ComponentConfigSnapshotsExecutorTest.kt @@ -55,7 +55,7 @@ class ComponentConfigSnapshotsExecutorTest { @Autowired lateinit var cfgSnapshotService: ResourceConfigSnapshotService lateinit var cfgSnapshotComponent: ComponentConfigSnapshotsExecutor - private var bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime( + private var bluePrintRuntimeService = BluePrintMetadataUtils.bluePrintRuntime( "123456-1000", "./../../../../components/model-catalog/blueprint-model/test-blueprint/remote_scripts" ) diff --git a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorTest.kt b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorTest.kt index 847b08018..3d58afad8 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorTest.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorTest.kt @@ -102,7 +102,7 @@ class ComponentRemotePythonExecutorTest { * Mocked input information for remote python executor. */ fun getMockedOutput(svc: DefaultBluePrintRuntimeService): - ExecutionServiceInput { + ExecutionServiceInput { val stepMetaData: MutableMap = hashMapOf() stepMetaData.putJsonElement( @@ -165,13 +165,12 @@ class ComponentRemotePythonExecutorTest { "ComponentRemotePythonExecutor", "process" ) } returns operationOutputs - val bluePrintRuntimeService = BluePrintMetadataUtils - .getBluePrintRuntime( - "123456-1000", - "./../../../../components/model-" + - "catalog/blueprint-model/test-blueprint/" + - "remote_scripts" - ) + val bluePrintRuntimeService = BluePrintMetadataUtils.bluePrintRuntime( + "123456-1000", + "./../../../../components/model-" + + "catalog/blueprint-model/test-blueprint/" + + "remote_scripts" + ) every { svc.resolveNodeTemplateArtifactDefinition( "execute-remote-python", "component-script" diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockDatabaseConfiguration.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockDatabaseConfiguration.kt index 774c4021a..2219f2348 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockDatabaseConfiguration.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockDatabaseConfiguration.kt @@ -15,7 +15,7 @@ */ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.mock -import io.mockk.every +import io.mockk.coEvery import io.mockk.mockk import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibGenericService import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintValidatorService @@ -38,8 +38,8 @@ open class MockBlueprintProcessorCatalogServiceImpl { @Bean(name = ["bluePrintRuntimeValidatorService"]) open fun bluePrintRuntimeValidatorService(): BluePrintValidatorService { val bluePrintValidatorService = mockk() - every { bluePrintValidatorService.validateBluePrints(any()) } returns true - every { bluePrintValidatorService.validateBluePrints(any>()) } returns true + coEvery { bluePrintValidatorService.validateBluePrints(any()) } returns true + coEvery { bluePrintValidatorService.validateBluePrints(any>()) } returns true return bluePrintValidatorService } } diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt index c564d33c6..a358f6a23 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.node.TextNode import io.mockk.every import io.mockk.spyk +import kotlinx.coroutines.runBlocking import org.junit.Before import org.junit.Test import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceAssignmentRuntimeService @@ -63,9 +64,11 @@ class ResourceAssignmentUtilsTest { @Before fun setup() { - val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext( - "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" - ) + val bluePrintContext = runBlocking { + BluePrintMetadataUtils.getBluePrintContext( + "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" + ) + } resourceAssignmentRuntimeService = spyk(ResourceAssignmentRuntimeService("1234", bluePrintContext)) @@ -94,11 +97,11 @@ class ResourceAssignmentUtilsTest { id = "ipAddress" } - var mapOfPropertiesIpAddress = mutableMapOf() + val mapOfPropertiesIpAddress = mutableMapOf() mapOfPropertiesIpAddress["port"] = propertiesDefinition1 mapOfPropertiesIpAddress["ip"] = propertiesDefinition2 - var mapOfPropertiesHost = mutableMapOf() + val mapOfPropertiesHost = mutableMapOf() mapOfPropertiesHost["name"] = propertiesDefinition3 mapOfPropertiesHost["ipAddress"] = propertiesDefinition4 diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintConstants.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintConstants.kt index 30162288c..fcc921cd9 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintConstants.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintConstants.kt @@ -59,6 +59,10 @@ object BluePrintConstants { const val DATA_TYPE_MAP: String = "map" const val DATA_TYPE_JSON: String = "json" + const val BLUEPRINT_TYPE_DEFAULT = "DEFAULT" + const val BLUEPRINT_TYPE_KOTLIN_DSL = "KOTLIN_DSL" + const val BLUEPRINT_TYPE_GENERIC_SCRIPT = "GENERIC_SCRIPT" + const val SCRIPT_KOTLIN = "kotlin" const val SCRIPT_JYTHON = "jython" const val SCRIPT_INTERNAL = "internal" @@ -183,6 +187,7 @@ object BluePrintConstants { const val METADATA_TEMPLATE_NAME = "template_name" const val METADATA_TEMPLATE_VERSION = "template_version" + const val METADATA_TEMPLATE_TYPE = "template_type" const val METADATA_TEMPLATE_AUTHOR = "template_author" const val METADATA_TEMPLATE_TAGS = "template_tags" const val METADATA_WORKFLOW_NAME = "workflow_name" diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/data/BluePrintModel.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/data/BluePrintModel.kt index 71a31dcca..67a062347 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/data/BluePrintModel.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/data/BluePrintModel.kt @@ -646,7 +646,8 @@ class ToscaMetaData { lateinit var csarVersion: String lateinit var createdBy: String lateinit var entityDefinitions: String - var templateName: String? = null - var templateVersion: String? = null - var templateTags: String? = null + lateinit var templateName: String + lateinit var templateVersion: String + lateinit var templateTags: String + var templateType: String = BluePrintConstants.BLUEPRINT_TYPE_DEFAULT } diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/interfaces/BlueprintValidator.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/interfaces/BlueprintValidator.kt index c6339f449..0d9876b81 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/interfaces/BlueprintValidator.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/interfaces/BlueprintValidator.kt @@ -61,10 +61,10 @@ interface BluePrintAttributeDefinitionValidator : BluePrintValidator): Boolean + suspend fun validateBluePrints(bluePrintRuntimeService: BluePrintRuntimeService<*>): Boolean } interface BluePrintTypeValidatorService { diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintFileUtils.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintFileUtils.kt index 9e1047389..60d26a703 100755 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintFileUtils.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintFileUtils.kt @@ -232,7 +232,8 @@ class BluePrintFileUtils { "\nCreated-By: " + "\nEntry-Definitions: Definitions/.json" + "\nTemplate-Name: " + - "\nTemplate-Tags: " + + "\nTemplate-Version: " + + "\nTemplate-Type: " + "\nTemplate-Tags: " } diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintMetadataUtils.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintMetadataUtils.kt index 4d7647f47..64be5897a 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintMetadataUtils.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintMetadataUtils.kt @@ -20,8 +20,10 @@ package org.onap.ccsdk.cds.controllerblueprints.core.utils import com.fasterxml.jackson.databind.JsonNode import kotlinx.coroutines.runBlocking import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty +import org.onap.ccsdk.cds.controllerblueprints.core.data.ServiceTemplate import org.onap.ccsdk.cds.controllerblueprints.core.data.ToscaMetaData import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintDefinitions import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile @@ -91,6 +93,7 @@ class BluePrintMetadataUtils { "Template-Name" -> toscaMetaData.templateName = value "Template-Version" -> toscaMetaData.templateVersion = value "Template-Tags" -> toscaMetaData.templateTags = value + "Template-Type" -> toscaMetaData.templateType = value } } } @@ -98,37 +101,58 @@ class BluePrintMetadataUtils { return toscaMetaData } - fun getBluePrintRuntime(id: String, blueprintBasePath: String): - BluePrintRuntimeService> { + /** Get the default blueprint runtime for [id] and [blueprintBasePath] */ + suspend fun getBluePrintRuntime(id: String, blueprintBasePath: String): + BluePrintRuntimeService> { val bluePrintContext: BluePrintContext = getBluePrintContext(blueprintBasePath) return getBluePrintRuntime(id, bluePrintContext) } + /** Get the default blocking blueprint runtime api for [id] and [blueprintBasePath] used in testing */ + fun bluePrintRuntime(id: String, blueprintBasePath: String): + BluePrintRuntimeService> = runBlocking { + val bluePrintContext: BluePrintContext = getBluePrintContext(blueprintBasePath) + getBluePrintRuntime(id, bluePrintContext) + } + + /** Get the default blueprint runtime from [bluePrintContext] */ fun getBluePrintRuntime(id: String, bluePrintContext: BluePrintContext): - BluePrintRuntimeService> { + BluePrintRuntimeService> { checkNotEmpty(bluePrintContext.rootPath) { "blueprint context root path is missing." } checkNotEmpty(bluePrintContext.entryDefinition) { "blueprint context entry definition is missing." } val blueprintBasePath = bluePrintContext.rootPath val bluePrintRuntimeService = DefaultBluePrintRuntimeService(id, bluePrintContext) - bluePrintRuntimeService.put(BluePrintConstants.PROPERTY_BLUEPRINT_BASE_PATH, blueprintBasePath.asJsonPrimitive()) + bluePrintRuntimeService.put( + BluePrintConstants.PROPERTY_BLUEPRINT_BASE_PATH, + blueprintBasePath.asJsonPrimitive() + ) bluePrintRuntimeService.put(BluePrintConstants.PROPERTY_BLUEPRINT_PROCESS_ID, id.asJsonPrimitive()) return bluePrintRuntimeService } + /** Get the blueprint runtime for enhancement start for [id] and [blueprintBasePath] */ suspend fun getBaseEnhancementBluePrintRuntime(id: String, blueprintBasePath: String): - BluePrintRuntimeService> { + BluePrintRuntimeService> { val bluePrintContext: BluePrintContext = getBaseEnhancementBluePrintContext(blueprintBasePath) val bluePrintRuntimeService = DefaultBluePrintRuntimeService(id, bluePrintContext) - bluePrintRuntimeService.put(BluePrintConstants.PROPERTY_BLUEPRINT_BASE_PATH, blueprintBasePath.asJsonPrimitive()) + bluePrintRuntimeService.put( + BluePrintConstants.PROPERTY_BLUEPRINT_BASE_PATH, + blueprintBasePath.asJsonPrimitive() + ) bluePrintRuntimeService.put(BluePrintConstants.PROPERTY_BLUEPRINT_PROCESS_ID, id.asJsonPrimitive()) return bluePrintRuntimeService } - fun getBluePrintRuntime(id: String, blueprintBasePath: String, executionContext: MutableMap): - BluePrintRuntimeService> { + /** Get the default blueprint runtime for enhancement start for [id], [blueprintBasePath] and [executionContext] */ + suspend fun getBluePrintRuntime( + id: String, + blueprintBasePath: String, + executionContext: MutableMap + ): + BluePrintRuntimeService> { val bluePrintContext: BluePrintContext = getBluePrintContext(blueprintBasePath) val bluePrintRuntimeService = DefaultBluePrintRuntimeService(id, bluePrintContext) executionContext.forEach { @@ -139,27 +163,55 @@ class BluePrintMetadataUtils { return bluePrintRuntimeService } - fun getBluePrintContext(blueprintBasePath: String): BluePrintContext = runBlocking { + /** Get the default blueprint context for [blueprintBasePath]*/ + suspend fun getBluePrintContext(blueprintBasePath: String): BluePrintContext { val toscaMetaData: ToscaMetaData = toscaMetaData(blueprintBasePath) - log.info("Reading blueprint path($blueprintBasePath) and entry definition file (${toscaMetaData.entityDefinitions})") + log.info( + "Reading blueprint type(${toscaMetaData.templateType}) path($blueprintBasePath) " + + "and entry definition file (${toscaMetaData.entityDefinitions})" + ) // If the EntryDefinition is Kotlin file, compile and get Service Template - if (toscaMetaData.entityDefinitions.endsWith("kt")) { - readBlueprintKotlinFile(toscaMetaData, blueprintBasePath) - } else { - readBlueprintFile(toscaMetaData.entityDefinitions, blueprintBasePath) + val bluePrintContext = when (toscaMetaData.templateType.toUpperCase()) { + BluePrintConstants.BLUEPRINT_TYPE_KOTLIN_DSL -> readBlueprintKotlinFile( + toscaMetaData, + blueprintBasePath + ) + BluePrintConstants.BLUEPRINT_TYPE_GENERIC_SCRIPT -> readBlueprintGenericScript( + toscaMetaData, + blueprintBasePath + ) + BluePrintConstants.BLUEPRINT_TYPE_DEFAULT -> readBlueprintFile( + toscaMetaData.entityDefinitions, + blueprintBasePath + ) + else -> + throw BluePrintException( + "Unknown blueprint type(${toscaMetaData.templateType}), " + + "It should be any one of these types[${BluePrintConstants.BLUEPRINT_TYPE_KOTLIN_DSL}," + + "${BluePrintConstants.BLUEPRINT_TYPE_GENERIC_SCRIPT}, " + + "${BluePrintConstants.BLUEPRINT_TYPE_DEFAULT}]" + ) } + // Copy the metadata info + copyMetaInfoToServiceTemplate(toscaMetaData, bluePrintContext.serviceTemplate) + + return bluePrintContext } private suspend fun getBaseEnhancementBluePrintContext(blueprintBasePath: String): BluePrintContext { val toscaMetaData: ToscaMetaData = toscaMetaData(blueprintBasePath) + // Clean Type files BluePrintFileUtils.deleteBluePrintTypes(blueprintBasePath) val rootFilePath: String = blueprintBasePath.plus(File.separator).plus(toscaMetaData.entityDefinitions) val rootServiceTemplate = ServiceTemplateUtils.getServiceTemplate(rootFilePath) + // Copy the metadata info + copyMetaInfoToServiceTemplate(toscaMetaData, rootServiceTemplate) + // Clean the Import Definitions BluePrintFileUtils.cleanImportTypes(rootServiceTemplate) @@ -169,10 +221,22 @@ class BluePrintMetadataUtils { return blueprintContext } + /** copy metadata defined in [toscaMetaData] to [serviceTemplate] */ + private fun copyMetaInfoToServiceTemplate(toscaMetaData: ToscaMetaData, serviceTemplate: ServiceTemplate) { + if (serviceTemplate.metadata == null) serviceTemplate.metadata = mutableMapOf() + val metadata = serviceTemplate.metadata!! + metadata[BluePrintConstants.METADATA_TEMPLATE_AUTHOR] = toscaMetaData.createdBy + metadata[BluePrintConstants.METADATA_TEMPLATE_NAME] = toscaMetaData.templateName + metadata[BluePrintConstants.METADATA_TEMPLATE_VERSION] = toscaMetaData.templateVersion + metadata[BluePrintConstants.METADATA_TEMPLATE_TAGS] = toscaMetaData.templateTags + metadata[BluePrintConstants.METADATA_TEMPLATE_TYPE] = toscaMetaData.templateType + } + private suspend fun readBlueprintFile(entityDefinitions: String, basePath: String): BluePrintContext { val normalizedBasePath = normalizedPathName(basePath) val rootFilePath = normalizedPathName(normalizedBasePath, entityDefinitions) val rootServiceTemplate = ServiceTemplateUtils.getServiceTemplate(rootFilePath) + // Recursively Import Template files val schemaImportResolverUtils = BluePrintImportService(rootServiceTemplate, normalizedBasePath) val completeServiceTemplate = schemaImportResolverUtils.getImportResolvedServiceTemplate() @@ -185,17 +249,14 @@ class BluePrintMetadataUtils { /** Reade the Service Template Definitions from the Kotlin file */ private suspend fun readBlueprintKotlinFile(toscaMetaData: ToscaMetaData, basePath: String): BluePrintContext { - checkNotNull(toscaMetaData.templateName) { "couldn't find 'Template-Name' key in TOSCA.meta" } - checkNotNull(toscaMetaData.templateVersion) { "couldn't find 'Template-Version' key in TOSCA.meta" } - val definitionClassName = toscaMetaData.entityDefinitions.removeSuffix(".kt") val normalizedBasePath = normalizedPathName(basePath) val bluePrintScriptsService = BluePrintScriptsServiceImpl() val bluePrintDefinitions = bluePrintScriptsService .scriptInstance( - normalizedBasePath, toscaMetaData.templateName!!, - toscaMetaData.templateVersion!!, definitionClassName, false + normalizedBasePath, toscaMetaData.templateName, + toscaMetaData.templateVersion, definitionClassName, false ) // Get the Service Template val serviceTemplate = bluePrintDefinitions.serviceTemplate() @@ -209,5 +270,10 @@ class BluePrintMetadataUtils { blueprintContext.otherDefinitions = bluePrintDefinitions.otherDefinitions() return blueprintContext } + + /** Reade the Service Template Definitions from the generic script types */ + private fun readBlueprintGenericScript(toscaMetaData: ToscaMetaData, basePath: String): BluePrintContext { + return BluePrintContext(ServiceTemplate()) + } } } diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintContextTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintContextTest.kt index 597194c29..38f6ea2ec 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintContextTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintContextTest.kt @@ -18,6 +18,7 @@ package org.onap.ccsdk.cds.controllerblueprints.core.service import com.fasterxml.jackson.databind.ObjectMapper +import kotlinx.coroutines.runBlocking import org.junit.Test import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException @@ -58,16 +59,20 @@ class BluePrintContextTest { @Test fun testBluePrintContextCreation() { - val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext(blueprintBasePath) - assertNotNull(bluePrintContext, "Failed to populate Blueprint context") + runBlocking { + val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext(blueprintBasePath) + assertNotNull(bluePrintContext, "Failed to populate Blueprint context") + } } @Test fun testChainedProperty() { - val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext(blueprintBasePath) - val nodeType = bluePrintContext.nodeTypeChained("component-resource-resolution") - assertNotNull(nodeType, "Failed to get chained node type") - log.trace("Properties {}", JacksonUtils.getJson(nodeType, true)) + runBlocking { + val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext(blueprintBasePath) + val nodeType = bluePrintContext.nodeTypeChained("component-resource-resolution") + assertNotNull(nodeType, "Failed to get chained node type") + log.trace("Properties {}", JacksonUtils.getJson(nodeType, true)) + } } @Test diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt index dea46224d..b079d42aa 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt @@ -70,9 +70,9 @@ class BluePrintRuntimeServiceTest { ) val assignmentParams = "{\n" + - " \"ipAddress\": \"127.0.0.1\",\n" + - " \"hostName\": \"vnf-host\"\n" + - " }" + " \"ipAddress\": \"127.0.0.1\",\n" + + " \"hostName\": \"vnf-host\"\n" + + " }" bluePrintRuntimeService.setNodeTemplateAttributeValue( "resource-assignment", "assignment-params", @@ -84,8 +84,16 @@ class BluePrintRuntimeServiceTest { "netconf" ) assertNotNull(capProperties, "Failed to populate capability property values") - assertEquals(capProperties["target-ip-address"], "127.0.0.1".asJsonPrimitive(), "Failed to populate parameter target-ip-address") - assertEquals(capProperties["port-number"], JacksonUtils.jsonNodeFromObject(830), "Failed to populate parameter port-number") + assertEquals( + capProperties["target-ip-address"], + "127.0.0.1".asJsonPrimitive(), + "Failed to populate parameter target-ip-address" + ) + assertEquals( + capProperties["port-number"], + JacksonUtils.jsonNodeFromObject(830), + "Failed to populate parameter port-number" + ) } @Test @@ -108,8 +116,16 @@ class BluePrintRuntimeServiceTest { ) assertNotNull(inContext, "Failed to populate interface input property values") - assertEquals(inContext["action-name"], JacksonUtils.jsonNodeFromObject("sample-action"), "Failed to populate parameter action-name") - assertEquals(inContext["request-id"], JacksonUtils.jsonNodeFromObject("12345"), "Failed to populate parameter action-name") + assertEquals( + inContext["action-name"], + JacksonUtils.jsonNodeFromObject("sample-action"), + "Failed to populate parameter action-name" + ) + assertEquals( + inContext["request-id"], + JacksonUtils.jsonNodeFromObject("12345"), + "Failed to populate parameter action-name" + ) } @Test @@ -118,7 +134,11 @@ class BluePrintRuntimeServiceTest { val bluePrintRuntimeService = getBluePrintRuntimeService() - bluePrintRuntimeService.setNodeTemplateAttributeValue("resource-assignment", "assignment-params", NullNode.getInstance()) + bluePrintRuntimeService.setNodeTemplateAttributeValue( + "resource-assignment", + "assignment-params", + NullNode.getInstance() + ) bluePrintRuntimeService.resolveNodeTemplateInterfaceOperationOutputs( "resource-assignment", @@ -135,7 +155,11 @@ class BluePrintRuntimeServiceTest { "resource-assignment", "ResourceResolutionComponent", "process", "resource-assignment-params" ) - assertEquals(NullNode.getInstance(), outputParams, "Failed to get operation property resource-assignment-params") + assertEquals( + NullNode.getInstance(), + outputParams, + "Failed to get operation property resource-assignment-params" + ) } @Test @@ -154,7 +178,8 @@ class BluePrintRuntimeServiceTest { val keys = listOf("context1", "context2") - val jsonValueNode = bluePrintRuntimeService.getJsonForNodeTemplateAttributeProperties("resource-assignment-ra-component", keys) + val jsonValueNode = + bluePrintRuntimeService.getJsonForNodeTemplateAttributeProperties("resource-assignment-ra-component", keys) assertNotNull(jsonValueNode, "Failed to get Json for Node Template Context Properties") log.info("JSON Prepared Value Context {}", jsonValueNode) } @@ -189,7 +214,7 @@ class BluePrintRuntimeServiceTest { private fun getBluePrintRuntimeService(): BluePrintRuntimeService> { val blueprintBasePath = normalizedPathName(TestConstants.PATH_TEST_BLUEPRINTS_BASECONFIG) - val blueprintRuntime = BluePrintMetadataUtils.getBluePrintRuntime("1234", blueprintBasePath) + val blueprintRuntime = BluePrintMetadataUtils.bluePrintRuntime("1234", blueprintBasePath) val checkProcessId = blueprintRuntime.get(BluePrintConstants.PROPERTY_BLUEPRINT_PROCESS_ID) val checkBasePath = blueprintRuntime.get(BluePrintConstants.PROPERTY_BLUEPRINT_BASE_PATH) diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateServiceTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateServiceTest.kt index e525bfc27..0e93ccf6b 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateServiceTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateServiceTest.kt @@ -34,7 +34,7 @@ class BluePrintTemplateServiceTest { @BeforeTest fun setup() { val blueprintBasePath = TestConstants.PATH_TEST_BLUEPRINTS_BASECONFIG - blueprintRuntime = BluePrintMetadataUtils.getBluePrintRuntime("1234", blueprintBasePath) + blueprintRuntime = BluePrintMetadataUtils.bluePrintRuntime("1234", blueprintBasePath) } @Test diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintMetadataUtilsTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintMetadataUtilsTest.kt index 302daf67e..6ccfe1e95 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintMetadataUtilsTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintMetadataUtilsTest.kt @@ -48,20 +48,22 @@ class BluePrintMetadataUtilsTest { @Test fun testKotlinBluePrintContext() { - val path = normalizedPathName("src/test/resources/compile") - val blueprintContext = BluePrintMetadataUtils.getBluePrintContext(path) - assertNotNull(blueprintContext, "failed to get blueprint context") - assertNotNull(blueprintContext.serviceTemplate, "failed to get blueprint context service template") - assertNotNull(blueprintContext.serviceTemplate, "failed to get blueprint context service template") - assertNotNull(blueprintContext.otherDefinitions, "failed to get blueprint contextother definitions") + runBlocking { + val path = normalizedPathName("src/test/resources/compile") + val blueprintContext = BluePrintMetadataUtils.getBluePrintContext(path) + assertNotNull(blueprintContext, "failed to get blueprint context") + assertNotNull(blueprintContext.serviceTemplate, "failed to get blueprint context service template") + assertNotNull(blueprintContext.serviceTemplate, "failed to get blueprint context service template") + assertNotNull(blueprintContext.otherDefinitions, "failed to get blueprint contextother definitions") - var cachePresent = BluePrintCompileCache.hasClassLoader(path) - assertTrue(cachePresent, "failed to generate cache key ($path)") + var cachePresent = BluePrintCompileCache.hasClassLoader(path) + assertTrue(cachePresent, "failed to generate cache key ($path)") - /** Cleaning Cache */ - BluePrintCompileCache.cleanClassLoader(path) - cachePresent = BluePrintCompileCache.hasClassLoader(path) - assertTrue(!cachePresent, "failed to remove cache key ($path)") + /** Cleaning Cache */ + BluePrintCompileCache.cleanClassLoader(path) + cachePresent = BluePrintCompileCache.hasClassLoader(path) + assertTrue(!cachePresent, "failed to remove cache key ($path)") + } } @Test diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/resources/compile/TOSCA-Metadata/TOSCA.meta b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/resources/compile/TOSCA-Metadata/TOSCA.meta index b1ffabd13..d139c2db8 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/resources/compile/TOSCA-Metadata/TOSCA.meta +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/resources/compile/TOSCA-Metadata/TOSCA.meta @@ -2,6 +2,7 @@ TOSCA-Meta-File-Version: 1.0.0 CSAR-Version: 1.0 Created-By: Brinda Santh Entry-Definitions: cba.scripts.ActivateBlueprintDefinitions.kt -Template-Tags: Brinda Santh, activation-blueprint Template-Name: activate-blueprint Template-Version: 1.0.0 +Template-Type: KOTLIN_DSL +Template-Tags: Brinda Santh, activation-blueprint diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BluePrintDesignTimeValidatorService.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BluePrintDesignTimeValidatorService.kt index 5df2decdb..67bdd0396 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BluePrintDesignTimeValidatorService.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BluePrintDesignTimeValidatorService.kt @@ -41,13 +41,13 @@ open class BluePrintDesignTimeValidatorService( private val log = LoggerFactory.getLogger(BluePrintDesignTimeValidatorService::class.toString()) - override fun validateBluePrints(basePath: String): Boolean { + override suspend fun validateBluePrints(basePath: String): Boolean { val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(UUID.randomUUID().toString(), basePath) return validateBluePrints(bluePrintRuntimeService) } - override fun validateBluePrints(bluePrintRuntimeService: BluePrintRuntimeService<*>): Boolean { + override suspend fun validateBluePrints(bluePrintRuntimeService: BluePrintRuntimeService<*>): Boolean { bluePrintTypeValidatorService.validateServiceTemplate( bluePrintRuntimeService, "service_template", @@ -76,7 +76,7 @@ open class BluePrintDesignTimeValidatorService( if (resourceDefinitionFile.exists()) { val resourceDefinitionMap = JacksonUtils.getMapFromFile(resourceDefinitionFile, ResourceDefinition::class.java) - resourceDefinitionMap?.forEach { resourceDefinitionName, resourceDefinition -> + resourceDefinitionMap.forEach { resourceDefinitionName, resourceDefinition -> resourceDefinitionValidator.validate(bluePrintRuntimeService, resourceDefinitionName, resourceDefinition) } } diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BluePrintDesignTimeValidatorServiceTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BluePrintDesignTimeValidatorServiceTest.kt index 19d1ef0a4..dcf352927 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BluePrintDesignTimeValidatorServiceTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BluePrintDesignTimeValidatorServiceTest.kt @@ -19,6 +19,7 @@ package org.onap.ccsdk.cds.controllerblueprints.validation import io.mockk.every import io.mockk.mockk +import kotlinx.coroutines.runBlocking import org.junit.Test import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintError import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeTemplate @@ -35,18 +36,21 @@ import kotlin.test.assertTrue class BluePrintDesignTimeValidatorServiceTest { private val blueprintBasePath = "./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" - private val bluePrintRuntime = BluePrintMetadataUtils.getBluePrintRuntime("1234", blueprintBasePath) + private val bluePrintRuntime = BluePrintMetadataUtils.bluePrintRuntime("1234", blueprintBasePath) private val mockBluePrintTypeValidatorService = MockBluePrintTypeValidatorService() private val resourceDefinitionValidator = mockk() - private val defaultBluePrintValidatorService = BluePrintDesignTimeValidatorService(mockBluePrintTypeValidatorService, resourceDefinitionValidator) + private val defaultBluePrintValidatorService = + BluePrintDesignTimeValidatorService(mockBluePrintTypeValidatorService, resourceDefinitionValidator) private val workflowValidator = BluePrintWorkflowValidatorImpl(mockBluePrintTypeValidatorService) @Test fun testValidateOfType() { - every { resourceDefinitionValidator.validate(bluePrintRuntime, any(), any()) } returns Unit + runBlocking { + every { resourceDefinitionValidator.validate(bluePrintRuntime, any(), any()) } returns Unit - val valid = defaultBluePrintValidatorService.validateBluePrints(bluePrintRuntime) - assertTrue(valid, "failed in blueprint Validation") + val valid = defaultBluePrintValidatorService.validateBluePrints(bluePrintRuntime) + assertTrue(valid, "failed in blueprint Validation") + } } @Test @@ -95,14 +99,19 @@ class BluePrintDesignTimeValidatorServiceTest { assertEquals(1, bluePrintRuntime.getBluePrintError().errors.size) assertEquals( "Failed to validate Workflow(resource-assignment)'s step(test)'s definition : " + - "resource-assignment/steps/test : NodeType(TestNodeType) derived from is 'tosca.nodes.TEST', " + - "Expected 'tosca.nodes.Workflow' or 'tosca.nodes.Component'", bluePrintRuntime.getBluePrintError().errors[0] + "resource-assignment/steps/test : NodeType(TestNodeType) derived from is 'tosca.nodes.TEST', " + + "Expected 'tosca.nodes.Workflow' or 'tosca.nodes.Component'", + bluePrintRuntime.getBluePrintError().errors[0] ) } @Test fun testValidateWorkflowSuccess() { val workflowName = "resource-assignment" - workflowValidator.validate(bluePrintRuntime, workflowName, bluePrintRuntime.bluePrintContext().workflowByName(workflowName)) + workflowValidator.validate( + bluePrintRuntime, + workflowName, + bluePrintRuntime.bluePrintContext().workflowByName(workflowName) + ) } } diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BlueprintProcessorCatalogServiceImplTest.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BlueprintProcessorCatalogServiceImplTest.kt index e86dfab72..5d546c2ef 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BlueprintProcessorCatalogServiceImplTest.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BlueprintProcessorCatalogServiceImplTest.kt @@ -25,6 +25,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.db.mock.MockBlueprintProcessorCata import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.service.BlueprintCatalogServiceImpl import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.service.BlueprintProcessorCatalogServiceImpl import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.compress import org.onap.ccsdk.cds.controllerblueprints.core.deleteDir import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService @@ -62,8 +63,14 @@ class BlueprintProcessorCatalogServiceImplTest { @BeforeTest fun setup() { + deleteDir("target", "blueprints") - bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime( + + // Create sample CBA zip + normalizedFile("./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration") + .compress(normalizedFile("./target/blueprints/generated-cba.zip")) + + bluePrintRuntimeService = BluePrintMetadataUtils.bluePrintRuntime( blueprintId, "./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) @@ -76,11 +83,9 @@ class BlueprintProcessorCatalogServiceImplTest { @Test fun `test catalog service`() { - // TODO: I thing this test function should be remve and replace by the other one. - runBlocking { - // FIXME("Create ZIP from test blueprints") - val file = normalizedFile("./src/test/resources/test-cba.zip") + runBlocking { + val file = normalizedFile("./target/blueprints/generated-cba.zip") assertTrue(file.exists(), "couldn't get file ${file.absolutePath}") blueprintsProcessorCatalogService.saveToDatabase("1234", file) @@ -93,7 +98,7 @@ class BlueprintProcessorCatalogServiceImplTest { @Test fun `test save function`() { runBlocking { - val file = normalizedFile("./src/test/resources/test-cba.zip") + val file = normalizedFile("./target/blueprints/generated-cba.zip") assertTrue(file.exists(), "couldnt get file ${file.absolutePath}") val metadata = bluePrintRuntimeService.bluePrintContext().metadata!! metadata[BluePrintConstants.PROPERTY_BLUEPRINT_PROCESS_ID] = blueprintId @@ -105,7 +110,7 @@ class BlueprintProcessorCatalogServiceImplTest { @Test fun `test get function`() { runBlocking { - val file = normalizedFile("./src/test/resources/test-cba.zip") + val file = normalizedFile("./target/blueprints/generated-cba.zip") assertTrue(file.exists(), "couldnt get file ${file.absolutePath}") val metadata = bluePrintRuntimeService.bluePrintContext().metadata!! metadata[BluePrintConstants.PROPERTY_BLUEPRINT_PROCESS_ID] = blueprintId @@ -117,10 +122,10 @@ class BlueprintProcessorCatalogServiceImplTest { assertTrue( File( blueprintCoreConfiguration.bluePrintLoadConfiguration().blueprintArchivePath + - "/baseconfiguration" + "/baseconfiguration" ).deleteRecursively(), "Couldn't get blueprint archive " + - "${blueprintCoreConfiguration.bluePrintLoadConfiguration().blueprintArchivePath}/baseconfiguration " + - "from data base." + "${blueprintCoreConfiguration.bluePrintLoadConfiguration().blueprintArchivePath}/baseconfiguration " + + "from data base." ) } diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/mock/MockBlueprintProcessorCatalogServiceImpl.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/mock/MockBlueprintProcessorCatalogServiceImpl.kt index 8dcf42668..248181f16 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/mock/MockBlueprintProcessorCatalogServiceImpl.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/mock/MockBlueprintProcessorCatalogServiceImpl.kt @@ -15,7 +15,7 @@ */ package org.onap.ccsdk.cds.blueprintsprocessor.db.mock -import io.mockk.every +import io.mockk.coEvery import io.mockk.mockk import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintValidatorService import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService @@ -28,8 +28,8 @@ open class MockBlueprintProcessorCatalogServiceImpl { @Bean(name = ["bluePrintRuntimeValidatorService"]) open fun bluePrintRuntimeValidatorService(): BluePrintValidatorService { val bluePrintValidatorService = mockk() - every { bluePrintValidatorService.validateBluePrints(any()) } returns true - every { bluePrintValidatorService.validateBluePrints(any>()) } returns true + coEvery { bluePrintValidatorService.validateBluePrints(any()) } returns true + coEvery { bluePrintValidatorService.validateBluePrints(any>()) } returns true return bluePrintValidatorService } } diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/test/resources/test-cba.zip b/ms/blueprintsprocessor/modules/commons/db-lib/src/test/resources/test-cba.zip deleted file mode 100644 index 785ec6c00a26d4097cfe6abaeda335405c31a3f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9554 zcmbVx1yoe)_x8{@bT>$dv>+XVbPwG*q=Z8a(jp~|v@}R}mx3rIQc5Y^AkrO@-*CMF zdVhNV-^@A;XU&@DdC$A|yW`o)@(74Pz~#%*z#a6*KY#wg0+0jLmDI#VSryHpU^6fj zd`Cn51^^*iCQ1LqI$7V@6%7D~xDN*aAmYP*q6`DN{6zf&NU=!Lu@H6#5Br+rXP`fD z*&f1he+Bt4>@{W!J38{AkR;_3MD2z+cs;oOpvi|Ah&iBG;_Rk-vz8gS$s(&8Jxv92 z8nk|6x`8YH96Cw?`YQp3L4}OZV$$)1>LVWLMcf@C?k1^E-9umu_ zrx6Fok%%KxBU(1Nn4f1DddM803Bz4J{J-xaGVI}%ZNU(y|HI~e+oq&Rg9iYNkpKY3 zzke^T1d@`KHc~ZrvU7GcH5YYqva*CcG>1TqIM~=>Z`X&mzuL?=wNA&u``E8fm`N$H z)perrFqNA@ah>o?VTz-e)E(RTtV-0qK{}24M^umf?qqS}z5}UB_K9}yd6XI5SrG}% z#C(fYulxxV>S;bZti-pT+8FWm0Qu?el9NnMd**!z1@lamCV_QBs7+E{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O%aTZjxEigEr)S+>92*i+q zus#fJLHZ~I&&ai3Fb{bX{ywUwsK8_=JUi|Su3}f>H0z*7>#oQLqAq|XdSoJwsJ4{0 z?r?^EnMAHK=|a*n=P4v#%TZ5NQ-s)raUh=S{&HRK;0~Hl*4q$w+>0dD7**@f9PnO? zJDVEKZz3=ZPreaK4EHtiOw47{I?bnfOMxgbq6Q?6W}78();^>~lN8JkoI17De0ngg zl_f$(Mfpy_^v1oVAdFf$a`sUHX=gqvg#9+{O54>a98Hl0ybE}H)C=Je6bpR609PQ* zE85W8EjOV$bvB)$^8%7~h`{U>5}^c@~$C5`vZEHB(Vlm^9^tSc3yk?zdm z88Pgjj8cN*CG%c@jr|X8GrlTre}D^5JZVT?KS#RWDCsBEO29%M;PPVrA?7*$IT&;@ zGP8n(KRXB*>h@#t@;_#`9zdX%vOF9-CBnb=##jJi7~$m$8?Y{V`T5ge80q_9_@|-p zCFnm*+V!#UcTiYW49ND8{TcM?koZ^d|GsAAYipK*vHUfL{T0?fOT9jXy}Hz=e`Ecp zk?en?yFT)|N*4$-_V=a#CH`F>fc-c8>$3V)d_P!A@*V&8BKv>ix~^kh<$8?vBiHX# z&0jJ8yWvr<8NLJ)a77sUzoX&(jdtm!n^(}TiA28w{>P`TOGH;UMhG_P{7b+3wP5rs zrhnfM;NOpMd3s&2VW;#= z_(52KAzt=kzlk{4WtFQ7_xJ(vUqzPRFZ*Zl;3~;6tgF1L2VL2p>r%q6i2gCdbs6C* zkq+Kzm&Arfp-0|4N`-kc}^zzxdFyZ;AbRrzNC diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt index 582fd9a41..35e440554 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt @@ -30,6 +30,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.TokenAuthGrpcClientSe import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.compress import org.onap.ccsdk.cds.controllerblueprints.core.deleteDir import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile import org.onap.ccsdk.cds.controllerblueprints.management.api.BluePrintBootstrapInput @@ -66,9 +67,15 @@ class BluePrintManagementGRPCHandlerTest { @BeforeTest fun init() { + + deleteDir("target", "blueprints") + + // Create sample CBA zip + normalizedFile("./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration") + .compress(normalizedFile("./target/blueprints/generated-cba.zip")) + // Create a server, add service, start, and register for automatic graceful shutdown. grpcServerRule.serviceRegistry.addService(bluePrintManagementGRPCHandler) - deleteDir("target", "blueprints") } @AfterTest @@ -84,7 +91,7 @@ class BluePrintManagementGRPCHandlerTest { val bootstrapOutput = blockingStub.bootstrapBlueprint(req) assertEquals(200, bootstrapOutput.status.code) assertTrue( - bootstrapOutput.status.message.contentEquals(BluePrintConstants.STATUS_SUCCESS), + bootstrapOutput.status.message!!.contentEquals(BluePrintConstants.STATUS_SUCCESS), "failed to get success status" ) assertEquals(id, bootstrapOutput.commonHeader.requestId) @@ -99,7 +106,7 @@ class BluePrintManagementGRPCHandlerTest { assertEquals(200, output.status.code) assertTrue( - output.status.message.contentEquals(BluePrintConstants.STATUS_SUCCESS), + output.status.message!!.contentEquals(BluePrintConstants.STATUS_SUCCESS), "failed to get success status" ) assertEquals(id, output.commonHeader.requestId) @@ -110,7 +117,7 @@ class BluePrintManagementGRPCHandlerTest { val downloadOutput = blockingStub.downloadBlueprint(downloadReq) assertEquals(200, downloadOutput.status.code) assertTrue( - downloadOutput.status.message.contentEquals(BluePrintConstants.STATUS_SUCCESS), + downloadOutput.status.message!!.contentEquals(BluePrintConstants.STATUS_SUCCESS), "failed to get success status" ) assertNotNull(downloadOutput.fileChunk?.chunk, "failed to get cba file chunks") @@ -126,7 +133,7 @@ class BluePrintManagementGRPCHandlerTest { var output = blockingStub.uploadBlueprint(req) assertEquals(200, output.status.code) assertTrue( - output.status.message.contentEquals(BluePrintConstants.STATUS_SUCCESS), + output.status.message!!.contentEquals(BluePrintConstants.STATUS_SUCCESS), "failed to get success status" ) assertEquals(id, output.commonHeader.requestId) @@ -174,7 +181,7 @@ class BluePrintManagementGRPCHandlerTest { } private fun createUploadInputRequest(id: String, action: String): BluePrintUploadInput { - val file = normalizedFile("./src/test/resources/test-cba.zip") + val file = normalizedFile("./target/blueprints/generated-cba.zip") assertTrue(file.exists(), "couldnt get file ${file.absolutePath}") val commonHeader = CommonHeader diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintEnhancerServiceImplTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintEnhancerServiceImplTest.kt index 2762725fa..a866dcad3 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintEnhancerServiceImplTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintEnhancerServiceImplTest.kt @@ -65,34 +65,28 @@ class BluePrintEnhancerServiceImplTest { resourceDictionaryLoadService.loadPathsResourceDictionary(dictPaths) testBaseConfigEnhancementAndValidation() - testVFWEnhancementAndValidation() testGoldenEnhancementAndValidation() testRemoteScriptsEnhancementAndValidation() testCapabilityCliEnhancementAndValidation() } } - fun testBaseConfigEnhancementAndValidation() { + private fun testBaseConfigEnhancementAndValidation() { val basePath = "./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" testComponentInvokeEnhancementAndValidation(basePath, "base-enhance") } - fun testVFWEnhancementAndValidation() { - val basePath = "./../../../../../components/model-catalog/blueprint-model/service-blueprint/vFW" - testComponentInvokeEnhancementAndValidation(basePath, "vFW-enhance") - } - - fun testGoldenEnhancementAndValidation() { + private fun testGoldenEnhancementAndValidation() { val basePath = "./../../../../../components/model-catalog/blueprint-model/test-blueprint/golden" testComponentInvokeEnhancementAndValidation(basePath, "golden-enhance") } - fun testRemoteScriptsEnhancementAndValidation() { + private fun testRemoteScriptsEnhancementAndValidation() { val basePath = "./../../../../../components/model-catalog/blueprint-model/test-blueprint/remote_scripts" testComponentInvokeEnhancementAndValidation(basePath, "remote_scripts-enhance") } - fun testCapabilityCliEnhancementAndValidation() { + private fun testCapabilityCliEnhancementAndValidation() { val basePath = "./../../../../../components/model-catalog/blueprint-model/test-blueprint/capability_cli" testComponentInvokeEnhancementAndValidation(basePath, "capability_cli-enhance") } @@ -111,8 +105,8 @@ class BluePrintEnhancerServiceImplTest { Assert.assertTrue("blueprint($basePath) validation failed ", valid) // Enable this to get the enhanced zip file - // val compressFile = normalizedFile("target/blueprints/enrichment", "$targetDirName.zip") - // normalizedFile(targetPath).compress(compressFile) + // val compressFile = normalizedFile("target/blueprints/enrichment", "$targetDirName.zip") + // normalizedFile(targetPath).compress(compressFile) deleteDir(targetPath) } diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/test-cba.zip b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/test-cba.zip deleted file mode 100644 index 785ec6c00a26d4097cfe6abaeda335405c31a3f6..0000000000000000000000000000000000000000 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X%vOF9-CBnb=##jJi7~$m$8?Y{V`T5ge80q_9_@|-p zCFnm*+V!#UcTiYW49ND8{TcM?koZ^d|GsAAYipK*vHUfL{T0?fOT9jXy}Hz=e`Ecp zk?en?yFT)|N*4$-_V=a#CH`F>fc-c8>$3V)d_P!A@*V&8BKv>ix~^kh<$8?vBiHX# z&0jJ8yWvr<8NLJ)a77sUzoX&(jdtm!n^(}TiA28w{>P`TOGH;UMhG_P{7b+3wP5rs zrhnfM;NOpMd3s&2VW;#= z_(52KAzt=kzlk{4WtFQ7_xJ(vUqzPRFZ*Zl;3~;6tgF1L2VL2p>r%q6i2gCdbs6C* zkq+Kzm&Arfp-0|4N`-kc}^zzxdFyZ;AbRrzNC diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceControllerTest.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceControllerTest.kt index a6ebe9c3e..3119b803e 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceControllerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceControllerTest.kt @@ -22,6 +22,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintCoreConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput +import org.onap.ccsdk.cds.controllerblueprints.core.compress import org.onap.ccsdk.cds.controllerblueprints.core.deleteDir import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintCatalogService import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile @@ -62,6 +63,10 @@ class ExecutionServiceControllerTest { @BeforeTest fun init() { deleteDir("target", "blueprints") + + // Create sample CBA zip + normalizedFile("./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration") + .compress(normalizedFile("./target/blueprints/generated-cba.zip")) } @AfterTest @@ -110,7 +115,7 @@ class ExecutionServiceControllerTest { } private fun loadTestCbaFile(): File { - val testCbaFile = normalizedFile("./src/test/resources/test-cba.zip") + val testCbaFile = normalizedFile("./target/blueprints/generated-cba.zip") assertTrue(testCbaFile.exists(), "couldn't get file ${testCbaFile.absolutePath}") return testCbaFile } diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/validation/BluePrintRuntimeValidatorServiceTest.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/validation/BluePrintRuntimeValidatorServiceTest.kt index 75d9f487a..a367c8d36 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/validation/BluePrintRuntimeValidatorServiceTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/validation/BluePrintRuntimeValidatorServiceTest.kt @@ -16,6 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.validation +import kotlinx.coroutines.runBlocking import org.junit.Test import org.junit.runner.RunWith import org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.mock.MockResourceSource @@ -37,10 +38,12 @@ class BluePrintRuntimeValidatorServiceTest { @Test fun testBlueprintRuntimeValidation() { - val blueprintBasePath = - "./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" - assertNotNull(bluePrintRuntimeValidatorService, " failed to initilize bluePrintRuntimeValidatorService") + runBlocking { + val blueprintBasePath = + "./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" + assertNotNull(bluePrintRuntimeValidatorService, " failed to initilize bluePrintRuntimeValidatorService") - bluePrintRuntimeValidatorService.validateBluePrints(blueprintBasePath) + bluePrintRuntimeValidatorService.validateBluePrints(blueprintBasePath) + } } } diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/test-cba.zip b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/test-cba.zip deleted file mode 100644 index 785ec6c00a26d4097cfe6abaeda335405c31a3f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9554 zcmbVx1yoe)_x8{@bT>$dv>+XVbPwG*q=Z8a(jp~|v@}R}mx3rIQc5Y^AkrO@-*CMF zdVhNV-^@A;XU&@DdC$A|yW`o)@(74Pz~#%*z#a6*KY#wg0+0jLmDI#VSryHpU^6fj zd`Cn51^^*iCQ1LqI$7V@6%7D~xDN*aAmYP*q6`DN{6zf&NU=!Lu@H6#5Br+rXP`fD z*&f1he+Bt4>@{W!J38{AkR;_3MD2z+cs;oOpvi|Ah&iBG;_Rk-vz8gS$s(&8Jxv92 z8nk|6x`8YH96Cw?`YQp3L4}OZV$$)1>LVWLMcf@C?k1^E-9umu_ zrx6Fok%%KxBU(1Nn4f1DddM803Bz4J{J-xaGVI}%ZNU(y|HI~e+oq&Rg9iYNkpKY3 zzke^T1d@`KHc~ZrvU7GcH5YYqva*CcG>1TqIM~=>Z`X&mzuL?=wNA&u``E8fm`N$H z)perrFqNA@ah>o?VTz-e)E(RTtV-0qK{}24M^umf?qqS}z5}UB_K9}yd6XI5SrG}% z#C(fYulxxV>S;bZti-pT+8FWm0Qu?el9NnMd**!z1@lamCV_QBs7+E{1fsMRJHlL@l((TD!g_N0e1k{GCC%3C`n!y}9+x5j zJe>@$>q$SB(%fyzn|u!+4i`S1+NXYCf>KOlnZo+su9+u;t6ZP9y|^&duDV?8ivhc} z6|X|paHoHTE=$Ti>q)9~^$Y4JNgZ^Ett8o1fGG^i<>FNh$l$lY&R%jz;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