summaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules/blueprint-validation/src/test
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh <brindasanth@in.ibm.com>2019-02-27 20:16:47 -0500
committerMuthuramalingam, Brinda Santh <brindasanth@in.ibm.com>2019-03-11 09:13:22 -0400
commita5130dcf4e70f394c1432baefffc198882f04dc1 (patch)
treed0eaa477c7795db5066726def23aa6bc2cd4e363 /ms/controllerblueprints/modules/blueprint-validation/src/test
parentfc3e34836f7be8eda28a8f996d733e8dfca01450 (diff)
Add blueprint runtime validator
Change-Id: I9e2aa1aec392fc4191d547115fa90e8811f0f9e9 Issue-ID: CCSDK-1110 Signed-off-by: Muthuramalingam, Brinda Santh <brindasanth@in.ibm.com>
Diffstat (limited to 'ms/controllerblueprints/modules/blueprint-validation/src/test')
-rw-r--r--ms/controllerblueprints/modules/blueprint-validation/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/validation/BluePrintDesignTimeValidatorServiceTest.kt7
1 files changed, 6 insertions, 1 deletions
diff --git a/ms/controllerblueprints/modules/blueprint-validation/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/validation/BluePrintDesignTimeValidatorServiceTest.kt b/ms/controllerblueprints/modules/blueprint-validation/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/validation/BluePrintDesignTimeValidatorServiceTest.kt
index 43c3e0e3e..3fc918e60 100644
--- a/ms/controllerblueprints/modules/blueprint-validation/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/validation/BluePrintDesignTimeValidatorServiceTest.kt
+++ b/ms/controllerblueprints/modules/blueprint-validation/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/validation/BluePrintDesignTimeValidatorServiceTest.kt
@@ -1,5 +1,6 @@
/*
* Copyright © 2017-2018 AT&T Intellectual Property.
+ * Modifications Copyright © 2019 IBM.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,6 +28,7 @@ import org.onap.ccsdk.apps.controllerblueprints.core.data.Workflow
import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintContext
import org.onap.ccsdk.apps.controllerblueprints.core.service.DefaultBluePrintRuntimeService
import org.onap.ccsdk.apps.controllerblueprints.core.utils.BluePrintMetadataUtils
+import org.onap.ccsdk.apps.controllerblueprints.validation.extension.ResourceDefinitionValidator
import kotlin.test.assertEquals
import kotlin.test.assertTrue
@@ -35,11 +37,14 @@ class BluePrintDesignTimeValidatorServiceTest {
private val blueprintBasePath: String = ("./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration")
private val bluePrintRuntime = BluePrintMetadataUtils.getBluePrintRuntime("1234", blueprintBasePath)
private val mockBluePrintTypeValidatorService = MockBluePrintTypeValidatorService()
- private val defaultBluePrintValidatorService = BluePrintDesignTimeValidatorService(mockBluePrintTypeValidatorService)
+ private val resourceDefinitionValidator = mockk<ResourceDefinitionValidator>()
+ private val defaultBluePrintValidatorService = BluePrintDesignTimeValidatorService(mockBluePrintTypeValidatorService, resourceDefinitionValidator)
private val workflowValidator = BluePrintWorkflowValidatorImpl(mockBluePrintTypeValidatorService)
@Test
fun testValidateOfType() {
+ every { resourceDefinitionValidator.validate(bluePrintRuntime, any(), any()) } returns Unit
+
val valid = defaultBluePrintValidatorService.validateBluePrints(bluePrintRuntime)
assertTrue(valid, "failed in blueprint Validation")
}