Fix - ResolutionSummary should contain resolved request-payload 17/102517/3
authorJozsef Csongvai <jozsef.csongvai@bell.ca>
Thu, 27 Feb 2020 18:52:25 +0000 (13:52 -0500)
committerKAPIL SINGAL <ks220y@att.com>
Fri, 28 Feb 2020 14:50:57 +0000 (14:50 +0000)
Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca>
Change-Id: I87db63edcef6157da1f498bc9ab1af3cddf8c49a
Issue-ID: CCSDK-2038

ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt
ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt
ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt

index 1023340..5d92268 100644 (file)
@@ -83,6 +83,7 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS
 
                 // Resolving content Variables
                 val payload = resolveFromInputKeyMapping(nullToEmpty(sourceProperties.payload), resolvedInputKeyMapping)
+                resourceSourceProperties["resolved-payload"] = JacksonUtils.jsonNode(payload)
                 val urlPath =
                     resolveFromInputKeyMapping(checkNotNull(sourceProperties.urlPath), resolvedInputKeyMapping)
                 val verb = resolveFromInputKeyMapping(nullToEmpty(sourceProperties.verb), resolvedInputKeyMapping)
index 7101735..6922192 100644 (file)
@@ -204,7 +204,7 @@ class ResourceAssignmentUtils {
         ): String {
             val resolutionSummaryList = resourceAssignments.map {
                 val payload = resourceDefinitions[it.name]
-                        ?.sources?.get(it.dictionarySource)?.properties?.get("payload")
+                        ?.sources?.get(it.dictionarySource)?.properties?.get("resolved-payload")
                 ResolutionSummary(
                         it.name, it.property?.value, it.property?.required,
                         it.property?.type, it.keyIdentifiers, it.dictionaryName,
index 8ca4016..da3b9c2 100644 (file)
@@ -164,7 +164,7 @@ class ResourceAssignmentUtilsTest {
         val resourceAssignment = createResourceAssignmentForTest(null)
         val resourceDefinition = ResourceDefinition()
         val nodeTemplate = NodeTemplate().apply {
-            properties = mutableMapOf("payload" to JacksonUtils.jsonNode("{\"mock\": true}"))
+            properties = mutableMapOf("resolved-payload" to JacksonUtils.jsonNode("{\"mock\": true}"))
         }
         resourceDefinition.sources = mutableMapOf("input" to nodeTemplate)