From d4fadc988246eb172ce8333bb3a06443591c5f19 Mon Sep 17 00:00:00 2001 From: Brinda Santh Date: Wed, 11 Dec 2019 18:32:24 -0500 Subject: 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 --- .../resource/resolution/mock/MockDatabaseConfiguration.kt | 6 +++--- .../resolution/utils/ResourceAssignmentUtilsTest.kt | 13 ++++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/test') 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 -- cgit 1.2.3-korg