From 88e24883c8e22711062ad451250ff7e3646485b3 Mon Sep 17 00:00:00 2001 From: Brinda Santh Date: Wed, 24 Jul 2019 22:34:39 -0400 Subject: Fix attribute validation for complex type. Change-Id: I7a3365c4c26fd44ed0b54bff115b64c52ee7b81e Issue-ID: CCSDK-1046 Signed-off-by: Brinda Santh --- .../Scripts/kotlin/CapabilityCliDefinitions.kt | 35 ++++++++++------------ 1 file changed, 16 insertions(+), 19 deletions(-) (limited to 'components/model-catalog/blueprint-model') diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts/kotlin/CapabilityCliDefinitions.kt b/components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts/kotlin/CapabilityCliDefinitions.kt index 057030b22..3bf07e79d 100644 --- a/components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts/kotlin/CapabilityCliDefinitions.kt +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts/kotlin/CapabilityCliDefinitions.kt @@ -37,14 +37,12 @@ fun CapabilityCliDefinitions.defaultServiceTemplate() = author = "Brinda Santh Muthuramalingam", tags = "brinda, tosca") { - dsl("device-properties", """" - { + dsl("device-properties", """{ "type": "basic-auth", "host": { "get_input": "hostname" }, "username": { "get_input": "username" }, "password": { "get_input": "password" } - } - """.trimIndent()) + }""".trimIndent()) topologyTemplate { @@ -56,27 +54,26 @@ fun CapabilityCliDefinitions.defaultServiceTemplate() = property(id = "data", type = "json", required = true, description = "") } outputs { - property(id = "status", required = true, type = "string", description = "") + property(id = "status", required = true, type = "string", description = "") { + value("success") + } } step(id = "check", target = "check", description = "Calling check script node") - } - nodeTemplate(id = "check", - type = "component-script-executor", - description = "") { - operation(interfaceName = "process", description = "") { - inputs { - property(id = "script-type", value = "kotlin") - property(id = "script-class-reference", value = "cba.scripts.capability.cli.Check") - } - outputs { - property(id = "response-data", value = "") - property(id = "status", value = "success") - } + val checkComponent = componentScriptExecutor(id = "check", description = "") { + inputs { + type("kotlin") + scriptClassReference("cba.scripts.capability.cli.Check") + } + outputs { + status("success") + responseData("""{ "data" : "Here I am "}""") } - artifact(id = "command-template", type = "artifact-template-velocity", file = "Templates/check-command-template.vtl") + artifact(id = "command-template", type = "artifact-template-velocity", + file = "Templates/check-command-template.vtl") } + nodeTemplate(checkComponent) } artifactType(BluePrintTypes.artifactTypeTemplateVelocity()) -- cgit 1.2.3-korg