summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/resource-resolution/src/test
diff options
context:
space:
mode:
authorSteve Siani <alphonse.steve.siani.djissitchi@ibm.com>2019-05-23 00:09:46 -0400
committerBrinda Santh <brindasanth@in.ibm.com>2019-05-23 16:42:30 -0400
commit1f69e1c3569196305c23f085cfbc03bdba14f4e0 (patch)
tree0e4f28ccfdfb5f201f21cb690ddb8737bb6fd96c /ms/blueprintsprocessor/functions/resource-resolution/src/test
parentbcc6c4dfe9db06e0dab22472b11a4939255091e5 (diff)
make templating service support JsonNode instead of any.
Issue-ID: CCSDK-1360 Signed-off-by: Steve Siani <alphonse.steve.siani.djissitchi@ibm.com> Change-Id: I374a6a013514df9062ffdfc1ab278bd9e00776d9
Diffstat (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/test')
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt21
1 files changed, 13 insertions, 8 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 eb2a7a7ed..be023307b 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
@@ -15,6 +15,7 @@
*/
package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.mock
+import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.node.ArrayNode
import com.fasterxml.jackson.databind.node.MissingNode
import org.apache.commons.collections.MapUtils
@@ -22,23 +23,27 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.Reso
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.RestResourceSource
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor.ResourceAssignmentProcessor
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils
-import org.onap.ccsdk.cds.controllerblueprints.core.*
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
+import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive
+import org.onap.ccsdk.cds.controllerblueprints.core.nullToEmpty
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
import org.slf4j.LoggerFactory
-import java.util.HashMap
+import java.util.*
class MockRestResourceResolutionProcessor(private val blueprintRestLibPropertyService:
- MockBluePrintRestLibPropertyService): ResourceAssignmentProcessor() {
+ MockBluePrintRestLibPropertyService) : ResourceAssignmentProcessor() {
private val logger = LoggerFactory.getLogger(MockRestResourceResolutionProcessor::class.java)
- override fun resolveInputKeyMappingVariables(inputKeyMapping: Map<String, String>): Map<String, Any> {
- val resolvedInputKeyMapping = HashMap<String, Any>()
+ override fun resolveInputKeyMappingVariables(inputKeyMapping: Map<String, String>): Map<String, JsonNode> {
+ val resolvedInputKeyMapping = HashMap<String, JsonNode>()
if (MapUtils.isNotEmpty(inputKeyMapping)) {
- resolvedInputKeyMapping["service-instance-id"] = "10"
- resolvedInputKeyMapping["vnf_name"] = "vnf1"
- resolvedInputKeyMapping["vnf-id"] = "123456"
+
+ resolvedInputKeyMapping["service-instance-id"] = "10".asJsonPrimitive()
+ resolvedInputKeyMapping["vnf_name"] = "vnf1".asJsonPrimitive()
+ resolvedInputKeyMapping["vnf-id"] = "123456".asJsonPrimitive()
}
return resolvedInputKeyMapping
}