From fcdee7f04744f81a3247c0d692efe04feccc0dfb Mon Sep 17 00:00:00 2001 From: vinal patel Date: Tue, 5 Mar 2019 15:41:24 -0500 Subject: Resource resolution using REST -bug fix Change-Id: I47c9b3738bbca84e1d3a734e16c4ea6ae7e93a23 Issue-ID: CCSDK-1131 Signed-off-by: vinal patel --- .../resolution/processor/RestResourceResolutionProcessor.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'ms/blueprintsprocessor/functions') diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt index 4daa46e5..d8472ede 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt @@ -17,10 +17,7 @@ package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.processor -import com.fasterxml.jackson.databind.node.ArrayNode -import com.fasterxml.jackson.databind.node.JsonNodeFactory -import com.fasterxml.jackson.databind.node.NullNode -import com.fasterxml.jackson.databind.node.ObjectNode +import com.fasterxml.jackson.databind.node.* import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.RestResourceSource import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils import org.onap.ccsdk.apps.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService @@ -56,7 +53,7 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS // Check if It has Input val value = raRuntimeService.getInputValue(resourceAssignment.name) - if (value != null && value !is NullNode) { + if (value !is MissingNode && value !is NullNode) { logger.info("primary-db source template key (${resourceAssignment.name}) found from input and value is ($value)") ResourceAssignmentUtils.setResourceDataValue(resourceAssignment, raRuntimeService, value) } else { @@ -77,7 +74,7 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS // Get the Rest Client Service val restClientService = blueprintWebClientService(resourceAssignment, sourceProperties) val response = restClientService.getResource(urlPath, String::class.java) - if (response.isNotBlank()) { + if (response.isBlank()) { logger.warn("Failed to get $dSource result for dictionary name ($dName) using urlPath ($urlPath)") } else { populateResource(resourceAssignment, sourceProperties, response, path) -- cgit 1.2.3-korg