diff options
Diffstat (limited to 'ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin')
17 files changed, 232 insertions, 232 deletions
diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BlueprintErrorTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintErrorTest.kt index 94ba98603..167c0381a 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BlueprintErrorTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintErrorTest.kt @@ -4,18 +4,18 @@ import org.junit.Test import kotlin.test.assertEquals import kotlin.test.assertTrue -class BlueprintErrorTest { +class BluePrintErrorTest { @Test - fun testBlueprintErrorIsCreatedWithemptyList() { - val bluePrintError = BlueprintError() + fun testBluePrintErrorIsCreatedWithemptyList() { + val bluePrintError = BluePrintError() assertTrue(bluePrintError.allErrors().isEmpty()) } @Test fun testAddErrorWith3Params() { - val bluePrintError = BlueprintError() + val bluePrintError = BluePrintError() bluePrintError.addError("type", "name", "error", "step") @@ -24,7 +24,7 @@ class BlueprintErrorTest { @Test fun testAddErrorWith2Params() { - val bluePrintError = BlueprintError() + val bluePrintError = BluePrintError() bluePrintError.addError("error", "step") diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctionsTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctionsTest.kt index 8c1e9f65f..7ac9b8649 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctionsTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctionsTest.kt @@ -95,13 +95,13 @@ class CustomFunctionsTest { val returnValueBool: JsonNode = false.asJsonType() assertFalse(returnValueBool.asBoolean()) - val returnValue: JsonNode = BlueprintError().asJsonType() + val returnValue: JsonNode = BluePrintError().asJsonType() assertEquals(JsonNodeType.OBJECT, returnValue.getNodeType()) } @Test fun testMapAsObjectNode() { - val returnValue: ObjectNode = hashMapOf("test" to BlueprintError()).asObjectNode() + val returnValue: ObjectNode = hashMapOf("test" to BluePrintError()).asObjectNode() assertNotNull(returnValue.get("test")) } @@ -121,7 +121,7 @@ class CustomFunctionsTest { assertNull(returnValueString) } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testCastValue() { val initMap: Map<String, Double> = hashMapOf("test" to 1.1) val returnValue = initMap.castValue("test", Number::class) @@ -178,7 +178,7 @@ class CustomFunctionsTest { assertTrue("[{\"key\": \"value\"},{\"key\": \"value\"}]".asJsonType().isComplexType()) } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testRootFieldsToMap() { 1.asJsonType().rootFieldsToMap() } @@ -192,7 +192,7 @@ class CustomFunctionsTest { assertEquals(3, mutMap["hello"]?.asInt()) } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testMapGetAsString() { val initMap = hashMapOf("test" to "hello".asJsonType()) @@ -201,7 +201,7 @@ class CustomFunctionsTest { initMap.getAsString("test2") } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testMapGetAsBoolean() { val initMap = hashMapOf("test" to true.asJsonType()) @@ -210,7 +210,7 @@ class CustomFunctionsTest { initMap.getAsBoolean("test2") } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testMapGetAsInt() { val initMap = hashMapOf("test" to 1.asJsonType()) @@ -219,7 +219,7 @@ class CustomFunctionsTest { initMap.getAsInt("test2") } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testCheckEquals() { assertTrue(checkEquals("hello", "hello", { -> "error" })) diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/MDCContextTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/MDCContextTest.kt index 0fe2fbf7f..643549be0 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/MDCContextTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/MDCContextTest.kt @@ -41,14 +41,14 @@ class MDCContextTest { @Test fun testContextCanBePassedBetweenCoroutines() { - MDC.put(BlueprintConstants.ONAP_REQUEST_ID, "12345") + MDC.put(BluePrintConstants.ONAP_REQUEST_ID, "12345") runBlocking { GlobalScope.launch { - assertEquals(null, MDC.get(BlueprintConstants.ONAP_REQUEST_ID)) + assertEquals(null, MDC.get(BluePrintConstants.ONAP_REQUEST_ID)) } launch(MDCContext()) { assertEquals( - "12345", MDC.get(BlueprintConstants.ONAP_REQUEST_ID), + "12345", MDC.get(BluePrintConstants.ONAP_REQUEST_ID), "couldn't get request id" ) diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/annotations/BlueprintsAnnotationsTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/annotations/BluePrintsAnnotationsTest.kt index b19c3502a..a75262f96 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/annotations/BlueprintsAnnotationsTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/annotations/BluePrintsAnnotationsTest.kt @@ -17,103 +17,103 @@ 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" ) diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BlueprintDSLTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BluePrintDSLTest.kt index 57f671dc4..f2d95cdc6 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BlueprintDSLTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BluePrintDSLTest.kt @@ -18,13 +18,13 @@ package org.onap.ccsdk.cds.controllerblueprints.core.dsl import com.fasterxml.jackson.databind.JsonNode import org.junit.Test -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeTemplate import org.onap.ccsdk.cds.controllerblueprints.core.jsonAsJsonType import kotlin.test.assertNotNull -class BlueprintDSLTest { +class BluePrintDSLTest { @Test fun testOperationDSLWorkflow() { @@ -34,7 +34,7 @@ class BlueprintDSLTest { "brindasanth@onap.com", "sample, blueprints" ) { - artifactType(BlueprintTypes.artifactTypeTemplateVelocity()) + artifactType(BluePrintTypes.artifactTypeTemplateVelocity()) // For New Component Definition component( @@ -84,7 +84,7 @@ class BlueprintDSLTest { assertNotNull(blueprint.workflows, "failed to get workflows") // println(blueprint.asJsonString(true)) - val serviceTemplateGenerator = BlueprintServiceTemplateGenerator(blueprint) + val serviceTemplateGenerator = BluePrintServiceTemplateGenerator(blueprint) val serviceTemplate = serviceTemplateGenerator.serviceTemplate() assertNotNull(serviceTemplate.topologyTemplate, "failed to get service topology template") // println(serviceTemplate.asJsonString(true)) @@ -249,7 +249,7 @@ class BlueprintDSLTest { @Test fun testNodeTemplateOperationTypes() { - val testNodeTemplateInstance = BlueprintTypes.nodeTemplateComponentTestExecutor( + val testNodeTemplateInstance = BluePrintTypes.nodeTemplateComponentTestExecutor( id = "test-node-template", description = "" ) { @@ -272,7 +272,7 @@ class BlueprintDSLTest { } } -fun BlueprintTypes.nodeTemplateComponentTestExecutor( +fun BluePrintTypes.nodeTemplateComponentTestExecutor( id: String, description: String, block: TestNodeTemplateOperationImplBuilder.() -> Unit diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BlueprintScriptsServiceImplTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintScriptsServiceImplTest.kt index 7dd980dc7..0803d921b 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BlueprintScriptsServiceImplTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintScriptsServiceImplTest.kt @@ -20,7 +20,7 @@ package org.onap.ccsdk.cds.controllerblueprints.core.scripts import kotlinx.coroutines.runBlocking import org.junit.Test import org.onap.ccsdk.cds.controllerblueprints.core.data.DataType -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintDefinitions +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintDefinitions import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintFunctionNode import org.onap.ccsdk.cds.controllerblueprints.core.normalizedPathName import kotlin.script.experimental.jvm.util.classpathFromClass @@ -28,19 +28,19 @@ import kotlin.script.experimental.jvm.util.classpathFromClassloader import kotlin.script.experimental.jvm.util.classpathFromClasspathProperty import kotlin.test.assertNotNull -class BlueprintScriptsServiceImplTest { +class BluePrintScriptsServiceImplTest { private fun viewClassPathInfo() { println(" *********** classpathFromClass *********** ") classpathFromClass( - BlueprintScriptsServiceImplTest::class.java.classLoader, - BlueprintScriptsServiceImplTest::class + BluePrintScriptsServiceImplTest::class.java.classLoader, + BluePrintScriptsServiceImplTest::class )!! .forEach(::println) println(" *********** classpathFromClassloader *********** ") - classpathFromClassloader(BlueprintScriptsServiceImplTest::class.java.classLoader)!! + classpathFromClassloader(BluePrintScriptsServiceImplTest::class.java.classLoader)!! .forEach(::println) println(" *********** classpathFromClasspathProperty *********** ") @@ -52,13 +52,13 @@ class BlueprintScriptsServiceImplTest { fun testCachedService() { runBlocking { - val bluePrintScriptsService = BlueprintScriptsServiceImpl() + val bluePrintScriptsService = BluePrintScriptsServiceImpl() val basePath = normalizedPathName("src/test/resources/compile") /** Load the Definitions */ val bluePrintDefinitions = bluePrintScriptsService - .scriptInstance<BlueprintDefinitions>( + .scriptInstance<BluePrintDefinitions>( basePath, "cba.scripts.ActivateBlueprintDefinitions", true ) diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BlueprintContextTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintContextTest.kt index 4ad4ab403..38f6ea2ec 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BlueprintContextTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintContextTest.kt @@ -20,8 +20,8 @@ package org.onap.ccsdk.cds.controllerblueprints.core.service import com.fasterxml.jackson.databind.ObjectMapper import kotlinx.coroutines.runBlocking import org.junit.Test -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.TestConstants import org.onap.ccsdk.cds.controllerblueprints.core.data.Activity import org.onap.ccsdk.cds.controllerblueprints.core.data.ArtifactDefinition @@ -38,7 +38,7 @@ import org.onap.ccsdk.cds.controllerblueprints.core.data.ServiceTemplate import org.onap.ccsdk.cds.controllerblueprints.core.data.Step import org.onap.ccsdk.cds.controllerblueprints.core.data.TopologyTemplate import org.onap.ccsdk.cds.controllerblueprints.core.data.Workflow -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.slf4j.LoggerFactory import kotlin.test.assertEquals @@ -51,16 +51,16 @@ import kotlin.test.assertTrue * * @author Brinda Santh */ -class BlueprintContextTest { +class BluePrintContextTest { private val log = LoggerFactory.getLogger(this::class.toString()) val blueprintBasePath = TestConstants.PATH_TEST_BLUEPRINTS_BASECONFIG @Test - fun testBlueprintContextCreation() { + fun testBluePrintContextCreation() { runBlocking { - val bluePrintContext = BlueprintMetadataUtils.getBlueprintContext(blueprintBasePath) + val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext(blueprintBasePath) assertNotNull(bluePrintContext, "Failed to populate Blueprint context") } } @@ -68,7 +68,7 @@ class BlueprintContextTest { @Test fun testChainedProperty() { runBlocking { - val bluePrintContext = BlueprintMetadataUtils.getBlueprintContext(blueprintBasePath) + val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext(blueprintBasePath) val nodeType = bluePrintContext.nodeTypeChained("component-resource-resolution") assertNotNull(nodeType, "Failed to get chained node type") log.trace("Properties {}", JacksonUtils.getJson(nodeType, true)) @@ -79,7 +79,7 @@ class BlueprintContextTest { fun testImports() { val serviceTemplate = ServiceTemplate() serviceTemplate.imports = mutableListOf() - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertTrue(bluePrintContext.imports()!!.isEmpty()) @@ -91,7 +91,7 @@ class BlueprintContextTest { fun testDataTypes() { val serviceTemplate = ServiceTemplate() serviceTemplate.dataTypes = mutableMapOf() - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertTrue(bluePrintContext.dataTypes()!!.isEmpty()) @@ -105,7 +105,7 @@ class BlueprintContextTest { topologyTemplate.inputs = mutableMapOf() val serviceTemplate = ServiceTemplate() serviceTemplate.topologyTemplate = topologyTemplate - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertTrue(bluePrintContext.inputs()!!.isEmpty()) @@ -115,49 +115,49 @@ class BlueprintContextTest { } @Test - fun testBlueprintJson() { + fun testBluePrintJson() { val serviceTemplate = ServiceTemplate() - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertEquals("{\"tosca_definitions_version\":\"controller_blueprint_1_0_0\"}", bluePrintContext.blueprintJson()) } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testName() { val serviceTemplate = ServiceTemplate() - serviceTemplate.metadata = mutableMapOf(BlueprintConstants.METADATA_TEMPLATE_NAME to "hello") - val bluePrintContext = BlueprintContext(serviceTemplate) + serviceTemplate.metadata = mutableMapOf(BluePrintConstants.METADATA_TEMPLATE_NAME to "hello") + val bluePrintContext = BluePrintContext(serviceTemplate) assertEquals("hello", bluePrintContext.name()) serviceTemplate.metadata = mutableMapOf() - val bluePrintContext2 = BlueprintContext(serviceTemplate) + val bluePrintContext2 = BluePrintContext(serviceTemplate) bluePrintContext2.name() } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testVersion() { val serviceTemplate = ServiceTemplate() - serviceTemplate.metadata = mutableMapOf(BlueprintConstants.METADATA_TEMPLATE_VERSION to "hello") - val bluePrintContext = BlueprintContext(serviceTemplate) + serviceTemplate.metadata = mutableMapOf(BluePrintConstants.METADATA_TEMPLATE_VERSION to "hello") + val bluePrintContext = BluePrintContext(serviceTemplate) assertEquals("hello", bluePrintContext.version()) serviceTemplate.metadata = mutableMapOf() - val bluePrintContext2 = BlueprintContext(serviceTemplate) + val bluePrintContext2 = BluePrintContext(serviceTemplate) bluePrintContext2.version() } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testAuthor() { val serviceTemplate = ServiceTemplate() - serviceTemplate.metadata = mutableMapOf(BlueprintConstants.METADATA_TEMPLATE_AUTHOR to "hello") - val bluePrintContext = BlueprintContext(serviceTemplate) + serviceTemplate.metadata = mutableMapOf(BluePrintConstants.METADATA_TEMPLATE_AUTHOR to "hello") + val bluePrintContext = BluePrintContext(serviceTemplate) assertEquals("hello", bluePrintContext.author()) serviceTemplate.metadata = mutableMapOf() - val bluePrintContext2 = BlueprintContext(serviceTemplate) + val bluePrintContext2 = BluePrintContext(serviceTemplate) bluePrintContext2.author() } @@ -167,7 +167,7 @@ class BlueprintContextTest { topologyTemplate.workflows = mutableMapOf() val serviceTemplate = ServiceTemplate() serviceTemplate.topologyTemplate = topologyTemplate - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertTrue(bluePrintContext.workflows()!!.isEmpty()) @@ -175,13 +175,13 @@ class BlueprintContextTest { assertNull(bluePrintContext.workflows()) } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testWorkFlowsByName() { val topologyTemplate = TopologyTemplate() topologyTemplate.workflows = mutableMapOf("workflow" to Workflow()) val serviceTemplate = ServiceTemplate() serviceTemplate.topologyTemplate = topologyTemplate - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertNotNull(bluePrintContext.workflowByName("workflow")) @@ -196,7 +196,7 @@ class BlueprintContextTest { topologyTemplate.workflows = mutableMapOf("workflow" to workflow) val serviceTemplate = ServiceTemplate() serviceTemplate.topologyTemplate = topologyTemplate - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertTrue(bluePrintContext.workflowInputs("workflow")!!.isEmpty()) @@ -205,7 +205,7 @@ class BlueprintContextTest { assertNull(bluePrintContext.workflowInputs("workflow")) } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testWorkflowStepByName() { val topologyTemplate = TopologyTemplate() val workflow = Workflow() @@ -213,14 +213,14 @@ class BlueprintContextTest { topologyTemplate.workflows = mutableMapOf("workflow" to workflow) val serviceTemplate = ServiceTemplate() serviceTemplate.topologyTemplate = topologyTemplate - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertNotNull(bluePrintContext.workflowStepByName("workflow", "step")) bluePrintContext.workflowStepByName("workflow", "") } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testWorkflowStepNodeTemplate() { val topologyTemplate = TopologyTemplate() val workflow = Workflow() @@ -230,14 +230,14 @@ class BlueprintContextTest { topologyTemplate.workflows = mutableMapOf("workflow" to workflow) val serviceTemplate = ServiceTemplate() serviceTemplate.topologyTemplate = topologyTemplate - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertEquals("hello", bluePrintContext.workflowStepNodeTemplate("workflow", "step")) bluePrintContext.workflowStepNodeTemplate("workflow", "") } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testWorkflowFirstStepNodeTemplate() { val topologyTemplate = TopologyTemplate() val workflow = Workflow() @@ -247,7 +247,7 @@ class BlueprintContextTest { topologyTemplate.workflows = mutableMapOf("workflow" to workflow) val serviceTemplate = ServiceTemplate() serviceTemplate.topologyTemplate = topologyTemplate - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertEquals("hello", bluePrintContext.workflowFirstStepNodeTemplate("workflow")) @@ -255,7 +255,7 @@ class BlueprintContextTest { bluePrintContext.workflowFirstStepNodeTemplate("workflow") } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testWorkflowStepFirstCallOperation() { val topologyTemplate = TopologyTemplate() val workflow = Workflow() @@ -267,7 +267,7 @@ class BlueprintContextTest { topologyTemplate.workflows = mutableMapOf("workflow" to workflow) val serviceTemplate = ServiceTemplate() serviceTemplate.topologyTemplate = topologyTemplate - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertEquals("hello", bluePrintContext.workflowStepFirstCallOperation("workflow", "step")) @@ -278,7 +278,7 @@ class BlueprintContextTest { fun testDatatypeByName() { val serviceTemplate = ServiceTemplate() serviceTemplate.dataTypes = mutableMapOf("data" to DataType()) - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertNotNull(bluePrintContext.dataTypeByName("data")) assertNull(bluePrintContext.dataTypeByName("")) @@ -288,7 +288,7 @@ class BlueprintContextTest { fun testArtifactTypes() { val serviceTemplate = ServiceTemplate() serviceTemplate.artifactTypes = mutableMapOf() - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertTrue(bluePrintContext.artifactTypes()!!.isEmpty()) @@ -300,7 +300,7 @@ class BlueprintContextTest { fun testPolicyTypes() { val serviceTemplate = ServiceTemplate() serviceTemplate.policyTypes = mutableMapOf() - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertTrue(bluePrintContext.policyTypes()!!.isEmpty()) @@ -308,11 +308,11 @@ class BlueprintContextTest { assertNull(bluePrintContext.policyTypes()) } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testPolicyTypeByName() { val serviceTemplate = ServiceTemplate() serviceTemplate.policyTypes = mutableMapOf("policy" to PolicyType()) - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertNotNull(bluePrintContext.policyTypeByName("policy")) @@ -327,7 +327,7 @@ class BlueprintContextTest { val policyType2 = PolicyType() policyType2.derivedFrom = "hello" serviceTemplate.policyTypes = mutableMapOf("policy" to policyType, "policy2" to policyType2) - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertEquals(1, bluePrintContext.policyTypesDerivedFrom("hi")!!.size) @@ -343,7 +343,7 @@ class BlueprintContextTest { val policyType2 = PolicyType() policyType2.targets = mutableListOf() serviceTemplate.policyTypes = mutableMapOf("policy" to policyType, "policy2" to policyType2) - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertEquals(1, bluePrintContext.policyTypesTarget("hi")!!.size) @@ -361,7 +361,7 @@ class BlueprintContextTest { policyType2.targets = mutableListOf() policyType2.derivedFrom = "hi" serviceTemplate.policyTypes = mutableMapOf("policy" to policyType, "policy2" to policyType2) - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertEquals(1, bluePrintContext.policyTypesTargetNDerivedFrom("hi", "hi")!!.size) @@ -377,7 +377,7 @@ class BlueprintContextTest { val nodeType2 = NodeType() nodeType2.derivedFrom = "hiii" serviceTemplate.nodeTypes = mutableMapOf("node" to nodeType, "node2" to nodeType2) - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertEquals(1, bluePrintContext.nodeTypeDerivedFrom("hi")!!.size) @@ -385,13 +385,13 @@ class BlueprintContextTest { assertNull(bluePrintContext.nodeTypeDerivedFrom("hi")) } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testInterfaceNameForNodeType() { val serviceTemplate = ServiceTemplate() val nodeType = NodeType() nodeType.interfaces = mutableMapOf("hello" to InterfaceDefinition(), "hi" to InterfaceDefinition()) serviceTemplate.nodeTypes = mutableMapOf("node" to nodeType) - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertEquals("hello", bluePrintContext.interfaceNameForNodeType("node")) @@ -408,7 +408,7 @@ class BlueprintContextTest { serviceTemplate.topologyTemplate = TopologyTemplate() serviceTemplate.topologyTemplate!!.nodeTemplates = mutableMapOf("node" to nodeTemplate, "node2" to nodeTemplate2) - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertEquals(1, bluePrintContext.nodeTemplateForNodeType("hello")!!.size) @@ -423,7 +423,7 @@ class BlueprintContextTest { nodeTemplate.properties = mutableMapOf("prop" to ObjectMapper().createObjectNode()) serviceTemplate.topologyTemplate = TopologyTemplate() serviceTemplate.topologyTemplate!!.nodeTemplates = mutableMapOf("node" to nodeTemplate) - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertNotNull(bluePrintContext.nodeTemplateProperty("node", "prop")) @@ -440,26 +440,26 @@ class BlueprintContextTest { nodeTemplate.artifacts = mutableMapOf() serviceTemplate.topologyTemplate = TopologyTemplate() serviceTemplate.topologyTemplate!!.nodeTemplates = mutableMapOf("node" to nodeTemplate) - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertTrue(bluePrintContext.nodeTemplateArtifacts("node")!!.isEmpty()) } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testNodeTemplateArtifact() { val serviceTemplate = ServiceTemplate() val nodeTemplate = NodeTemplate() nodeTemplate.artifacts = mutableMapOf("art" to ArtifactDefinition()) serviceTemplate.topologyTemplate = TopologyTemplate() serviceTemplate.topologyTemplate!!.nodeTemplates = mutableMapOf("node" to nodeTemplate) - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertNotNull(bluePrintContext.nodeTemplateArtifact("node", "art")) bluePrintContext.nodeTemplateArtifact("node", "") } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testNodeTemplateArtifactForArtifactType() { val serviceTemplate = ServiceTemplate() val nodeTemplate = NodeTemplate() @@ -470,21 +470,21 @@ class BlueprintContextTest { nodeTemplate.artifacts = mutableMapOf("art" to artifactDefinition, "art2" to artifactDefinition2) serviceTemplate.topologyTemplate = TopologyTemplate() serviceTemplate.topologyTemplate!!.nodeTemplates = mutableMapOf("node" to nodeTemplate) - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertNotNull(bluePrintContext.nodeTemplateArtifactForArtifactType("node", "type")) bluePrintContext.nodeTemplateArtifactForArtifactType("", "") } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testNodeTemplateFirstInterface() { val serviceTemplate = ServiceTemplate() val nodeTemplate = NodeTemplate() nodeTemplate.interfaces = mutableMapOf("interface" to InterfaceAssignment(), "interf" to InterfaceAssignment()) serviceTemplate.topologyTemplate = TopologyTemplate() serviceTemplate.topologyTemplate!!.nodeTemplates = mutableMapOf("node" to nodeTemplate) - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertNotNull(bluePrintContext.nodeTemplateFirstInterface("node")) @@ -492,14 +492,14 @@ class BlueprintContextTest { bluePrintContext.nodeTemplateFirstInterface("node") } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testNodeTemplateFirstInterfaceName() { val serviceTemplate = ServiceTemplate() val nodeTemplate = NodeTemplate() nodeTemplate.interfaces = mutableMapOf("interface" to InterfaceAssignment(), "interf" to InterfaceAssignment()) serviceTemplate.topologyTemplate = TopologyTemplate() serviceTemplate.topologyTemplate!!.nodeTemplates = mutableMapOf("node" to nodeTemplate) - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertEquals("interface", bluePrintContext.nodeTemplateFirstInterfaceName("node")) @@ -507,7 +507,7 @@ class BlueprintContextTest { bluePrintContext.nodeTemplateFirstInterfaceName("node") } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testNodeTemplateFirstInterfaceFirstOperationName() { val serviceTemplate = ServiceTemplate() val nodeTemplate = NodeTemplate() @@ -516,7 +516,7 @@ class BlueprintContextTest { nodeTemplate.interfaces = mutableMapOf("intf" to interfaceAssignment) serviceTemplate.topologyTemplate = TopologyTemplate() serviceTemplate.topologyTemplate!!.nodeTemplates = mutableMapOf("node" to nodeTemplate) - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertEquals("op", bluePrintContext.nodeTemplateFirstInterfaceFirstOperationName("node")) @@ -524,35 +524,35 @@ class BlueprintContextTest { bluePrintContext.nodeTemplateFirstInterfaceFirstOperationName("node") } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testNodeTemplateCapability() { val serviceTemplate = ServiceTemplate() val nodeTemplate = NodeTemplate() nodeTemplate.capabilities = mutableMapOf("cap" to CapabilityAssignment()) serviceTemplate.topologyTemplate = TopologyTemplate() serviceTemplate.topologyTemplate!!.nodeTemplates = mutableMapOf("node" to nodeTemplate) - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertNotNull(bluePrintContext.nodeTemplateCapability("node", "cap")) bluePrintContext.nodeTemplateCapability("node", "") } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testNodeTemplateRequirement() { val serviceTemplate = ServiceTemplate() val nodeTemplate = NodeTemplate() nodeTemplate.requirements = mutableMapOf("req" to RequirementAssignment()) serviceTemplate.topologyTemplate = TopologyTemplate() serviceTemplate.topologyTemplate!!.nodeTemplates = mutableMapOf("node" to nodeTemplate) - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertNotNull(bluePrintContext.nodeTemplateRequirement("node", "req")) bluePrintContext.nodeTemplateRequirement("node", "") } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testNodeTemplateRequirementNode() { val serviceTemplate = ServiceTemplate() val nodeTemplate = NodeTemplate() @@ -561,7 +561,7 @@ class BlueprintContextTest { nodeTemplate.requirements = mutableMapOf("req" to requirementAssignment) serviceTemplate.topologyTemplate = TopologyTemplate() serviceTemplate.topologyTemplate!!.nodeTemplates = mutableMapOf("node" to nodeTemplate) - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertNotNull(bluePrintContext.nodeTemplateRequirementNode("node", "req")) @@ -577,7 +577,7 @@ class BlueprintContextTest { nodeTemplate.capabilities = mutableMapOf("cap" to capabilityAssignment) serviceTemplate.topologyTemplate = TopologyTemplate() serviceTemplate.topologyTemplate!!.nodeTemplates = mutableMapOf("node" to nodeTemplate) - val bluePrintContext = BlueprintContext(serviceTemplate) + val bluePrintContext = BluePrintContext(serviceTemplate) assertNotNull(bluePrintContext.nodeTemplateCapabilityProperty("node", "cap", "prop")) diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BlueprintExpressionServiceTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintExpressionServiceTest.kt index 552f7b6f8..4f645270d 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BlueprintExpressionServiceTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintExpressionServiceTest.kt @@ -30,12 +30,12 @@ import kotlin.test.assertNotNull * * @author Brinda Santh */ -class BlueprintExpressionServiceTest { +class BluePrintExpressionServiceTest { @Test fun testInputExpression() { val node: JsonNode = jacksonObjectMapper().readTree("{ \"get_input\" : \"input-name\" }") - val expressionData: ExpressionData = BlueprintExpressionService.getExpressionData(node) + val expressionData: ExpressionData = BluePrintExpressionService.getExpressionData(node) assertNotNull(expressionData, " Failed to populate expression data") assertEquals(expressionData.isExpression, true, "Failed to identify as expression") assertNotNull(expressionData.inputExpression, " Failed to populate input expression data") @@ -45,7 +45,7 @@ class BlueprintExpressionServiceTest { @Test fun testPropertyExpression() { val node: JsonNode = jacksonObjectMapper().readTree("{ \"get_property\" : [\"SELF\", \"property-name\"] }") - val expressionData: ExpressionData = BlueprintExpressionService.getExpressionData(node) + val expressionData: ExpressionData = BluePrintExpressionService.getExpressionData(node) assertNotNull(expressionData, " Failed to populate expression data") assertEquals(expressionData.isExpression, true, "Failed to identify as expression") assertNotNull(expressionData.propertyExpression, " Failed to populate property expression data") @@ -53,7 +53,7 @@ class BlueprintExpressionServiceTest { assertEquals("property-name", expressionData.propertyExpression?.propertyName, " Failed to get expected propertyName") val node1: JsonNode = jacksonObjectMapper().readTree("{ \"get_property\" : [\"SELF\", \"\",\"property-name\", \"resource\", \"name\"] }") - val expressionData1: ExpressionData = BlueprintExpressionService.getExpressionData(node1) + val expressionData1: ExpressionData = BluePrintExpressionService.getExpressionData(node1) assertNotNull(expressionData1, " Failed to populate expression data") assertEquals(expressionData1.isExpression, true, "Failed to identify as nested property expression") assertNotNull(expressionData1.propertyExpression, " Failed to populate nested property expression data") @@ -69,7 +69,7 @@ class BlueprintExpressionServiceTest { @Test fun testAttributeExpression() { val node: JsonNode = jacksonObjectMapper().readTree("{ \"get_attribute\" : [\"SELF\", \"resource\"] }") - val expressionData: ExpressionData = BlueprintExpressionService.getExpressionData(node) + val expressionData: ExpressionData = BluePrintExpressionService.getExpressionData(node) assertNotNull(expressionData, " Failed to populate expression data") assertEquals(expressionData.isExpression, true, "Failed to identify as expression") assertNotNull(expressionData.attributeExpression, " Failed to populate attribute expression data") @@ -77,7 +77,7 @@ class BlueprintExpressionServiceTest { assertEquals("resource", expressionData.attributeExpression?.attributeName, " Failed to get expected attributeName") val node1: JsonNode = jacksonObjectMapper().readTree("{ \"get_attribute\" : [\"SELF\", \"\",\"attribute-name\", \"resource\", \"name\"] }") - val expressionData1: ExpressionData = BlueprintExpressionService.getExpressionData(node1) + val expressionData1: ExpressionData = BluePrintExpressionService.getExpressionData(node1) assertNotNull(expressionData1, " Failed to populate expression data") assertEquals(expressionData1.isExpression, true, "Failed to identify as expression") assertNotNull(expressionData1.attributeExpression, " Failed to populate attribute expression data") @@ -94,7 +94,7 @@ class BlueprintExpressionServiceTest { fun testOutputOperationExpression() { val node: JsonNode = jacksonObjectMapper().readTree("{ \"get_operation_output\": [\"SELF\", \"interface-name\", \"operation-name\", \"output-property-name\"] }") - val expressionData: ExpressionData = BlueprintExpressionService.getExpressionData(node) + val expressionData: ExpressionData = BluePrintExpressionService.getExpressionData(node) assertNotNull(expressionData, " Failed to populate expression data") assertEquals(expressionData.isExpression, true, "Failed to identify as expression") assertNotNull(expressionData.operationOutputExpression, " Failed to populate output expression data") @@ -107,7 +107,7 @@ class BlueprintExpressionServiceTest { @Test fun testArtifactExpression() { val node: JsonNode = jacksonObjectMapper().readTree("{ \"get_artifact\" : [\"SELF\", \"artifact-template\"] }") - val expressionData: ExpressionData = BlueprintExpressionService.getExpressionData(node) + val expressionData: ExpressionData = BluePrintExpressionService.getExpressionData(node) assertNotNull(expressionData, " Failed to populate expression data") assertEquals(expressionData.isExpression, true, "Failed to identify as expression") assertNotNull(expressionData.artifactExpression, " Failed to populate Artifact expression data") @@ -115,7 +115,7 @@ class BlueprintExpressionServiceTest { assertEquals("artifact-template", expressionData.artifactExpression?.artifactName, " Failed to get expected artifactName") val node1: JsonNode = jacksonObjectMapper().readTree("{ \"get_artifact\" : [\"SELF\", \"artifact-template\", \"location\", true] }") - val expressionData1: ExpressionData = BlueprintExpressionService.getExpressionData(node1) + val expressionData1: ExpressionData = BluePrintExpressionService.getExpressionData(node1) assertNotNull(expressionData1, " Failed to populate expression data") assertEquals(expressionData1.isExpression, true, "Failed to identify as expression") assertNotNull(expressionData1.artifactExpression, " Failed to populate Artifact expression data") @@ -128,7 +128,7 @@ class BlueprintExpressionServiceTest { @Test fun testDSLExpression() { val node: JsonNode = "*dynamic-rest-source".asJsonPrimitive() - val expressionData: ExpressionData = BlueprintExpressionService.getExpressionData(node) + val expressionData: ExpressionData = BluePrintExpressionService.getExpressionData(node) assertNotNull(expressionData, " Failed to populate expression data") assertEquals(expressionData.isExpression, true, "Failed to identify as expression") assertNotNull(expressionData.dslExpression, " Failed to populate dsl expression data") diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BlueprintRepoFileServiceTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintRepoFileServiceTest.kt index 5ef28cce2..265175165 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BlueprintRepoFileServiceTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintRepoFileServiceTest.kt @@ -18,19 +18,19 @@ package org.onap.ccsdk.cds.controllerblueprints.core.service import org.junit.Test -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.TestConstants import kotlin.test.assertNotNull /** - * BlueprintRepoFileServiceTest + * BluePrintRepoFileServiceTest * @author Brinda Santh * */ -class BlueprintRepoFileServiceTest { +class BluePrintRepoFileServiceTest { private val basePath = TestConstants.PATH_TEST_DEFINITION_TYPE_STARTER - private val bluePrintRepoFileService = BlueprintRepoFileService(basePath) + private val bluePrintRepoFileService = BluePrintRepoFileService(basePath) @Test fun testGetDataType() { @@ -50,7 +50,7 @@ class BlueprintRepoFileServiceTest { assertNotNull(nodeType, "Failed to get ArtifactType from repo") } - @Test(expected = BlueprintException::class) + @Test(expected = BluePrintException::class) fun testModelNotFound() { val dataType = bluePrintRepoFileService.getDataType("dt-not-found") assertNotNull(dataType, "Failed to get DataType from repo") diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BlueprintRuntimeServiceTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt index 268811091..4fcbb2d98 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BlueprintRuntimeServiceTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt @@ -20,13 +20,13 @@ package org.onap.ccsdk.cds.controllerblueprints.core.service import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.node.NullNode import org.junit.Test -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.TestConstants import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition import org.onap.ccsdk.cds.controllerblueprints.core.normalizedPathName -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintRuntimeUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintRuntimeUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.slf4j.LoggerFactory import kotlin.test.assertEquals @@ -37,7 +37,7 @@ import kotlin.test.assertNotNull * * @author Brinda Santh */ -class BlueprintRuntimeServiceTest { +class BluePrintRuntimeServiceTest { private val log = LoggerFactory.getLogger(this::class.toString()) @@ -45,7 +45,7 @@ class BlueprintRuntimeServiceTest { fun `test Resolve NodeTemplate Properties`() { log.info("************************ testResolveNodeTemplateProperties **********************") - val bluePrintRuntimeService = getBlueprintRuntimeService() + val bluePrintRuntimeService = getBluePrintRuntimeService() val inputDataPath = "src/test/resources/data/default-context.json" @@ -62,7 +62,7 @@ class BlueprintRuntimeServiceTest { fun `test Resolve Relationship Properties`() { log.info("************************ testResolveRelationshipTemplateProperties **********************") - val bluePrintRuntimeService = getBlueprintRuntimeService() + val bluePrintRuntimeService = getBluePrintRuntimeService() val inputDataPath = "src/test/resources/data/default-context.json" @@ -83,11 +83,11 @@ class BlueprintRuntimeServiceTest { @Test fun `test resolve NodeTemplate Capability Properties`() { log.info("************************ testResolveNodeTemplateRequirementProperties **********************") - val bluePrintRuntimeService = getBlueprintRuntimeService() + val bluePrintRuntimeService = getBluePrintRuntimeService() val executionContext = bluePrintRuntimeService.getExecutionContext() - BlueprintRuntimeUtils.assignInputsFromClassPathFile( + BluePrintRuntimeUtils.assignInputsFromClassPathFile( bluePrintRuntimeService.bluePrintContext(), "data/default-context.json", executionContext ) @@ -123,11 +123,11 @@ class BlueprintRuntimeServiceTest { fun `test Resolve NodeTemplate Interface Operation Inputs`() { log.info("************************ testResolveNodeTemplateInterfaceOperationInputs **********************") - val bluePrintRuntimeService = getBlueprintRuntimeService() + val bluePrintRuntimeService = getBluePrintRuntimeService() val executionContext = bluePrintRuntimeService.getExecutionContext() - BlueprintRuntimeUtils.assignInputsFromClassPathFile( + BluePrintRuntimeUtils.assignInputsFromClassPathFile( bluePrintRuntimeService.bluePrintContext(), "data/default-context.json", executionContext ) @@ -155,7 +155,7 @@ class BlueprintRuntimeServiceTest { fun `test Resolve NodeTemplate Interface Operation Outputs`() { log.info("************************ testResolveNodeTemplateInterfaceOperationOutputs **********************") - val bluePrintRuntimeService = getBlueprintRuntimeService() + val bluePrintRuntimeService = getBluePrintRuntimeService() bluePrintRuntimeService.setNodeTemplateAttributeValue( "resource-assignment", @@ -188,7 +188,7 @@ class BlueprintRuntimeServiceTest { @Test fun `test NodeTemplate Context Property`() { log.info("************************ testNodeTemplateContextProperty **********************") - val bluePrintRuntimeService = getBlueprintRuntimeService() + val bluePrintRuntimeService = getBluePrintRuntimeService() bluePrintRuntimeService.setNodeTemplateAttributeValue( "resource-assignment-ra-component", "context1", @@ -211,7 +211,7 @@ class BlueprintRuntimeServiceTest { fun `test Resolve DSL Properties`() { log.info("************************ resolveDSLExpression **********************") - val bluePrintRuntimeService = getBlueprintRuntimeService() + val bluePrintRuntimeService = getBluePrintRuntimeService() bluePrintRuntimeService.setInputValue("rest-user-name", "sample-username".asJsonPrimitive()) @@ -222,7 +222,7 @@ class BlueprintRuntimeServiceTest { @Test fun `test Resolve Workflow Outputs`() { log.info("************************ resolvePropertyAssignments **********************") - val bluePrintRuntimeService = getBlueprintRuntimeService() + val bluePrintRuntimeService = getBluePrintRuntimeService() val assignmentParams = "{\"ipAddress\": \"127.0.0.1\", \"hostName\": \"vnf-host\"}" @@ -237,7 +237,7 @@ class BlueprintRuntimeServiceTest { @Test fun `test resolvePropertyDefinitions using sub attributes`() { - val bluePrintRuntimeService = getBlueprintRuntimeService() + val bluePrintRuntimeService = getBluePrintRuntimeService() bluePrintRuntimeService.setNodeTemplateAttributeValue( "resource-assignment", "assignment-map", @@ -279,11 +279,11 @@ class BlueprintRuntimeServiceTest { assertEquals("123", result["resolution"]!!.asText()) } - private fun getBlueprintRuntimeService(): BlueprintRuntimeService<MutableMap<String, JsonNode>> { + private fun getBluePrintRuntimeService(): BluePrintRuntimeService<MutableMap<String, JsonNode>> { val blueprintBasePath = normalizedPathName(TestConstants.PATH_TEST_BLUEPRINTS_BASECONFIG) - val blueprintRuntime = BlueprintMetadataUtils.bluePrintRuntime("1234", blueprintBasePath) - val checkProcessId = blueprintRuntime.get(BlueprintConstants.PROPERTY_BLUEPRINT_PROCESS_ID) - val checkBasePath = blueprintRuntime.get(BlueprintConstants.PROPERTY_BLUEPRINT_BASE_PATH) + val blueprintRuntime = BluePrintMetadataUtils.bluePrintRuntime("1234", blueprintBasePath) + val checkProcessId = blueprintRuntime.get(BluePrintConstants.PROPERTY_BLUEPRINT_PROCESS_ID) + val checkBasePath = blueprintRuntime.get(BluePrintConstants.PROPERTY_BLUEPRINT_BASE_PATH) assertEquals( "1234".asJsonPrimitive(), diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BlueprintTemplateServiceTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateServiceTest.kt index 6ebb6b7ff..0e93ccf6b 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BlueprintTemplateServiceTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateServiceTest.kt @@ -21,20 +21,20 @@ package org.onap.ccsdk.cds.controllerblueprints.core.service import kotlinx.coroutines.runBlocking import org.junit.Test import org.onap.ccsdk.cds.controllerblueprints.core.TestConstants -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import kotlin.test.BeforeTest import kotlin.test.assertEquals import kotlin.test.assertNotNull -class BlueprintTemplateServiceTest { +class BluePrintTemplateServiceTest { - lateinit var blueprintRuntime: BlueprintRuntimeService<*> + lateinit var blueprintRuntime: BluePrintRuntimeService<*> @BeforeTest fun setup() { val blueprintBasePath = TestConstants.PATH_TEST_BLUEPRINTS_BASECONFIG - blueprintRuntime = BlueprintMetadataUtils.bluePrintRuntime("1234", blueprintBasePath) + blueprintRuntime = BluePrintMetadataUtils.bluePrintRuntime("1234", blueprintBasePath) } @Test @@ -43,7 +43,7 @@ class BlueprintTemplateServiceTest { val template = JacksonUtils.getClassPathFileContent("templates/base-config-velocity-template.vtl") val json = JacksonUtils.getClassPathFileContent("templates/base-config-data-velocity.json") - val content = BlueprintVelocityTemplateService.generateContent(template, json) + val content = BluePrintVelocityTemplateService.generateContent(template, json) assertNotNull(content, "failed to generate content for velocity template") } } @@ -60,7 +60,7 @@ class BlueprintTemplateServiceTest { hashMapOf("name" to "Element2", "location" to "Region1") ) - val content = BlueprintJinjaTemplateService.generateContent(template, json, false, element) + val content = BluePrintJinjaTemplateService.generateContent(template, json, false, element) assertNotNull(content, "failed to generate content for velocity template") } } @@ -72,7 +72,7 @@ class BlueprintTemplateServiceTest { JacksonUtils.getClassPathFileContent("templates/default-variable-value-velocity-template.vtl") val json = JacksonUtils.getClassPathFileContent("templates/default-variable-value-data.json") - val content = BlueprintVelocityTemplateService.generateContent(template, json) + val content = BluePrintVelocityTemplateService.generateContent(template, json) // first line represents a variable whose value was successfully retrieved, second line contains a variable // whose value could not be evaluated val expected = "sample-hostname\n\${node0_backup_router_address}" diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BlueprintWorkflowServiceTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintWorkflowServiceTest.kt index 291a81f28..eb6246989 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BlueprintWorkflowServiceTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintWorkflowServiceTest.kt @@ -25,25 +25,25 @@ import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.runBlocking import kotlinx.coroutines.withTimeout import org.junit.Test -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.data.EdgeLabel import org.onap.ccsdk.cds.controllerblueprints.core.data.Graph import org.onap.ccsdk.cds.controllerblueprints.core.logger import org.onap.ccsdk.cds.controllerblueprints.core.toGraph import kotlin.test.assertNotNull -class BlueprintWorkflowServiceTest { +class BluePrintWorkflowServiceTest { @Test fun testSimpleFlow() { runBlocking { val graph = "[START>A/SUCCESS, A>B/SUCCESS, B>C/SUCCESS, C>D/SUCCESS, D>E/SUCCESS, E>END/SUCCESS]" .toGraph() - val simpleWorkflow = TestBlueprintWorkFlowService() + val simpleWorkflow = TestBluePrintWorkFlowService() simpleWorkflow.simulatedState = prepareSimulation(arrayListOf("A", "B", "C", "D", "E"), null) val input = "123456" - val response = simpleWorkflow.executeWorkflow(graph, mockBlueprintRuntimeService(), input) + val response = simpleWorkflow.executeWorkflow(graph, mockBluePrintRuntimeService(), input) assertNotNull(response, "failed to get response") } } @@ -56,9 +56,9 @@ class BlueprintWorkflowServiceTest { async { val graph = "[START>A/SUCCESS, A>B/SUCCESS, B>C/SUCCESS, C>D/SUCCESS, D>END/SUCCESS]" .toGraph() - val simpleWorkflow = TestBlueprintWorkFlowService() + val simpleWorkflow = TestBluePrintWorkFlowService() simpleWorkflow.simulatedState = prepareSimulation(arrayListOf("A", "B", "C", "D"), null) - val response = simpleWorkflow.executeWorkflow(graph, mockBlueprintRuntimeService(it), it) + val response = simpleWorkflow.executeWorkflow(graph, mockBluePrintRuntimeService(it), it) assertNotNull(response, "failed to get response") } } @@ -72,10 +72,10 @@ class BlueprintWorkflowServiceTest { runBlocking { val graph = "[START>A/SUCCESS, A>B/SUCCESS, B>C/SUCCESS, C>D/SUCCESS, D>END/SUCCESS]" .toGraph() - val simpleWorkflow = TestBlueprintWorkFlowService() + val simpleWorkflow = TestBluePrintWorkFlowService() simpleWorkflow.simulatedState = prepareSimulation(arrayListOf("A", "C", "D", "E"), arrayListOf("B")) val input = "123456" - val response = simpleWorkflow.executeWorkflow(graph, mockBlueprintRuntimeService(), input) + val response = simpleWorkflow.executeWorkflow(graph, mockBluePrintRuntimeService(), input) assertNotNull(response, "failed to get response") } } @@ -85,10 +85,10 @@ class BlueprintWorkflowServiceTest { runBlocking { val graph = "[START>A/SUCCESS, A>B/SUCCESS, B>C/SUCCESS, C>D/SUCCESS, D>END/SUCCESS]" .toGraph() - val simpleWorkflow = TestBlueprintWorkFlowService() + val simpleWorkflow = TestBluePrintWorkFlowService() simpleWorkflow.simulatedState = prepareSimulation(arrayListOf("A", "C", "D", "E"), null) val input = "123456" - val response = simpleWorkflow.executeWorkflow(graph, mockBlueprintRuntimeService(), input) + val response = simpleWorkflow.executeWorkflow(graph, mockBluePrintRuntimeService(), input) assertNotNull(response, "failed to get response") } } @@ -98,10 +98,10 @@ class BlueprintWorkflowServiceTest { runBlocking { val graph = "[START>A/SUCCESS, A>TO/SUCCESS, TO>C/SUCCESS, C>D/SUCCESS, D>END/SUCCESS]" .toGraph() - val simpleWorkflow = TestBlueprintWorkFlowService() + val simpleWorkflow = TestBluePrintWorkFlowService() simpleWorkflow.simulatedState = prepareSimulation(arrayListOf("A", "TO", "C", "D", "E"), null) val input = "123456" - val response = simpleWorkflow.executeWorkflow(graph, mockBlueprintRuntimeService(), input) + val response = simpleWorkflow.executeWorkflow(graph, mockBluePrintRuntimeService(), input) assertNotNull(response, "failed to get response") } } @@ -111,10 +111,10 @@ class BlueprintWorkflowServiceTest { runBlocking { val graph = "[START>A/SUCCESS, A>B/SUCCESS, A>C/FAILURE, B>D/SUCCESS, C>D/SUCCESS, D>END/SUCCESS]" .toGraph() - val simpleWorkflow = TestBlueprintWorkFlowService() + val simpleWorkflow = TestBluePrintWorkFlowService() simpleWorkflow.simulatedState = prepareSimulation(arrayListOf("A", "B", "C", "D", "E"), null) val input = "123456" - val response = simpleWorkflow.executeWorkflow(graph, mockBlueprintRuntimeService(), input) + val response = simpleWorkflow.executeWorkflow(graph, mockBluePrintRuntimeService(), input) assertNotNull(response, "failed to get response") } } @@ -125,13 +125,13 @@ class BlueprintWorkflowServiceTest { // Failure Flow val failurePatGraph = "[START>A/SUCCESS, A>B/SUCCESS, A>C/FAILURE, B>D/SUCCESS, C>D/SUCCESS, D>END/SUCCESS]" .toGraph() - val failurePathWorkflow = TestBlueprintWorkFlowService() + val failurePathWorkflow = TestBluePrintWorkFlowService() failurePathWorkflow.simulatedState = prepareSimulation( arrayListOf("B", "C", "D", "E"), arrayListOf("A") ) val failurePathWorkflowInput = "123456" - val failurePathResponse = failurePathWorkflow.executeWorkflow(failurePatGraph, mockBlueprintRuntimeService(), failurePathWorkflowInput) + val failurePathResponse = failurePathWorkflow.executeWorkflow(failurePatGraph, mockBluePrintRuntimeService(), failurePathWorkflowInput) assertNotNull(failurePathResponse, "failed to get response") } } @@ -141,10 +141,10 @@ class BlueprintWorkflowServiceTest { runBlocking { val graph = "[START>A/SUCCESS, A>B/SUCCESS, A>C/FAILURE, C>D/SUCCESS, D>E/SUCCESS, B>E/SUCCESS, E>END/SUCCESS]" .toGraph() - val simpleWorkflow = TestBlueprintWorkFlowService() + val simpleWorkflow = TestBluePrintWorkFlowService() simpleWorkflow.simulatedState = prepareSimulation(arrayListOf("A", "B", "C", "D", "E"), null) val input = "123456" - val response = simpleWorkflow.executeWorkflow(graph, mockBlueprintRuntimeService(), input) + val response = simpleWorkflow.executeWorkflow(graph, mockBluePrintRuntimeService(), input) assertNotNull(response, "failed to get response") } } @@ -154,20 +154,20 @@ class BlueprintWorkflowServiceTest { runBlocking { val graph = "[START>A/SUCCESS, A>B/SUCCESS, A>C/SUCCESS, B>D/SUCCESS, C>D/SUCCESS, D>END/SUCCESS]" .toGraph() - val simpleWorkflow = TestBlueprintWorkFlowService() + val simpleWorkflow = TestBluePrintWorkFlowService() simpleWorkflow.simulatedState = prepareSimulation(arrayListOf("A", "B", "C", "D"), null) val input = "123456" - val response = simpleWorkflow.executeWorkflow(graph, mockBlueprintRuntimeService(), input) + val response = simpleWorkflow.executeWorkflow(graph, mockBluePrintRuntimeService(), input) assertNotNull(response, "failed to get response") } } - private fun mockBlueprintRuntimeService(): BlueprintRuntimeService<*> { - return mockBlueprintRuntimeService("123456") + private fun mockBluePrintRuntimeService(): BluePrintRuntimeService<*> { + return mockBluePrintRuntimeService("123456") } - private fun mockBlueprintRuntimeService(id: String): BlueprintRuntimeService<*> { - val bluePrintRuntimeService = mockk<BlueprintRuntimeService<*>>() + private fun mockBluePrintRuntimeService(id: String): BluePrintRuntimeService<*> { + val bluePrintRuntimeService = mockk<BluePrintRuntimeService<*>>() every { bluePrintRuntimeService.id() } returns id return bluePrintRuntimeService } @@ -184,10 +184,10 @@ class BlueprintWorkflowServiceTest { } } -class TestBlueprintWorkFlowService : - AbstractBlueprintWorkFlowService<String, String>() { +class TestBluePrintWorkFlowService : + AbstractBluePrintWorkFlowService<String, String>() { - val log = logger(TestBlueprintWorkFlowService::class) + val log = logger(TestBluePrintWorkFlowService::class) lateinit var simulatedState: MutableMap<String, EdgeLabel> @@ -195,7 +195,7 @@ class TestBlueprintWorkFlowService : return EdgeLabel.SUCCESS } - override suspend fun executeWorkflow(graph: Graph, bluePrintRuntimeService: BlueprintRuntimeService<*>, input: String): String { + override suspend fun executeWorkflow(graph: Graph, bluePrintRuntimeService: BluePrintRuntimeService<*>, input: String): String { log.info("Executing Graph : $graph") this.graph = graph this.workflowId = bluePrintRuntimeService.id() @@ -205,7 +205,7 @@ class TestBlueprintWorkFlowService : if (!workflowActor.isClosedForSend) { workflowActor().send(startMessage) } else { - throw BlueprintProcessorException("workflow actor is closed for send $workflowActor") + throw BluePrintProcessorException("workflow actor is closed for send $workflowActor") } return startMessage.output.await() } @@ -229,7 +229,7 @@ class TestBlueprintWorkFlowService : kotlinx.coroutines.delay(2) } } - return simulatedState[node.id] ?: throw BlueprintException("failed to get status for the node($node)") + return simulatedState[node.id] ?: throw BluePrintException("failed to get status for the node($node)") } override suspend fun prepareNodeSkipMessage(node: Graph.Node): NodeSkipMessage<String, String> { @@ -242,7 +242,7 @@ class TestBlueprintWorkFlowService : nodeInput: String, nodeOutput: String ): EdgeLabel { - return simulatedState[node.id] ?: throw BlueprintException("failed to get status for the node($node)") + return simulatedState[node.id] ?: throw BluePrintException("failed to get status for the node($node)") } override suspend fun cancelNode( diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BlueprintFileUtilsTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintFileUtilsTest.kt index ac74f7ab1..6e19656ec 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BlueprintFileUtilsTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintFileUtilsTest.kt @@ -24,12 +24,12 @@ import java.io.File import java.nio.file.Paths import kotlin.test.assertTrue -class BlueprintFileUtilsTest { +class BluePrintFileUtilsTest { @Test fun testNewBlueprint() = runBlocking { val targetPath: String = Paths.get("target").toUri().toURL().path.plus("/bp-new-test") - BlueprintFileUtils.createEmptyBlueprint(targetPath) + BluePrintFileUtils.createEmptyBluePrint(targetPath) } @Test @@ -41,17 +41,17 @@ class BlueprintFileUtilsTest { val targetDir = File(targetPath) targetDir.deleteOnExit() // Copy the BP file - BlueprintFileUtils.copyBlueprint(sourcePath, targetDir.absolutePath) + BluePrintFileUtils.copyBluePrint(sourcePath, targetDir.absolutePath) assertTrue(targetDir.exists(), "faield to copy blueprint to ${targetDir.absolutePath}") // Delete Type Files - BlueprintFileUtils.deleteBlueprintTypes(targetDir.absolutePath) + BluePrintFileUtils.deleteBluePrintTypes(targetDir.absolutePath) // Generate the Type Files - val bluePrintContext = BlueprintMetadataUtils.getBlueprintContext(sourcePath) + val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext(sourcePath) bluePrintContext.rootPath = targetDir.absolutePath - BlueprintFileUtils.writeBlueprintTypes(bluePrintContext) + BluePrintFileUtils.writeBluePrintTypes(bluePrintContext) } } diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BlueprintIOUtilsTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintIOUtilsTest.kt index d0c32cc39..62bb0afcb 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BlueprintIOUtilsTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintIOUtilsTest.kt @@ -18,9 +18,9 @@ package org.onap.ccsdk.cds.controllerblueprints.core.utils import kotlinx.coroutines.runBlocking import org.junit.Test -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintRetryException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintRetryException -class BlueprintIOUtilsTest { +class BluePrintIOUtilsTest { @Test fun testRetry() { @@ -29,13 +29,13 @@ class BlueprintIOUtilsTest { "success" } val exceptionBlock = { e: Exception -> - if (e is BlueprintRetryException) { + if (e is BluePrintRetryException) { println("this is blueprint error") } else { throw e } } - BlueprintIOUtils.retry<String>(4, 0, 500, executionBlock, exceptionBlock) + BluePrintIOUtils.retry<String>(4, 0, 500, executionBlock, exceptionBlock) } } } diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BlueprintMetadataUtilsTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintMetadataUtilsTest.kt index b03fb9fc1..6ccfe1e95 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BlueprintMetadataUtilsTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintMetadataUtilsTest.kt @@ -22,13 +22,13 @@ import org.junit.Test import org.onap.ccsdk.cds.controllerblueprints.core.TestConstants import org.onap.ccsdk.cds.controllerblueprints.core.data.ToscaMetaData import org.onap.ccsdk.cds.controllerblueprints.core.normalizedPathName -import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BlueprintCompileCache +import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BluePrintCompileCache import kotlin.test.assertEquals import kotlin.test.assertNotNull import kotlin.test.assertNull import kotlin.test.assertTrue -class BlueprintMetadataUtilsTest { +class BluePrintMetadataUtilsTest { @Test fun testToscaMetaData() { @@ -36,7 +36,7 @@ class BlueprintMetadataUtilsTest { runBlocking { val basePath = TestConstants.PATH_TEST_BLUEPRINTS_BASECONFIG - val toscaMetaData: ToscaMetaData = BlueprintMetadataUtils.toscaMetaData(basePath) + val toscaMetaData: ToscaMetaData = BluePrintMetadataUtils.toscaMetaData(basePath) assertNotNull(toscaMetaData, "Missing Tosca Definition Object") assertNotNull(toscaMetaData.toscaMetaFileVersion, "Missing Tosca Metadata Version") assertNotNull(toscaMetaData.csarVersion, "Missing CSAR version") @@ -47,21 +47,21 @@ class BlueprintMetadataUtilsTest { } @Test - fun testKotlinBlueprintContext() { + fun testKotlinBluePrintContext() { runBlocking { val path = normalizedPathName("src/test/resources/compile") - val blueprintContext = BlueprintMetadataUtils.getBlueprintContext(path) + val blueprintContext = BluePrintMetadataUtils.getBluePrintContext(path) assertNotNull(blueprintContext, "failed to get blueprint context") assertNotNull(blueprintContext.serviceTemplate, "failed to get blueprint context service template") assertNotNull(blueprintContext.serviceTemplate, "failed to get blueprint context service template") assertNotNull(blueprintContext.otherDefinitions, "failed to get blueprint contextother definitions") - var cachePresent = BlueprintCompileCache.hasClassLoader(path) + var cachePresent = BluePrintCompileCache.hasClassLoader(path) assertTrue(cachePresent, "failed to generate cache key ($path)") /** Cleaning Cache */ - BlueprintCompileCache.cleanClassLoader(path) - cachePresent = BlueprintCompileCache.hasClassLoader(path) + BluePrintCompileCache.cleanClassLoader(path) + cachePresent = BluePrintCompileCache.hasClassLoader(path) assertTrue(!cachePresent, "failed to remove cache key ($path)") } } @@ -70,7 +70,7 @@ class BlueprintMetadataUtilsTest { fun environmentDataTest() { val environmentPath = "./src/test/resources/environments" - val properties = BlueprintMetadataUtils.bluePrintEnvProperties(environmentPath) + val properties = BluePrintMetadataUtils.bluePrintEnvProperties(environmentPath) assertNotNull(properties, "Could not read the properties") assertEquals(properties.getProperty("blueprintsprocessor.database.alt1.username"), "username1", "failed 1") diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JacksonUtilsTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JacksonUtilsTest.kt index ec12639fb..d78e62f28 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JacksonUtilsTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JacksonUtilsTest.kt @@ -18,7 +18,7 @@ package org.onap.ccsdk.cds.controllerblueprints.core.utils import org.junit.Test -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.slf4j.LoggerFactory import kotlin.test.assertNotNull import kotlin.test.assertTrue @@ -57,19 +57,19 @@ class JacksonUtilsTest { val rootJson = JacksonUtils.jsonNodeFromClassPathFile(filePath) assertNotNull(rootJson, "Failed to get all type data json node") val intValue = rootJson.get("intValue") - assertTrue(JacksonUtils.checkJsonNodeValueOfType(BlueprintConstants.DATA_TYPE_INTEGER, intValue), "Failed to get as int value") + assertTrue(JacksonUtils.checkJsonNodeValueOfType(BluePrintConstants.DATA_TYPE_INTEGER, intValue), "Failed to get as int value") val floatValue = rootJson.get("floatValue") - assertTrue(JacksonUtils.checkJsonNodeValueOfType(BlueprintConstants.DATA_TYPE_FLOAT, floatValue), "Failed to get as float value") + assertTrue(JacksonUtils.checkJsonNodeValueOfType(BluePrintConstants.DATA_TYPE_FLOAT, floatValue), "Failed to get as float value") val stringValue = rootJson.get("stringValue") - assertTrue(JacksonUtils.checkJsonNodeValueOfType(BlueprintConstants.DATA_TYPE_STRING, stringValue), "Failed to get as string value") + assertTrue(JacksonUtils.checkJsonNodeValueOfType(BluePrintConstants.DATA_TYPE_STRING, stringValue), "Failed to get as string value") val booleanValue = rootJson.get("booleanValue") - assertTrue(JacksonUtils.checkJsonNodeValueOfType(BlueprintConstants.DATA_TYPE_BOOLEAN, booleanValue), "Failed to get as boolean value") + assertTrue(JacksonUtils.checkJsonNodeValueOfType(BluePrintConstants.DATA_TYPE_BOOLEAN, booleanValue), "Failed to get as boolean value") val arrayStringValue = rootJson.get("arrayStringValue") - assertTrue(JacksonUtils.checkJsonNodeValueOfType(BlueprintConstants.DATA_TYPE_LIST, arrayStringValue), "Failed to get as List value") + assertTrue(JacksonUtils.checkJsonNodeValueOfType(BluePrintConstants.DATA_TYPE_LIST, arrayStringValue), "Failed to get as List value") // FIX needed for ("complex type JSON & MAP") // val mapValue = rootJson.get("mapValue") - // assertTrue(JacksonUtils.checkJsonNodeValueOfType(BlueprintConstants.DATA_TYPE_MAP, mapValue), "Failed to get as Map value") + // assertTrue(JacksonUtils.checkJsonNodeValueOfType(BluePrintConstants.DATA_TYPE_MAP, mapValue), "Failed to get as Map value") - assertTrue(!JacksonUtils.checkJsonNodeValueOfType(BlueprintConstants.DATA_TYPE_LIST, stringValue), "Negative type failed") + assertTrue(!JacksonUtils.checkJsonNodeValueOfType(BluePrintConstants.DATA_TYPE_LIST, stringValue), "Negative type failed") } } diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/PropertyDefinitionUtilsTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/PropertyDefinitionUtilsTest.kt index f2d63531d..83764c517 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/PropertyDefinitionUtilsTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/PropertyDefinitionUtilsTest.kt @@ -17,7 +17,7 @@ package org.onap.ccsdk.cds.controllerblueprints.core.utils import org.junit.Test -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants.LOG_PROTECT +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants.LOG_PROTECT import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition import org.onap.ccsdk.cds.controllerblueprints.core.utils.PropertyDefinitionUtils.Companion.hasLogProtect import kotlin.test.assertFalse |