From 5c094c6adc53d958b2079de67d9d26242e10d7ef Mon Sep 17 00:00:00 2001 From: Brinda Santh Date: Fri, 31 Jan 2020 14:41:41 -0500 Subject: 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 Change-Id: I04bb0e535161e05897f587a0f08a2689e10c5f41 --- .../resolution/ResourceResolutionComponent.kt | 3 ++- .../resolution/utils/ResourceAssignmentUtils.kt | 2 +- .../utils/ResourceAssignmentUtilsTest.kt | 28 +++++++++++----------- 3 files changed, 17 insertions(+), 16 deletions(-) (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src') 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(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(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("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("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("port", "1111".asJsonPrimitive()) + childNode.set("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("port", "2222".asJsonPrimitive()) + childNode.set("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("port", "3333".asJsonPrimitive()) + childNode.set("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("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()) 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("name", "my-ipAddress".asJsonPrimitive()) + childNode2.set("ipAddress", IpAddress("1111", "1.2.3.1").asJsonType()) expectedValueToTestComplexTypeWithAllOutputKeyMapping = childNode2 } -- cgit 1.2.3-korg