Add Validator Junit test case
authorMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
Tue, 27 Nov 2018 21:48:39 +0000 (16:48 -0500)
committerBrinda Santh Muthuramalingam <bs2796@att.com>
Fri, 30 Nov 2018 21:10:54 +0000 (21:10 +0000)
Change-Id: I785e8cb2d3705f5650512ecc27517d2edd9df683
Issue-ID: CCSDK-757
Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
15 files changed:
components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/BluePrintConstants.kt
components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/interfaces/BlueprintValidator.kt
components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/BluePrintMetadataUtils.kt
components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/validation/BluePrintArtifactTypeValidatorImpl.kt
components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/validation/BluePrintAttributeDefinitionValidatorImpl.kt [new file with mode: 0644]
components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/validation/BluePrintDataTypeValidatorImpl.kt
components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/validation/BluePrintNodeTemplateValidatorImpl.kt
components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/validation/BluePrintNodeTypeValidatorImpl.kt
components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/validation/BluePrintPropertyDefinitionValidatorImpl.kt
components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/validation/BluePrintServiceTemplateValidatorImpl.kt
components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/validation/BluePrintTopologyTemplateValidatorImpl.kt
components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/validation/BluePrintValidatorServiceImpl.kt [moved from components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/validation/BluePrintValidatorService.kt with 84% similarity]
components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/validation/BluePrintWorkflowValidatorImpl.kt
components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/mock/MockBluePrintTypeValidatorService.kt [new file with mode: 0644]
components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/validation/BluePrintValidatorServiceImplTest.kt [new file with mode: 0644]

index a412841..2908a63 100644 (file)
@@ -48,6 +48,12 @@ object BluePrintConstants {
     const val MODEL_CONTENT_TYPE_SCHEMA: String = "SCHEMA"\r
 \r
     const val PATH_DIVIDER: String = "/"\r
+    const val PATH_SERVICE_TEMPLATE: String = "service_template"\r
+    const val PATH_TOPOLOGY_TEMPLATE: String = "topology_template"\r
+    const val PATH_METADATA: String = "metadata"\r
+    const val PATH_NODE_TYPES: String = "node_types"\r
+    const val PATH_ARTIFACT_TYPES: String = "artifact_types"\r
+    const val PATH_DATA_TYPES: String = "data_types"\r
     const val PATH_INPUTS: String = "inputs"\r
     const val PATH_NODE_WORKFLOWS: String = "workflows"\r
     const val PATH_NODE_TEMPLATES: String = "node_templates"\r
index 9407cfa..322f657 100644 (file)
@@ -37,7 +37,7 @@ interface BluePrintAttributeDefinitionValidator : BluePrintValidator<AttributeDe
 interface BluePrintValidatorService {
 
     @Throws(BluePrintException::class)
-    fun validateBluePrints(bluePrintContext: BluePrintContext, properties: MutableMap<String, Any>)
+    fun validateBluePrints(bluePrintContext: BluePrintContext, properties: MutableMap<String, Any>) : Boolean
 }
 
 
index 320c306..0092b70 100644 (file)
@@ -103,6 +103,8 @@ object BluePrintMetadataUtils {
         // Recursively Import Template files\r
         val schemaImportResolverUtils = BluePrintImportService(rootServiceTemplate, basePath)\r
         val completeServiceTemplate = schemaImportResolverUtils.getImportResolvedServiceTemplate()\r
-        return BluePrintContext(completeServiceTemplate)\r
+        val blueprintContext = BluePrintContext(completeServiceTemplate)\r
+        blueprintContext.rootPath = basePath\r
+        return blueprintContext\r
     }\r
 }
\ No newline at end of file
index 2f44094..9208bda 100644 (file)
@@ -28,5 +28,6 @@ open class BluePrintArtifactTypeValidatorImpl(private val bluePrintTypeValidator
         artifactType.properties?.let {
             bluePrintTypeValidatorService.validatePropertyDefinitions(bluePrintContext, error, artifactType.properties!!)
         }
+        // TODO ("Files Present ")
     }
 }
