diff options
author | Brinda Santh <brindasanth@in.ibm.com> | 2019-08-01 21:00:05 -0400 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2019-08-09 20:03:06 +0000 |
commit | 2d879240396861aa253dd65b2476f35a2ffc0493 (patch) | |
tree | 8d21c269942cd4ef708f915c79dc5e3f28a90698 /ms/controllerblueprints/modules/blueprint-core/src/test | |
parent | f48dcc232cfd6e7c11c1155a58f6017d3a71c007 (diff) |
Add property definition type DSL.
Change-Id: I83a3d1391c60cd426236b55d0d399e273e7c15dc
Issue-ID: CCSDK-1577
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.kt | 24 |
1 files changed, 19 insertions, 5 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 index ba2f07072..ec8f24d85 100644 --- 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 @@ -218,7 +218,11 @@ class BluePrintDSLTest { val testNodeTemplateInstance = BluePrintTypes.nodeTemplateComponentTestExecutor(id = "test-node-template", description = "") { - operation("") { + definedProperties { + prop1("i am property1") + prop2("i am property2") + } + definedOperation("") { implementation(360) inputs { request("i am request") @@ -235,16 +239,26 @@ class BluePrintDSLTest { fun BluePrintTypes.nodeTemplateComponentTestExecutor(id: String, description: String, - block: TestNodeTemplateImplBuilder.() -> Unit) + block: TestNodeTemplateOperationImplBuilder.() -> Unit) : NodeTemplate { - return TestNodeTemplateImplBuilder(id, description).apply(block).build() + return TestNodeTemplateOperationImplBuilder(id, description).apply(block).build() } -class TestNodeTemplateImplBuilder(id: String, description: String) : - AbstractNodeTemplateImplBuilder<TestInput, TestOutput>(id, "component-test-executor", +class TestNodeTemplateOperationImplBuilder(id: String, description: String) : + AbstractNodeTemplateOperationImplBuilder<TestProperty, TestInput, TestOutput>(id, "component-test-executor", "ComponentTestExecutor", description) +class TestProperty : PropertiesAssignmentBuilder() { + fun prop1(prop1: String) { + property("prop1", prop1.asJsonPrimitive()) + } + + fun prop2(prop2: String) { + property("prop2", prop2.asJsonPrimitive()) + } +} + class TestInput : PropertiesAssignmentBuilder() { fun request(request: String) { property("request", request.asJsonPrimitive()) |