aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org
diff options
context:
space:
mode:
Diffstat (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org')
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt19
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt3
2 files changed, 10 insertions, 12 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt
index f9a41cead..d161f64ec 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt
@@ -16,7 +16,6 @@
package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.mock
import com.fasterxml.jackson.databind.JsonNode
-import org.apache.commons.collections.MapUtils
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.RestResourceSource
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor.RestResourceResolutionProcessor
@@ -24,7 +23,6 @@ import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientSer
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
import org.slf4j.LoggerFactory
-import java.util.HashMap
class MockRestResourceResolutionProcessor(
private val blueprintRestLibPropertyService:
@@ -33,15 +31,14 @@ class MockRestResourceResolutionProcessor(
private val logger = LoggerFactory.getLogger(MockRestResourceResolutionProcessor::class.java)
- override fun resolveInputKeyMappingVariables(inputKeyMapping: Map<String, String>): Map<String, JsonNode> {
- val resolvedInputKeyMapping = HashMap<String, JsonNode>()
- if (MapUtils.isNotEmpty(inputKeyMapping)) {
-
- resolvedInputKeyMapping["service-instance-id"] = "10".asJsonPrimitive()
- resolvedInputKeyMapping["vnf_name"] = "vnf1".asJsonPrimitive()
- resolvedInputKeyMapping["vnf-id"] = "123456".asJsonPrimitive()
- }
- return resolvedInputKeyMapping
+ override fun resolveInputKeyMappingVariables(
+ inputKeyMapping: Map<String, String>,
+ templatingConstants: Map<String, String>?
+ ): Map<String, JsonNode> {
+ this.raRuntimeService.putResolutionStore("service-instance-id", "10".asJsonPrimitive())
+ this.raRuntimeService.putResolutionStore("vnf_name", "vnf1".asJsonPrimitive())
+ this.raRuntimeService.putResolutionStore("vnf-id", "123456".asJsonPrimitive())
+ return super.resolveInputKeyMappingVariables(inputKeyMapping, templatingConstants)
}
override fun getName(): String {
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt
index 56ce3f65d..75c12a0f2 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt
@@ -97,8 +97,9 @@ class RestResourceResolutionProcessorTest {
runBlocking {
val resourceAssignment = ResourceAssignment().apply {
name = "vnf_name"
- dictionaryName = "vnf_name"
+ dictionaryName = "vnf_parameter"
dictionarySource = "sdnc"
+ templatingConstants = mutableMapOf("parameter-name" to "vnf_name")
property = PropertyDefinition().apply {
type = "string"
required = true