aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/test
diff options
context:
space:
mode:
authorJozsef Csongvai <jozsef.csongvai@bell.ca>2021-07-26 12:00:59 -0400
committerJozsef Csongvai <jozsef.csongvai@bell.ca>2021-07-28 15:44:01 -0400
commitdaab14bd058de198c80b71d63e108fd788b7f5ee (patch)
tree252cfdef5b2e1500e5bd152f3f5c52602b6b0deb /ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/test
parent82e396d6917519468376d177dd6a2710e84fa23a (diff)
Revert "Renaming Files having BluePrint to have Blueprint"
The renaming in CCSDK-3098 caused breaking changes to the grpc api and compile issues for kotlin scripts. Issue-ID: CCSDK-3385 Change-Id: I0d745cb858371678eabcb2284671c1fd76a1ab6d Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca>
Diffstat (limited to 'ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/test')
-rw-r--r--ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BluePrintDesignTimeValidatorServiceTest.kt (renamed from ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BlueprintDesignTimeValidatorServiceTest.kt)36
-rw-r--r--ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/MockBluePrintTypeValidatorService.kt (renamed from ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/MockBlueprintTypeValidatorService.kt)76
2 files changed, 56 insertions, 56 deletions
diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BlueprintDesignTimeValidatorServiceTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BluePrintDesignTimeValidatorServiceTest.kt
index dd82ec5da..fd39f8f95 100644
--- a/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BlueprintDesignTimeValidatorServiceTest.kt
+++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BluePrintDesignTimeValidatorServiceTest.kt
@@ -21,34 +21,34 @@ import io.mockk.every
import io.mockk.mockk
import kotlinx.coroutines.runBlocking
import org.junit.Test
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintError
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintError
import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeTemplate
import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeType
import org.onap.ccsdk.cds.controllerblueprints.core.data.Step
import org.onap.ccsdk.cds.controllerblueprints.core.data.Workflow
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext
-import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBlueprintRuntimeService
-import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext
+import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBluePrintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils
import org.onap.ccsdk.cds.controllerblueprints.validation.extension.ResourceDefinitionValidator
import kotlin.test.assertEquals
import kotlin.test.assertTrue
-class BlueprintDesignTimeValidatorServiceTest {
+class BluePrintDesignTimeValidatorServiceTest {
private val blueprintBasePath = "./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
- private val bluePrintRuntime = BlueprintMetadataUtils.bluePrintRuntime("1234", blueprintBasePath)
- private val mockBlueprintTypeValidatorService = MockBlueprintTypeValidatorService()
+ private val bluePrintRuntime = BluePrintMetadataUtils.bluePrintRuntime("1234", blueprintBasePath)
+ private val mockBluePrintTypeValidatorService = MockBluePrintTypeValidatorService()
private val resourceDefinitionValidator = mockk<ResourceDefinitionValidator>()
- private val defaultBlueprintValidatorService =
- BlueprintDesignTimeValidatorService(mockBlueprintTypeValidatorService, resourceDefinitionValidator)
- private val workflowValidator = BlueprintWorkflowValidatorImpl(mockBlueprintTypeValidatorService)
+ private val defaultBluePrintValidatorService =
+ BluePrintDesignTimeValidatorService(mockBluePrintTypeValidatorService, resourceDefinitionValidator)
+ private val workflowValidator = BluePrintWorkflowValidatorImpl(mockBluePrintTypeValidatorService)
@Test
fun testValidateOfType() {
runBlocking {
every { resourceDefinitionValidator.validate(bluePrintRuntime, any(), any()) } returns Unit
- val valid = defaultBlueprintValidatorService.validateBlueprints(bluePrintRuntime)
+ val valid = defaultBluePrintValidatorService.validateBluePrints(bluePrintRuntime)
assertTrue(valid, "failed in blueprint Validation")
}
}
@@ -63,10 +63,10 @@ class BlueprintDesignTimeValidatorServiceTest {
workflow.steps = mutableMapOf("test" to step)
workflowValidator.validate(bluePrintRuntime, workflowName, workflow)
- assertEquals(1, bluePrintRuntime.getBlueprintError().allErrors().size)
+ assertEquals(1, bluePrintRuntime.getBluePrintError().allErrors().size)
assertEquals(
"Failed to validate Workflow(resource-assignment)'s step(test)'s definition : resource-assignment/steps/test : could't get node template for the name(TestCaseFailNoNodeTemplate)",
- bluePrintRuntime.getBlueprintError().allErrors()[0]
+ bluePrintRuntime.getBluePrintError().allErrors()[0]
)
}
@@ -81,13 +81,13 @@ class BlueprintDesignTimeValidatorServiceTest {
val nodeType = mockk<NodeType>()
every { nodeType.derivedFrom } returns "tosca.nodes.TEST"
- val blueprintContext = mockk<BlueprintContext>()
+ val blueprintContext = mockk<BluePrintContext>()
every { blueprintContext.nodeTemplateByName(nodeTemplateName) } returns nodeTemplate
every { blueprintContext.nodeTemplateNodeType(nodeTemplateName) } returns nodeType
- val bluePrintRuntime = mockk<DefaultBlueprintRuntimeService>("1234")
+ val bluePrintRuntime = mockk<DefaultBluePrintRuntimeService>("1234")
- every { bluePrintRuntime.getBlueprintError() } returns BlueprintError()
+ every { bluePrintRuntime.getBluePrintError() } returns BluePrintError()
every { bluePrintRuntime.bluePrintContext() } returns blueprintContext
val step = Step()
@@ -96,12 +96,12 @@ class BlueprintDesignTimeValidatorServiceTest {
workflow.steps = mutableMapOf("test" to step)
workflowValidator.validate(bluePrintRuntime, workflowName, workflow)
- assertEquals(1, bluePrintRuntime.getBlueprintError().allErrors().size)
+ assertEquals(1, bluePrintRuntime.getBluePrintError().allErrors().size)
assertEquals(
"Failed to validate Workflow(resource-assignment)'s step(test)'s definition : " +
"resource-assignment/steps/test : NodeType(TestNodeType) derived from is 'tosca.nodes.TEST', " +
"Expected 'tosca.nodes.Workflow' or 'tosca.nodes.Component'",
- bluePrintRuntime.getBlueprintError().allErrors()[0]
+ bluePrintRuntime.getBluePrintError().allErrors()[0]
)
}
diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/MockBlueprintTypeValidatorService.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/MockBluePrintTypeValidatorService.kt
index 69f57a0b9..11c6c037c 100644
--- a/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/MockBlueprintTypeValidatorService.kt
+++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/MockBluePrintTypeValidatorService.kt
@@ -17,70 +17,70 @@
package org.onap.ccsdk.cds.controllerblueprints.validation
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintArtifactDefinitionValidator
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintArtifactTypeValidator
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintAttributeDefinitionValidator
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintDataTypeValidator
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintNodeTemplateValidator
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintNodeTypeValidator
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintPropertyDefinitionValidator
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintServiceTemplateValidator
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTopologyTemplateValidator
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeValidatorService
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintValidator
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintWorkflowValidator
-
-class MockBlueprintTypeValidatorService : BlueprintTypeValidatorService {
-
- override fun <T : BlueprintValidator<*>> bluePrintValidator(referenceName: String, classType: Class<T>): T? {
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintArtifactDefinitionValidator
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintArtifactTypeValidator
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintAttributeDefinitionValidator
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintDataTypeValidator
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintNodeTemplateValidator
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintNodeTypeValidator
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintPropertyDefinitionValidator
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintServiceTemplateValidator
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTopologyTemplateValidator
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeValidatorService
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintValidator
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintWorkflowValidator
+
+class MockBluePrintTypeValidatorService : BluePrintTypeValidatorService {
+
+ override fun <T : BluePrintValidator<*>> bluePrintValidator(referenceName: String, classType: Class<T>): T? {
return null
}
- override fun <T : BlueprintValidator<*>> bluePrintValidators(referenceNamePrefix: String, classType: Class<T>): List<T>? {
+ override fun <T : BluePrintValidator<*>> bluePrintValidators(referenceNamePrefix: String, classType: Class<T>): List<T>? {
return null
}
- override fun <T : BlueprintValidator<*>> bluePrintValidators(classType: Class<T>): List<T>? {
+ override fun <T : BluePrintValidator<*>> bluePrintValidators(classType: Class<T>): List<T>? {
return null
}
- override fun getServiceTemplateValidators(): List<BlueprintServiceTemplateValidator> {
- return listOf(BlueprintServiceTemplateValidatorImpl(this))
+ override fun getServiceTemplateValidators(): List<BluePrintServiceTemplateValidator> {
+ return listOf(BluePrintServiceTemplateValidatorImpl(this))
}
- override fun getDataTypeValidators(): List<BlueprintDataTypeValidator> {
- return listOf(BlueprintDataTypeValidatorImpl(this))
+ override fun getDataTypeValidators(): List<BluePrintDataTypeValidator> {
+ return listOf(BluePrintDataTypeValidatorImpl(this))
}
- override fun getArtifactTypeValidators(): List<BlueprintArtifactTypeValidator> {
- return listOf(BlueprintArtifactTypeValidatorImpl(this))
+ override fun getArtifactTypeValidators(): List<BluePrintArtifactTypeValidator> {
+ return listOf(BluePrintArtifactTypeValidatorImpl(this))
}
- override fun getArtifactDefinitionsValidators(): List<BlueprintArtifactDefinitionValidator> {
- return listOf(BlueprintArtifactDefinitionValidatorImpl(this))
+ override fun getArtifactDefinitionsValidators(): List<BluePrintArtifactDefinitionValidator> {
+ return listOf(BluePrintArtifactDefinitionValidatorImpl(this))
}
- override fun getNodeTypeValidators(): List<BlueprintNodeTypeValidator> {
- return listOf(BlueprintNodeTypeValidatorImpl(this))
+ override fun getNodeTypeValidators(): List<BluePrintNodeTypeValidator> {
+ return listOf(BluePrintNodeTypeValidatorImpl(this))
}
- override fun getTopologyTemplateValidators(): List<BlueprintTopologyTemplateValidator> {
- return listOf(BlueprintTopologyTemplateValidatorImpl(this))
+ override fun getTopologyTemplateValidators(): List<BluePrintTopologyTemplateValidator> {
+ return listOf(BluePrintTopologyTemplateValidatorImpl(this))
}
- override fun getNodeTemplateValidators(): List<BlueprintNodeTemplateValidator> {
- return listOf(BlueprintNodeTemplateValidatorImpl(this))
+ override fun getNodeTemplateValidators(): List<BluePrintNodeTemplateValidator> {
+ return listOf(BluePrintNodeTemplateValidatorImpl(this))
}
- override fun getWorkflowValidators(): List<BlueprintWorkflowValidator> {
- return listOf(BlueprintWorkflowValidatorImpl(this))
+ override fun getWorkflowValidators(): List<BluePrintWorkflowValidator> {
+ return listOf(BluePrintWorkflowValidatorImpl(this))
}
- override fun getPropertyDefinitionValidators(): List<BlueprintPropertyDefinitionValidator> {
- return listOf(BlueprintPropertyDefinitionValidatorImpl(this))
+ override fun getPropertyDefinitionValidators(): List<BluePrintPropertyDefinitionValidator> {
+ return listOf(BluePrintPropertyDefinitionValidatorImpl(this))
}
- override fun getAttributeDefinitionValidators(): List<BlueprintAttributeDefinitionValidator> {
- return listOf(BlueprintAttributeDefinitionValidatorImpl(this))
+ override fun getAttributeDefinitionValidators(): List<BluePrintAttributeDefinitionValidator> {
+ return listOf(BluePrintAttributeDefinitionValidatorImpl(this))
}
}