summaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules/blueprint-core
diff options
context:
space:
mode:
authorAlexis de Talhouët <adetalhouet89@gmail.com>2019-02-11 17:23:48 -0500
committerAlexis de Talhouët <adetalhouet89@gmail.com>2019-02-12 14:12:44 -0500
commitd1acee662bfb0125a85fffdcbfebcf9cc0d6ed87 (patch)
treef601a80665f19fdb6ef637fed3405e6a5cf8531d /ms/controllerblueprints/modules/blueprint-core
parenta2fadaccbcdea04f3247b3abb5a2286c51341b5f (diff)
Fixes: manual integration test of CDS
- support to overwrite cba - fix map to json - finish meshing - fix python context not having the bluePrintRuntimeService injected - load all properties in the properties store Issue-ID: CCSDK-414 Change-Id: I6b65201529d0ffd9c3e18023a33e0081236b01de Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
Diffstat (limited to 'ms/controllerblueprints/modules/blueprint-core')
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonUtils.kt4
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintContextTest.kt2
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt8
3 files changed, 7 insertions, 7 deletions
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonUtils.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonUtils.kt
index 75310ee89..9bf9d13cf 100644
--- a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonUtils.kt
+++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonUtils.kt
@@ -166,8 +166,8 @@ class JacksonUtils {
fun <T> getMapFromJson(content: String, valueType: Class<T>): MutableMap<String, T>? {
val objectMapper = jacksonObjectMapper()
- val typeRef = object : TypeReference<MutableMap<String, T>>() {}
- return objectMapper.readValue(content, typeRef)
+ val mapType = objectMapper.typeFactory.constructMapType(Map::class.java, String::class.java, valueType)
+ return objectMapper.readValue(content, mapType)
}
fun <T> getMapFromFile(fileName: String, valueType: Class<T>): MutableMap<String, T>? {
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintContextTest.kt b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintContextTest.kt
index d06ce234d..1bd95f322 100644
--- a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintContextTest.kt
+++ b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintContextTest.kt
@@ -45,7 +45,7 @@ class BluePrintContextTest {
@Test
fun testChainedProperty() {
val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext(blueprintBasePath)
- val nodeType = bluePrintContext.nodeTypeChained("component-resource-assignment")
+ val nodeType = bluePrintContext.nodeTypeChained("component-resource-resolution")
assertNotNull(nodeType, "Failed to get chained node type")
log.trace("Properties {}", JacksonUtils.getJson(nodeType, true))
}
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt
index 03e233ff2..d0bd3cf35 100644
--- a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt
+++ b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt
@@ -85,7 +85,7 @@ class BluePrintRuntimeServiceTest {
val inContext: MutableMap<String, JsonNode> = bluePrintRuntimeService
.resolveNodeTemplateInterfaceOperationInputs("resource-assignment",
- "ResourceAssignmentComponent", "process")
+ "ResourceResolutionComponent", "process")
assertNotNull(inContext, "Failed to populate interface input property values")
assertEquals(inContext["action-name"], JacksonUtils.jsonNodeFromObject("sample-action"), "Failed to populate parameter action-name")
@@ -101,14 +101,14 @@ class BluePrintRuntimeServiceTest {
bluePrintRuntimeService.setNodeTemplateAttributeValue("resource-assignment", "assignment-params", NullNode.getInstance())
bluePrintRuntimeService.resolveNodeTemplateInterfaceOperationOutputs("resource-assignment",
- "ResourceAssignmentComponent", "process")
+ "ResourceResolutionComponent", "process")
val outputStatus = bluePrintRuntimeService.getNodeTemplateOperationOutputValue("resource-assignment",
- "ResourceAssignmentComponent", "process", "status")
+ "ResourceResolutionComponent", "process", "status")
assertEquals("success".asJsonPrimitive(), outputStatus, "Failed to get operation property status")
val outputParams = bluePrintRuntimeService.getNodeTemplateOperationOutputValue("resource-assignment",
- "ResourceAssignmentComponent", "process", "resource-assignment-params")
+ "ResourceResolutionComponent", "process", "resource-assignment-params")
assertEquals(NullNode.getInstance(), outputParams, "Failed to get operation property resource-assignment-params")
}