aboutsummaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints
diff options
context:
space:
mode:
Diffstat (limited to 'ms/controllerblueprints')
-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
-rw-r--r--ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceDictionaryConstants.kt2
-rwxr-xr-xms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/load/ControllerBlueprintCatalogServiceImpl.kt8
5 files changed, 12 insertions, 12 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")
}
diff --git a/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceDictionaryConstants.kt b/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceDictionaryConstants.kt
index aa06c9da..d33a2f04 100644
--- a/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceDictionaryConstants.kt
+++ b/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceDictionaryConstants.kt
@@ -34,5 +34,5 @@ object ResourceDictionaryConstants {
const val PROPERTY_OUTPUT_KEY_MAPPING = "output-key-mapping"
const val PROPERTY_KEY_DEPENDENCIES = "key-dependencies"
- const val PATH_RESOURCE_DEFINITION_TYPE = "resource_definition_types"
+ const val PATH_RESOURCE_DEFINITION_TYPE = "resources_definition_types"
} \ No newline at end of file
diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/load/ControllerBlueprintCatalogServiceImpl.kt b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/load/ControllerBlueprintCatalogServiceImpl.kt
index 779be65d..892cdbd5 100755
--- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/load/ControllerBlueprintCatalogServiceImpl.kt
+++ b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/load/ControllerBlueprintCatalogServiceImpl.kt
@@ -74,10 +74,10 @@ class ControllerBlueprintCatalogServiceImpl(bluePrintValidatorService: BluePrint
val artifactName = metadata[BluePrintConstants.METADATA_TEMPLATE_NAME]
val artifactVersion = metadata[BluePrintConstants.METADATA_TEMPLATE_VERSION]
- log.isDebugEnabled.apply {
- blueprintModelRepository.findByArtifactNameAndArtifactVersion(artifactName!!, artifactVersion!!)?.let {
- log.debug("Overwriting blueprint model :$artifactName::$artifactVersion")
- }
+
+ blueprintModelRepository.findByArtifactNameAndArtifactVersion(artifactName!!, artifactVersion!!)?.let {
+ log.info("Overwriting blueprint model :$artifactName::$artifactVersion")
+ blueprintModelRepository.deleteByArtifactNameAndArtifactVersion(artifactName, artifactVersion)
}
val blueprintModel = BlueprintModel()