aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/resource-resolution/src
diff options
context:
space:
mode:
authorBrinda Santh <bs2796@att.com>2020-01-31 14:41:41 -0500
committerBrinda Santh <bs2796@att.com>2020-01-31 14:41:41 -0500
commit5c094c6adc53d958b2079de67d9d26242e10d7ef (patch)
tree0185fdf0018c47fa63ff4a1f83eee135e82e1de3 /ms/blueprintsprocessor/functions/resource-resolution/src
parent23f898a96f7e8b3ecb0817abc61612bdc3d2e9aa (diff)
Spring boot, Kotlin version upgrades
Dependent Patch : https://gerrit.onap.org/r/c/ccsdk/parent/+/100990 Fixed Jackson set method according to latest version. Fixed Security properties issues for failed JUnit test cases. Reused maven properties from parent for Spring boot, Nats, Kafka, etc Issue-ID: CCSDK-1737 Signed-off-by: Brinda Santh <bs2796@att.com> Change-Id: I04bb0e535161e05897f587a0f08a2689e10c5f41
Diffstat (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src')
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponent.kt3
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt2
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt28
3 files changed, 17 insertions, 16 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponent.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponent.kt
index 293f29cfc..db0a6f0ed 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponent.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponent.kt
@@ -17,6 +17,7 @@
package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution
+import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.node.JsonNodeFactory
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction
@@ -107,7 +108,7 @@ open class ResourceResolutionComponent(private val resourceResolutionService: Re
// provide indexed result in output if we have multiple resolution
if (occurrence != 1) {
- jsonResponse.set(Integer.toString(j), response.asJsonNode())
+ jsonResponse.set<JsonNode>(Integer.toString(j), response.asJsonNode())
} else {
jsonResponse.setAll(response.asObjectNode())
}
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt
index a813c00ca..7ffc6db39 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt
@@ -163,7 +163,7 @@ class ResourceAssignmentUtils {
val valueToPrint = getValueToLog(metadata, value)
containsLogProtected = hasLogProtect(metadata)
logger.trace("Generating Resource name ($rName), type ($type), value ($valueToPrint)")
- root.set(rName, value)
+ root.set<JsonNode>(rName, value)
}
}
result = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(root)
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 3c0af04ff..3251dcacb 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
@@ -278,7 +278,7 @@ class ResourceAssignmentUtilsTest {
val arrayNodeForList1 = JacksonUtils.objectMapper.createArrayNode()
listOfIps.forEach {
val arrayChildNode = JacksonUtils.objectMapper.createObjectNode()
- arrayChildNode.set("value", it.asJsonPrimitive())
+ arrayChildNode.set<JsonNode>("value", it.asJsonPrimitive())
arrayNodeForList1.add(arrayChildNode)
}
inputMapToTestCollectionOfPrimitiveType = arrayNodeForList1
@@ -295,23 +295,23 @@ class ResourceAssignmentUtilsTest {
val arrayNodeForList2 = JacksonUtils.objectMapper.createArrayNode()
listOfIpAddresses.forEach {
val arrayChildNode = JacksonUtils.objectMapper.createObjectNode()
- arrayChildNode.set("value", it.asJsonType())
+ arrayChildNode.set<JsonNode>("value", it.asJsonType())
arrayNodeForList2.add(arrayChildNode)
}
inputMapToTestCollectionOfComplexTypeWithOneOutputKeyMapping = arrayNodeForList2
val arrayNodeForList3 = JacksonUtils.objectMapper.createArrayNode()
var childNode = JacksonUtils.objectMapper.createObjectNode()
- childNode.set("port", "1111".asJsonPrimitive())
- childNode.set("ip", "1.2.3.1".asJsonPrimitive())
+ childNode.set<JsonNode>("port", "1111".asJsonPrimitive())
+ childNode.set<JsonNode>("ip", "1.2.3.1".asJsonPrimitive())
arrayNodeForList3.add(childNode)
childNode = JacksonUtils.objectMapper.createObjectNode()
- childNode.set("port", "2222".asJsonPrimitive())
- childNode.set("ip", "1.2.3.2".asJsonPrimitive())
+ childNode.set<JsonNode>("port", "2222".asJsonPrimitive())
+ childNode.set<JsonNode>("ip", "1.2.3.2".asJsonPrimitive())
arrayNodeForList3.add(childNode)
childNode = JacksonUtils.objectMapper.createObjectNode()
- childNode.set("port", "3333".asJsonPrimitive())
- childNode.set("ip", "1.2.3.3".asJsonPrimitive())
+ childNode.set<JsonNode>("port", "3333".asJsonPrimitive())
+ childNode.set<JsonNode>("ip", "1.2.3.3".asJsonPrimitive())
arrayNodeForList3.add(childNode)
inputMapToTestCollectionOfComplexTypeWithAllOutputKeyMapping = arrayNodeForList3
@@ -340,15 +340,15 @@ class ResourceAssignmentUtilsTest {
objectNode.set("host", Host("my-ipAddress", IpAddress("1111", "1.2.3.1")).asJsonType())
val childNode1 = JacksonUtils.objectMapper.createObjectNode()
- childNode1.set("name", "my-ipAddress".asJsonPrimitive())
- childNode1.set("ipAddress", IpAddress("1111", "1.2.3.1").asJsonType())
- childNode1.set("port", "8888".asJsonType())
- childNode1.set("something", IpAddress("2222", "1.2.3.1").asJsonType())
+ childNode1.set<JsonNode>("name", "my-ipAddress".asJsonPrimitive())
+ childNode1.set<JsonNode>("ipAddress", IpAddress("1111", "1.2.3.1").asJsonType())
+ childNode1.set<JsonNode>("port", "8888".asJsonType())
+ childNode1.set<JsonNode>("something", IpAddress("2222", "1.2.3.1").asJsonType())
inputMapToTestComplexTypeWithAllOutputKeyMapping = childNode1
val childNode2 = JacksonUtils.objectMapper.createObjectNode()
- childNode2.set("name", "my-ipAddress".asJsonPrimitive())
- childNode2.set("ipAddress", IpAddress("1111", "1.2.3.1").asJsonType())
+ childNode2.set<JsonNode>("name", "my-ipAddress".asJsonPrimitive())
+ childNode2.set<JsonNode>("ipAddress", IpAddress("1111", "1.2.3.1").asJsonType())
expectedValueToTestComplexTypeWithAllOutputKeyMapping = childNode2
}