diff options
author | Alexis de Talhouët <adetalhouet89@gmail.com> | 2019-02-11 17:23:48 -0500 |
---|---|---|
committer | Alexis de Talhouët <adetalhouet89@gmail.com> | 2019-02-12 14:12:44 -0500 |
commit | 22861e62057c835b6bb3ac18308a98abc3c79715 (patch) | |
tree | 5d719b19c56675c972ae4fe25f8daeb15906e77b /ms/controllerblueprints/modules/blueprint-core | |
parent | 91162610de8efaa9c0bfd73ff99fcabe0ef23e8a (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')
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 75310ee8..9bf9d13c 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 d06ce234..1bd95f32 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 03e233ff..d0bd3cf3 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") } |