summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions
diff options
context:
space:
mode:
authorBrinda Santh <bs2796@att.com>2019-12-11 18:32:24 -0500
committerBrinda Santh <bs2796@att.com>2019-12-11 18:32:24 -0500
commitd4fadc988246eb172ce8333bb3a06443591c5f19 (patch)
tree19701b12c7f3008acb6a62772458ea4b47e043d8 /ms/blueprintsprocessor/functions
parenta30e1864fadad70c797ca1248a3c1272300a6e2b (diff)
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 <bs2796@att.com> Change-Id: I5d9d7a4599234a38d431328dbd9b74bd831e0115
Diffstat (limited to 'ms/blueprintsprocessor/functions')
-rw-r--r--ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutorTest.kt2
-rw-r--r--ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/ComponentConfigSnapshotsExecutorTest.kt2
-rw-r--r--ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorTest.kt15
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockDatabaseConfiguration.kt6
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt13
5 files changed, 20 insertions, 18 deletions
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<MutableMap<String, JsonNode>> {
- 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<String, JsonNode> = 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<BluePrintValidatorService>()
- every { bluePrintValidatorService.validateBluePrints(any<String>()) } returns true
- every { bluePrintValidatorService.validateBluePrints(any<BluePrintRuntimeService<*>>()) } returns true
+ coEvery { bluePrintValidatorService.validateBluePrints(any<String>()) } returns true
+ coEvery { bluePrintValidatorService.validateBluePrints(any<BluePrintRuntimeService<*>>()) } 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<String, PropertyDefinition>()
+ val mapOfPropertiesIpAddress = mutableMapOf<String, PropertyDefinition>()
mapOfPropertiesIpAddress["port"] = propertiesDefinition1
mapOfPropertiesIpAddress["ip"] = propertiesDefinition2
- var mapOfPropertiesHost = mutableMapOf<String, PropertyDefinition>()
+ val mapOfPropertiesHost = mutableMapOf<String, PropertyDefinition>()
mapOfPropertiesHost["name"] = propertiesDefinition3
mapOfPropertiesHost["ipAddress"] = propertiesDefinition4