diff options
Diffstat (limited to 'ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main')
3 files changed, 7 insertions, 4 deletions
diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BlueprintDesignTimeValidatorService.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BlueprintDesignTimeValidatorService.kt index fe3aeb1ed..aac1c2e97 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BlueprintDesignTimeValidatorService.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BlueprintDesignTimeValidatorService.kt @@ -17,6 +17,7 @@ package org.onap.ccsdk.cds.controllerblueprints.validation +import org.jetbrains.kotlin.utils.addToStdlib.ifNotEmpty import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeValidatorService @@ -57,9 +58,10 @@ open class BlueprintDesignTimeValidatorService( // Validate Resource Definitions validateResourceDefinitions(bluePrintRuntimeService) - if (bluePrintRuntimeService.getBlueprintError().errors.size > 0) { - throw BlueprintException("failed in blueprint validation : ${bluePrintRuntimeService.getBlueprintError().errors.joinToString("\n")}") + bluePrintRuntimeService.getBlueprintError().allErrors().ifNotEmpty { + throw BlueprintException("failed in blueprint validation : ${this.joinToString("\n")}") } + return true } diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BlueprintServiceTemplateValidatorImpl.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BlueprintServiceTemplateValidatorImpl.kt index b9450e66d..137e6e6b9 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BlueprintServiceTemplateValidatorImpl.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BlueprintServiceTemplateValidatorImpl.kt @@ -58,7 +58,7 @@ open class BlueprintServiceTemplateValidatorImpl(private val bluePrintTypeValida serviceTemplate.topologyTemplate?.let { validateTopologyTemplate(serviceTemplate.topologyTemplate!!) } } catch (e: Exception) { log.error("failed in blueprint service template validation", e) - error.addError(BlueprintConstants.PATH_SERVICE_TEMPLATE, paths.joinToString(BlueprintConstants.PATH_DIVIDER), e.message!!) + error.addError(BlueprintConstants.PATH_SERVICE_TEMPLATE, paths.joinToString(BlueprintConstants.PATH_DIVIDER), e.message!!, "BlueprintServiceTemplateValidator") } } diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BlueprintWorkflowValidatorImpl.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BlueprintWorkflowValidatorImpl.kt index 8f9cb01c5..bff09fc83 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BlueprintWorkflowValidatorImpl.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BlueprintWorkflowValidatorImpl.kt @@ -76,7 +76,8 @@ open class BlueprintWorkflowValidatorImpl(private val bluePrintTypeValidatorServ .addError( "Failed to validate Workflow($workflowName)'s step($stepName)'s " + "definition", - paths.joinToString(BlueprintConstants.PATH_DIVIDER), e.message!! + paths.joinToString(BlueprintConstants.PATH_DIVIDER), e.message!!, + "BlueprintWorkflowValidatorImpl" ) } } |