\ No newline at end of file
diff --git a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/validation/BluePrintAttributeDefinitionValidatorImpl.kt b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/validation/BluePrintAttributeDefinitionValidatorImpl.kt
new file mode 100644 (file)
index 0000000..d0faf1c
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.apps.controllerblueprints.core.validation
+
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintValidationError
+import org.onap.ccsdk.apps.controllerblueprints.core.data.AttributeDefinition
+import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintAttributeDefinitionValidator
+import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintTypeValidatorService
+import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintContext
+
+class BluePrintAttributeDefinitionValidatorImpl(private val bluePrintTypeValidatorService: BluePrintTypeValidatorService) : BluePrintAttributeDefinitionValidator {
+
+    override fun validate(bluePrintContext: BluePrintContext, error: BluePrintValidationError, name: String, type: AttributeDefinition) {
+        //TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+    }
+}
\ No newline at end of file
index a4a8128..c8d8a74 100644 (file)
@@ -16,6 +16,8 @@
 
 package org.onap.ccsdk.apps.controllerblueprints.core.validation
 
+import com.att.eelf.configuration.EELFLogger
+import com.att.eelf.configuration.EELFManager
 import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintValidationError
 import org.onap.ccsdk.apps.controllerblueprints.core.data.DataType
 import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintDataTypeValidator
@@ -23,8 +25,11 @@ import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintTypeVal
 import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintContext
 
 open class BluePrintDataTypeValidatorImpl(private val bluePrintTypeValidatorService: BluePrintTypeValidatorService) : BluePrintDataTypeValidator {
+    private val log: EELFLogger = EELFManager.getInstance().getLogger(BluePrintDataTypeValidatorImpl::class.toString())
 
     override fun validate(bluePrintContext: BluePrintContext, error: BluePrintValidationError, name: String, dataType: DataType) {
+        log.trace("Validating DataType($name)")
+
         dataType.properties?.let {
 
             bluePrintTypeValidatorService.validatePropertyDefinitions(bluePrintContext, error, dataType.properties!!)
index bf29546..94d6251 100644 (file)
@@ -40,6 +40,9 @@ open class BluePrintNodeTemplateValidatorImpl(private val bluePrintTypeValidator
     var paths: MutableList<String> = arrayListOf()
 
     override fun validate(bluePrintContext: BluePrintContext, error: BluePrintValidationError, nodeTemplateName: String, nodeTemplate: NodeTemplate) {
+        log.trace("Validating NodeTemplate($nodeTemplateName)")
+        this.bluePrintContext = bluePrintContext
+        this.error = error
 
         paths.add(nodeTemplateName)
 
@@ -48,11 +51,11 @@ open class BluePrintNodeTemplateValidatorImpl(private val bluePrintTypeValidator
         val nodeType: NodeType = bluePrintContext.serviceTemplate.nodeTypes?.get(type)
                 ?: throw BluePrintException("Failed to get NodeType($type) definition for NodeTemplate($nodeTemplateName)")
 
-        nodeTemplate.artifacts?.let { validateArtifactDefinitions(nodeTemplate.artifacts!!) }
         nodeTemplate.properties?.let { validatePropertyAssignments(nodeType.properties!!, nodeTemplate.properties!!) }
         nodeTemplate.capabilities?.let { validateCapabilityAssignments(nodeType, nodeTemplateName, nodeTemplate) }
         nodeTemplate.requirements?.let { validateRequirementAssignments(nodeType, nodeTemplateName, nodeTemplate) }
         nodeTemplate.interfaces?.let { validateInterfaceAssignments(nodeType, nodeTemplateName, nodeTemplate) }
+        nodeTemplate.artifacts?.let { validateArtifactDefinitions(nodeTemplate.artifacts!!) }
 
         paths.removeAt(paths.lastIndex)
     }
index 1ed301c..86bf521 100644 (file)
@@ -37,9 +37,10 @@ open class BluePrintNodeTypeValidatorImpl(private val bluePrintTypeValidatorServ
     var paths: MutableList<String> = arrayListOf()
 
     override fun validate(bluePrintContext: BluePrintContext, error: BluePrintValidationError, nodeTypeName: String, nodeType: NodeType) {
-
+        log.trace("Validating NodeType($nodeTypeName)")
         this.bluePrintContext = bluePrintContext
         this.error = error
+
         paths.add(nodeTypeName)
 
         val derivedFrom: String = nodeType.derivedFrom
index 6f67cd7..f4804d4 100644 (file)
@@ -16,6 +16,8 @@
 
 package org.onap.ccsdk.apps.controllerblueprints.core.validation
 
+import com.att.eelf.configuration.EELFLogger
+import com.att.eelf.configuration.EELFManager
 import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException
 import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintTypes
 import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintValidationError
@@ -27,6 +29,8 @@ import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintContext
 
 open class BluePrintPropertyDefinitionValidatorImpl(private val bluePrintTypeValidatorService: BluePrintTypeValidatorService) : BluePrintPropertyDefinitionValidator {
 
+    private val log: EELFLogger = EELFManager.getInstance().getLogger(BluePrintServiceTemplateValidatorImpl::class.toString())
+
     var bluePrintContext: BluePrintContext? = null
     var error: BluePrintValidationError? = null
 
@@ -34,6 +38,8 @@ open class BluePrintPropertyDefinitionValidatorImpl(private val bluePrintTypeVal
         this.bluePrintContext = bluePrintContext
         this.error = error
 
+        log.trace("Validating PropertyDefinition($name)")
+
         val dataType: String = propertyDefinition.type
 
         when {
index 257528d..66c504d 100644 (file)
@@ -21,7 +21,6 @@ import com.att.eelf.configuration.EELFManager
 import com.google.common.base.Preconditions
 import org.apache.commons.lang3.StringUtils
 import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants
-import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException
 import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintValidationError
 import org.onap.ccsdk.apps.controllerblueprints.core.data.*
 import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintServiceTemplateValidator
@@ -34,9 +33,10 @@ open class BluePrintServiceTemplateValidatorImpl(private val bluePrintTypeValida
 
     var bluePrintContext: BluePrintContext? = null
     var error: BluePrintValidationError? = null
+    var paths: MutableList<String> = arrayListOf()
 
     override fun validate(bluePrintContext: BluePrintContext, error: BluePrintValidationError, name: String, serviceTemplate: ServiceTemplate) {
-        log.info("Validating Service Template..")
+        log.trace("Validating Service Template..")
         try {
             this.bluePrintContext = bluePrintContext
             this.error = error
@@ -47,12 +47,14 @@ open class BluePrintServiceTemplateValidatorImpl(private val bluePrintTypeValida
             serviceTemplate.nodeTypes?.let { validateNodeTypes(serviceTemplate.nodeTypes!!) }
             serviceTemplate.topologyTemplate?.let { validateTopologyTemplate(serviceTemplate.topologyTemplate!!) }
         } catch (e: Exception) {
-            throw BluePrintException(e, "failed to validate blueprint with message ${e.message}")
+            error.addError(BluePrintConstants.PATH_SERVICE_TEMPLATE, paths.joinToString(BluePrintConstants.PATH_DIVIDER), e.message!!)
         }
     }
 
     fun validateMetadata(metaDataMap: MutableMap<String, String>) {
 
+        paths.add(BluePrintConstants.PATH_METADATA)
+
         val templateName = metaDataMap[BluePrintConstants.METADATA_TEMPLATE_NAME]
         val templateVersion = metaDataMap[BluePrintConstants.METADATA_TEMPLATE_VERSION]
         val templateTags = metaDataMap[BluePrintConstants.METADATA_TEMPLATE_TAGS]
@@ -62,31 +64,42 @@ open class BluePrintServiceTemplateValidatorImpl(private val bluePrintTypeValida
         Preconditions.checkArgument(StringUtils.isNotBlank(templateVersion), "failed to get template version metadata")
         Preconditions.checkArgument(StringUtils.isNotBlank(templateTags), "failed to get template tags metadata")
         Preconditions.checkArgument(StringUtils.isNotBlank(templateAuthor), "failed to get template author metadata")
+
+        paths.removeAt(paths.lastIndex)
     }
 
 
     fun validateDataTypes(dataTypes: MutableMap<String, DataType>) {
+
+        paths.add(BluePrintConstants.PATH_DATA_TYPES)
         dataTypes.forEach { dataTypeName, dataType ->
             // Validate Single Data Type
             bluePrintTypeValidatorService.validateDataType(bluePrintContext!!, error!!, dataTypeName, dataType)
         }
+        paths.removeAt(paths.lastIndex)
     }
 
     fun validateArtifactTypes(artifactTypes: MutableMap<String, ArtifactType>) {
+        paths.add(BluePrintConstants.PATH_ARTIFACT_TYPES)
         artifactTypes.forEach { artifactName, artifactType ->
             // Validate Single Artifact Type
             bluePrintTypeValidatorService.validateArtifactType(bluePrintContext!!, error!!, artifactName, artifactType)
         }
+        paths.removeAt(paths.lastIndex)
     }
 
     fun validateNodeTypes(nodeTypes: MutableMap<String, NodeType>) {
+        paths.add(BluePrintConstants.PATH_NODE_TYPES)
         nodeTypes.forEach { nodeTypeName, nodeType ->
             // Validate Single Node Type
             bluePrintTypeValidatorService.validateNodeType(bluePrintContext!!, error!!, nodeTypeName, nodeType)
         }
+        paths.removeAt(paths.lastIndex)
     }
 
     fun validateTopologyTemplate(topologyTemplate: TopologyTemplate) {
+        paths.add(BluePrintConstants.PATH_TOPOLOGY_TEMPLATE)
         bluePrintTypeValidatorService.validateTopologyTemplate(bluePrintContext!!, error!!, "topologyTemplate", topologyTemplate)
+        paths.removeAt(paths.lastIndex)
     }
 }
\ No newline at end of file
index 7cddf27..411cdb4 100644 (file)
@@ -16,6 +16,8 @@
 
 package org.onap.ccsdk.apps.controllerblueprints.core.validation
 
+import com.att.eelf.configuration.EELFLogger
+import com.att.eelf.configuration.EELFManager
 import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException
 import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintValidationError
 import org.onap.ccsdk.apps.controllerblueprints.core.data.NodeTemplate
@@ -28,11 +30,16 @@ import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintContext
 
 open class BluePrintTopologyTemplateValidatorImpl(private val bluePrintTypeValidatorService: BluePrintTypeValidatorService) : BluePrintTopologyTemplateValidator {
 
+    private val log: EELFLogger = EELFManager.getInstance().getLogger(BluePrintServiceTemplateValidatorImpl::class.toString())
+
     var bluePrintContext: BluePrintContext? = null
     var error: BluePrintValidationError? = null
 
     override fun validate(bluePrintContext: BluePrintContext, error: BluePrintValidationError, name: String, topologyTemplate: TopologyTemplate) {
+        log.trace("Validating Topology Template..")
         this.bluePrintContext = bluePrintContext
+        this.error = error
+
         // Validate Inputs
         topologyTemplate.inputs?.let { validateInputs(topologyTemplate.inputs!!) }
         // Validate Node Templates
@@ -18,6 +18,7 @@ package org.onap.ccsdk.apps.controllerblueprints.core.validation
 
 import com.att.eelf.configuration.EELFLogger
 import com.att.eelf.configuration.EELFManager
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException
 import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintValidationError
 import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintTypeValidatorService
 import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintValidatorService
@@ -28,9 +29,12 @@ open class BluePrintValidatorServiceImpl(private val bluePrintTypeValidatorServi
 
     private val log: EELFLogger = EELFManager.getInstance().getLogger(BluePrintValidatorServiceImpl::class.toString())
 
-    override fun validateBluePrints(bluePrintContext: BluePrintContext, properties: MutableMap<String, Any>) {
-        log.info("Validation blueprints...")
+    override fun validateBluePrints(bluePrintContext: BluePrintContext, properties: MutableMap<String, Any>): Boolean {
         val error = BluePrintValidationError()
         bluePrintTypeValidatorService.validateServiceTemplate(bluePrintContext, error, "default", bluePrintContext.serviceTemplate)
+        if (error.errors.size > 0) {
+            throw BluePrintException("failed in blueprint validation : ${error.errors.joinToString("\n")}")
+        }
+        return true
     }
 }
index f813cc5..8ba6f72 100644 (file)
@@ -16,6 +16,9 @@
 
 package org.onap.ccsdk.apps.controllerblueprints.core.validation
 
+import com.att.eelf.configuration.EELFLogger
+import com.att.eelf.configuration.EELFManager
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants
 import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintValidationError
 import org.onap.ccsdk.apps.controllerblueprints.core.data.Workflow
 import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintTypeValidatorService
@@ -24,7 +27,30 @@ import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintContext
 
 open class BluePrintWorkflowValidatorImpl(private val bluePrintTypeValidatorService: BluePrintTypeValidatorService) : BluePrintWorkflowValidator {
 
-    override fun validate(bluePrintContext: BluePrintContext, error: BluePrintValidationError, name: String, type: Workflow) {
-        TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+    private val log: EELFLogger = EELFManager.getInstance().getLogger(BluePrintServiceTemplateValidatorImpl::class.toString())
+    var bluePrintContext: BluePrintContext? = null
+    var error: BluePrintValidationError? = null
+    var paths: MutableList<String> = arrayListOf()
+
+    override fun validate(bluePrintContext: BluePrintContext, error: BluePrintValidationError, workflowName: String, workflow: Workflow) {
+        log.info("Validating Workflow($workflowName)")
+
+        this.bluePrintContext = bluePrintContext
+        this.error = error
+
+        paths.add(workflowName)
+        paths.joinToString(BluePrintConstants.PATH_DIVIDER)
+
+        // Step Validation Start
+        paths.add("steps")
+        workflow.steps?.forEach { stepName, _ ->
+            paths.add(stepName)
+            paths.joinToString(BluePrintConstants.PATH_DIVIDER)
+            // TODO("Step Validation")
+            paths.removeAt(paths.lastIndex)
+        }
+        paths.removeAt(paths.lastIndex)
+        // Step Validation Ends
+        paths.removeAt(paths.lastIndex)
     }
 }
\ No newline at end of file
diff --git a/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/mock/MockBluePrintTypeValidatorService.kt b/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/mock/MockBluePrintTypeValidatorService.kt
new file mode 100644 (file)
index 0000000..4c174f9
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.apps.controllerblueprints.core.mock
+
+import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.*
+import org.onap.ccsdk.apps.controllerblueprints.core.validation.*
+
+class MockBluePrintTypeValidatorService : BluePrintTypeValidatorService {
+
+    override fun getServiceTemplateValidators(): List<BluePrintServiceTemplateValidator> {
+        return listOf(BluePrintServiceTemplateValidatorImpl(this))
+    }
+
+    override fun getDataTypeValidators(): List<BluePrintDataTypeValidator> {
+        return listOf(BluePrintDataTypeValidatorImpl(this))
+    }
+
+    override fun getArtifactTypeValidators(): List<BluePrintArtifactTypeValidator> {
+        return listOf(BluePrintArtifactTypeValidatorImpl(this))
+    }
+
+    override fun getNodeTypeValidators(): List<BluePrintNodeTypeValidator> {
+        return listOf(BluePrintNodeTypeValidatorImpl(this))
+    }
+
+    override fun getTopologyTemplateValidators(): List<BluePrintTopologyTemplateValidator> {
+        return listOf(BluePrintTopologyTemplateValidatorImpl(this))
+    }
+
+    override fun getNodeTemplateValidators(): List<BluePrintNodeTemplateValidator> {
+        return listOf(BluePrintNodeTemplateValidatorImpl(this))
+    }
+
+    override fun getWorkflowValidators(): List<BluePrintWorkflowValidator> {
+        return listOf(BluePrintWorkflowValidatorImpl(this))
+    }
+
+    override fun getPropertyDefinitionValidators(): List<BluePrintPropertyDefinitionValidator> {
+        return listOf(BluePrintPropertyDefinitionValidatorImpl(this))
+    }
+
+    override fun getAttributeDefinitionValidators(): List<BluePrintAttributeDefinitionValidator> {
+        return listOf(BluePrintAttributeDefinitionValidatorImpl(this))
+    }
+}
\ No newline at end of file
diff --git a/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/validation/BluePrintValidatorServiceImplTest.kt b/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/validation/BluePrintValidatorServiceImplTest.kt
new file mode 100644 (file)
index 0000000..ca238db
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.apps.controllerblueprints.core.validation
+
+import org.junit.Test
+import org.onap.ccsdk.apps.controllerblueprints.core.mock.MockBluePrintTypeValidatorService
+import org.onap.ccsdk.apps.controllerblueprints.core.utils.BluePrintMetadataUtils
+import kotlin.test.assertTrue
+
+class BluePrintValidatorServiceImplTest {
+
+    val blueprintBasePath: String = ("./../model-catalog/blueprint-model/starter-blueprint/baseconfiguration")
+
+
+    @Test
+    fun testValidateOfType() {
+        val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext(blueprintBasePath)
+
+        val mockBluePrintTypeValidatorService = MockBluePrintTypeValidatorService()
+
+        val defaultBluePrintValidatorService = BluePrintValidatorServiceImpl(mockBluePrintTypeValidatorService)
+
+        val valid = defaultBluePrintValidatorService.validateBluePrints(bluePrintContext, hashMapOf())
+
+        assertTrue(valid, "failed in blueprint Validation")
+
+    }
+}
+