summaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules/blueprint-core/src/test
diff options
context:
space:
mode:
authorBrinda Santh <brindasanth@in.ibm.com>2019-06-04 15:45:42 -0400
committerBrinda Santh <brindasanth@in.ibm.com>2019-06-04 15:45:42 -0400
commite953ae91f7c74c12aa5770da9e967c03dd21a44c (patch)
tree4f070be13ecf941cb8e3dd5693409c4f2496ef2a /ms/controllerblueprints/modules/blueprint-core/src/test
parent184c1b55dd7bd01b2d2033ce960cb7179f0ca33c (diff)
Add service template assignments DSL
Change-Id: I6159874ef2c1cf12232f432338b4540154ec7c64 Issue-ID: CCSDK-1380 Signed-off-by: Brinda Santh <brindasanth@in.ibm.com>
Diffstat (limited to 'ms/controllerblueprints/modules/blueprint-core/src/test')
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BluePrintDSLTest.kt52
1 files changed, 52 insertions, 0 deletions
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BluePrintDSLTest.kt b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BluePrintDSLTest.kt
new file mode 100644
index 000000000..2c0192534
--- /dev/null
+++ b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BluePrintDSLTest.kt
@@ -0,0 +1,52 @@
+/*
+ * Copyright © 2019 IBM.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.cds.controllerblueprints.core.dsl
+
+import org.junit.Test
+import kotlin.test.assertNotNull
+
+class BluePrintDSLTest {
+ @Test
+ fun testServiceTemplate() {
+ val serviceTemplate = serviceTemplate("sample-bp", "1.0.0",
+ "brindasanth@onap.com", "sample") {
+ metadata("release", "1806")
+ topologyTemplate {
+ nodeTemplateOperation(nodeTemplateName = "activate", type = "sample-node-type", interfaceName = "RestconfExecutor",
+ operationName = "process", description = "sample activation") {
+ inputs {
+ property("json-content", """{ "name" : "cds"}""")
+ property("array-content", """["controller", "blueprints"]""")
+ property("int-value", 234)
+ property("boolean-value", true)
+ property("string-value", "sample")
+ property("input-expression", getInput("key-1"))
+ property("self-property-expression", getProperty("key-1"))
+ property("self-attribute-expression", getAttribute("key-1"))
+ property("self-artifact-expression", getArtifact("key-1"))
+ property("other-artifact-expression", getNodeTemplateArtifact("node-1", "key-1"))
+ }
+ }
+ }
+ }
+
+ assertNotNull(serviceTemplate.topologyTemplate, "failed to get topology template")
+ assertNotNull(serviceTemplate.topologyTemplate?.nodeTemplates, "failed to get nodeTypes")
+ assertNotNull(serviceTemplate.topologyTemplate?.nodeTemplates!!["activate"], "failed to get nodeTypes(activate)")
+ //println(JacksonUtils.getJson(serviceTemplate, true))
+ }
+}