summaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules/blueprint-core/src/test
diff options
context:
space:
mode:
authorBrinda Santh <brindasanth@in.ibm.com>2019-05-17 10:07:14 -0400
committerSteve Siani <alphonse.steve.siani.djissitchi@ibm.com>2019-05-23 00:15:54 -0400
commitbcc6c4dfe9db06e0dab22472b11a4939255091e5 (patch)
tree62a4bbcf1ec53d9cbc165bcf7dfc9a04211f67de /ms/controllerblueprints/modules/blueprint-core/src/test
parent145662ff6a41e0e46a23e8eedf53f30581f8ab64 (diff)
Add cli test blueprints
Change-Id: Ieab385f5e4ae60cca3d86f22c4304e4867e6fa96 Issue-ID: CCSDK-1335 Signed-off-by: Brinda Santh <brindasanth@in.ibm.com>
Diffstat (limited to 'ms/controllerblueprints/modules/blueprint-core/src/test')
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateServiceTest.kt23
1 files changed, 11 insertions, 12 deletions
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateServiceTest.kt b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateServiceTest.kt
index e4227180b..02505acad 100644
--- a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateServiceTest.kt
+++ b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateServiceTest.kt
@@ -21,6 +21,7 @@ package org.onap.ccsdk.cds.controllerblueprints.core.service
import kotlinx.coroutines.runBlocking
import org.junit.Test
import org.junit.runner.RunWith
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.springframework.test.context.junit4.SpringRunner
@@ -40,13 +41,13 @@ class BluePrintTemplateServiceTest {
@Test
fun testVelocityGeneratedContent() {
- runBlocking {
- val template = JacksonUtils.getClassPathFileContent("templates/base-config-velocity-template.vtl")
- val json = JacksonUtils.getClassPathFileContent("templates/base-config-data-velocity.json")
+ runBlocking {
+ 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)
- assertNotNull(content, "failed to generate content for velocity template")
- }
+ val content = BluePrintVelocityTemplateService.generateContent(template, json)
+ assertNotNull(content, "failed to generate content for velocity template")
+ }
}
@@ -68,13 +69,12 @@ class BluePrintTemplateServiceTest {
@Test
fun testVelocityGeneratedContentFromFiles() {
runBlocking {
- val bluePrintTemplateService = BluePrintTemplateService(blueprintRuntime,
- "resource-assignment", "baseconfig-template")
+ val bluePrintTemplateService = BluePrintTemplateService()
val templateFile = "templates/base-config-velocity-template.vtl"
val jsonFile = "templates/base-config-data-velocity.json"
val content = bluePrintTemplateService.generateContentFromFiles(
- templateFile, jsonFile, false, mutableMapOf())
+ templateFile, BluePrintConstants.ARTIFACT_VELOCITY_TYPE_NAME, jsonFile, false, mutableMapOf())
assertNotNull(content, "failed to generate content for velocity template")
}
@@ -86,14 +86,13 @@ class BluePrintTemplateServiceTest {
var element: MutableMap<String, Any> = mutableMapOf()
element["additional_array"] = arrayListOf(hashMapOf("name" to "Element1", "location" to "Region0"), hashMapOf("name" to "Element2", "location" to "Region1"))
- val bluePrintTemplateService = BluePrintTemplateService(blueprintRuntime,
- "resource-assignment", "another-template")
+ val bluePrintTemplateService = BluePrintTemplateService()
val templateFile = "templates/base-config-jinja-template.jinja"
val jsonFile = "templates/base-config-data-jinja.json"
val content = bluePrintTemplateService.generateContentFromFiles(
- templateFile,
+ templateFile, BluePrintConstants.ARTIFACT_JINJA_TYPE_NAME,
jsonFile, false, element)
assertNotNull(content, "failed to generate content for velocity template")
}