package org.onap.ccsdk.cds.controllerblueprints.core.annotations
import com.fasterxml.jackson.databind.JsonNode
-import org.onap.ccsdk.cds.controllerblueprints.core.asBluePrintsDataTypes
+import org.onap.ccsdk.cds.controllerblueprints.core.asBlueprintsDataTypes
import org.onap.ccsdk.cds.controllerblueprints.core.asPropertyDefinitionMap
import kotlin.test.Test
import kotlin.test.assertNotNull
-class BluePrintsAnnotationsTest {
+class BlueprintsAnnotationsTest {
@Test
- fun testBluePrintWorkflowData() {
- val wfInput = TestBluePrintsWorkflowInput::class.asPropertyDefinitionMap()
+ fun testBlueprintWorkflowData() {
+ val wfInput = TestBlueprintsWorkflowInput::class.asPropertyDefinitionMap()
// println(wfInput.asJsonString(true))
assertNotNull(wfInput, "failed to generate wfInput property map")
- val wfOutput = TestBluePrintsWorkflowOutput::class.asPropertyDefinitionMap()
+ val wfOutput = TestBlueprintsWorkflowOutput::class.asPropertyDefinitionMap()
// println(wfOutput.asJsonString(true))
assertNotNull(wfInput, "failed to generate wfOutput property map")
}
@Test
- fun testBluePrintDataType() {
- val dataTypes = TestBluePrintsDataType::class.asBluePrintsDataTypes()
+ fun testBlueprintDataType() {
+ val dataTypes = TestBlueprintsDataType::class.asBlueprintsDataTypes()
// println(dataTypes.asJsonString(true))
assertNotNull(dataTypes, "failed to generate dataTypes definition")
}
}
-@BluePrintsDataType(
+@BlueprintsDataType(
name = "dt-test-datatype", description = "I am test",
version = "1.0.0", derivedFrom = "tosca.datatypes.root"
)
-data class TestBluePrintsDataType(
- @BluePrintsProperty(description = "this stringData")
+data class TestBlueprintsDataType(
+ @BlueprintsProperty(description = "this stringData")
var stringData: String,
- @BluePrintsProperty(description = "this stringDataWithValue")
+ @BlueprintsProperty(description = "this stringDataWithValue")
@PropertyDefaultValue(value = "USA")
val stringDataWithValue: String,
- @BluePrintsProperty(description = "this intDataWithValue")
+ @BlueprintsProperty(description = "this intDataWithValue")
@PropertyDefaultValue(value = "30")
val intDataWithValue: Int,
- @BluePrintsProperty(description = "this booleanDataWithValue")
+ @BlueprintsProperty(description = "this booleanDataWithValue")
@PropertyDefaultValue(value = "true")
val booleanDataWithValue: Boolean,
- @BluePrintsProperty(description = "this anyData")
+ @BlueprintsProperty(description = "this anyData")
val anyData: Any,
- @BluePrintsProperty(description = "this jsonDataWithValue")
+ @BlueprintsProperty(description = "this jsonDataWithValue")
@PropertyDefaultValue(value = """{"data" : "1234"}""")
val jsonDataWithValue: JsonNode?,
- @BluePrintsProperty(description = "listData")
+ @BlueprintsProperty(description = "listData")
val listData: MutableList<String>,
- @BluePrintsProperty(description = "this mapData")
+ @BlueprintsProperty(description = "this mapData")
val mapData: MutableMap<String, String> = hashMapOf(),
- @BluePrintsProperty(description = "this complexData")
- val complexData: TestBluePrintsChildDataType?,
- @BluePrintsProperty(description = "this complexDataList")
- val complexDataList: MutableList<TestBluePrintsChildDataType>
+ @BlueprintsProperty(description = "this complexData")
+ val complexData: TestBlueprintsChildDataType?,
+ @BlueprintsProperty(description = "this complexDataList")
+ val complexDataList: MutableList<TestBlueprintsChildDataType>
)
-data class TestBluePrintsChildDataType(val name: String)
+data class TestBlueprintsChildDataType(val name: String)
-@BluePrintsWorkflowInput
-data class TestBluePrintsWorkflowInput(
- @BluePrintsProperty(description = "this sample name")
+@BlueprintsWorkflowInput
+data class TestBlueprintsWorkflowInput(
+ @BlueprintsProperty(description = "this sample name")
@PropertyDefaultValue(value = "Brinda")
var name: String,
- @BluePrintsProperty(description = "this sample name")
+ @BlueprintsProperty(description = "this sample name")
val place: String
)
-@BluePrintsWorkflowOutput
-data class TestBluePrintsWorkflowOutput(
- @BluePrintsProperty(description = "this is dslExpression")
+@BlueprintsWorkflowOutput
+data class TestBlueprintsWorkflowOutput(
+ @BlueprintsProperty(description = "this is dslExpression")
@DSLExpression("field1")
var dslExpression: String,
- @BluePrintsProperty(description = "this is withNodeAttributeExpression")
+ @BlueprintsProperty(description = "this is withNodeAttributeExpression")
@AttributeExpression(modelableEntityName = "sample-node", attributeName = "response-data")
var withNodeAttributeExpression: String,
- @BluePrintsProperty(description = "this is withNodeAttributeExpressionSubAttribute")
+ @BlueprintsProperty(description = "this is withNodeAttributeExpressionSubAttribute")
@AttributeExpression(
modelableEntityName = "sample-node", attributeName = "response-data",
subAttributeName = ".\$field1"
)
var withNodeAttributeExpressionSubAttribute: String,
- @BluePrintsProperty(description = "this is withAttributeExpressionSubAttribute")
+ @BlueprintsProperty(description = "this is withAttributeExpressionSubAttribute")
@AttributeExpression(attributeName = "response-data", subAttributeName = ".\$field1")
var withAttributeExpressionSubAttribute: String,
- @BluePrintsProperty(description = "this is withAttributeExpression")
+ @BlueprintsProperty(description = "this is withAttributeExpression")
@AttributeExpression(attributeName = "response-data")
var withAttributeExpression: String,
- @BluePrintsProperty(description = "this is withAArtifactExpression")
+ @BlueprintsProperty(description = "this is withAArtifactExpression")
@ArtifactExpression(modelableEntityName = "test-node", artifactName = "content-template")
var withAArtifactExpression: String,
- @BluePrintsProperty(description = "this status")
+ @BlueprintsProperty(description = "this status")
val status: String = "success"
)