aboutsummaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules
diff options
context:
space:
mode:
Diffstat (limited to 'ms/controllerblueprints/modules')
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctions.kt4
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/test/resources/dictionary/dictionary_schema.json44
-rw-r--r--ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt10
3 files changed, 54 insertions, 4 deletions
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctions.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctions.kt
index d45571cdf..72c2c1df3 100644
--- a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctions.kt
+++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctions.kt
@@ -97,6 +97,10 @@ fun <T : Any> Map<String, *>.castValue(key: String, valueType: KClass<T>): T {
}
}
+fun ArrayNode.asListOfString(): List<String> {
+ return JacksonUtils.getListFromJsonNode(this, String::class.java)
+}
+
/**
* Convert Json to map of json node, the root fields will be map keys
*/
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/resources/dictionary/dictionary_schema.json b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/dictionary/dictionary_schema.json
index cac8770af..0e1f84278 100644
--- a/ms/controllerblueprints/modules/blueprint-core/src/test/resources/dictionary/dictionary_schema.json
+++ b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/dictionary/dictionary_schema.json
@@ -51,8 +51,46 @@
"default": {
"type": "any"
},
- "aai": {
- "type": "any"
+ "primary-aai-data": {
+ "type": "object",
+ "properties": {
+ "verb": {
+ "type": "string",
+ "required": true
+ },
+ "path": {
+ "type": "string",
+ "required": true
+ },
+ "url-path": {
+ "type": "string",
+ "required": true
+ },
+ "payload": {
+ "type": "string",
+ "required": false
+ },
+ "input-key-mapping": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "type": {
+ "type": "string",
+ "required": true
+ },
+ "output-key-mapping": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "base": {
+ "type": "string",
+ "required": true
+ }
+ }
},
"primary-config-data": {
"type": "object",
@@ -177,7 +215,7 @@
}
}
},
- "aai": {
+ "primary-aai-data": {
"type": "object",
"properties": {
"names": {
diff --git a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt b/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt
index e82ffc458..d06d5db9a 100644
--- a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt
+++ b/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt
@@ -92,6 +92,14 @@ class BluePrintEnhancerServiceImplTest {
}
+ @Test
+ @Throws(Exception::class)
+ fun testRemoteScriptsEnhancementAndValidation() {
+ val basePath = "./../../../../components/model-catalog/blueprint-model/test-blueprint/remote_scripts"
+ testComponentInvokeEnhancementAndValidation(basePath, "remote_scripts-enhance")
+
+ }
+
private fun testComponentInvokeEnhancementAndValidation(basePath: String, targetDirName: String) {
runBlocking {
val targetPath = normalizedPathName("target/blueprints/enrichment", targetDirName)
@@ -105,7 +113,7 @@ class BluePrintEnhancerServiceImplTest {
val valid = bluePrintValidatorService.validateBluePrints(targetPath)
Assert.assertTrue("blueprint($basePath) validation failed ", valid)
-// deleteDir(targetPath)
+ deleteDir(targetPath)
}
}