diff options
author | 2021-01-22 11:49:51 -0500 | |
---|---|---|
committer | 2021-01-22 12:08:19 -0500 | |
commit | adcd4f2bc695840e9ecbc05003bc52c675f22fec (patch) | |
tree | 5db58ce9b6b3e86977ca3c697ce3e8998523eb61 /ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin | |
parent | dc8252f3cfa1ddd0c1c8c70513c16c738d840822 (diff) |
Renaming Files having BluePrint to have Blueprint
Replacing BluePrint with Blueprint throughout
Issue-ID: CCSDK-3098
Signed-off-by: KAPIL SINGAL <ks220y@att.com>
Change-Id: Ibee8bad07ae7d9287073db2d4f2f2cd730fa8b96
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 6a028d36f..482d21abd 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.errors.isEmpty()) } @Test fun testAddErrorWith3Params() { - val bluePrintError = BluePrintError() + val bluePrintError = BlueprintError() bluePrintError.addError("type", "name", "error") @@ -24,7 +24,7 @@ class BluePrintErrorTest { @Test fun testAddErrorWith1Params() { - val bluePrintError = BluePrintError() + val bluePrintError = BlueprintError() bluePrintError.addError("error") 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 7ac9b8649..8c1e9f65f 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 643549be0..0fe2fbf7f 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 a75262f96..b19c3502a 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 9aea47a9e..5143c9dc7 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)) @@ -248,7 +248,7 @@ class BluePrintDSLTest { @Test fun testNodeTemplateOperationTypes() { - val testNodeTemplateInstance = BluePrintTypes.nodeTemplateComponentTestExecutor( + val testNodeTemplateInstance = BlueprintTypes.nodeTemplateComponentTestExecutor( id = "test-node-template", description = "" ) { @@ -271,7 +271,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 0803d921b..7dd980dc7 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 38f6ea2ec..4ad4ab403 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 4f645270d..552f7b6f8 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 265175165..5ef28cce2 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 4fcbb2d98..268811091 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 0e93ccf6b..6ebb6b7ff 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 eb6246989..291a81f28 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 6e19656ec..ac74f7ab1 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 62bb0afcb..d0c32cc39 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 6ccfe1e95..b03fb9fc1 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 d78e62f28..ec12639fb 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 83764c517..f2d63531d 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 |