aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/inbounds/designer-api/src
diff options
context:
space:
mode:
authorBrinda Santh <bs2796@att.com>2019-12-11 18:32:24 -0500
committerBrinda Santh <bs2796@att.com>2019-12-11 18:32:24 -0500
commitd4fadc988246eb172ce8333bb3a06443591c5f19 (patch)
tree19701b12c7f3008acb6a62772458ea4b47e043d8 /ms/blueprintsprocessor/modules/inbounds/designer-api/src
parenta30e1864fadad70c797ca1248a3c1272300a6e2b (diff)
Metadata for name, version, tags and type
Mandate Tosca.meta template name, version, type and tags. Auto copy metadata from Tosca.meta to ServiceTemplate definitions. Optimize Blueprint context and runtime creation from file path. Removed attached CBA zip file in test repository dirs Issue-ID: CCSDK-1992 Signed-off-by: Brinda Santh <bs2796@att.com> Change-Id: I5d9d7a4599234a38d431328dbd9b74bd831e0115
Diffstat (limited to 'ms/blueprintsprocessor/modules/inbounds/designer-api/src')
-rw-r--r--ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt19
-rw-r--r--ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintEnhancerServiceImplTest.kt18
-rw-r--r--ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/test-cba.zipbin9554 -> 0 bytes
3 files changed, 19 insertions, 18 deletions
diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt
index 582fd9a41..35e440554 100644
--- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt
+++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt
@@ -30,6 +30,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.TokenAuthGrpcClientSe
import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers
import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.compress
import org.onap.ccsdk.cds.controllerblueprints.core.deleteDir
import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile
import org.onap.ccsdk.cds.controllerblueprints.management.api.BluePrintBootstrapInput
@@ -66,9 +67,15 @@ class BluePrintManagementGRPCHandlerTest {
@BeforeTest
fun init() {
+
+ deleteDir("target", "blueprints")
+
+ // Create sample CBA zip
+ normalizedFile("./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration")
+ .compress(normalizedFile("./target/blueprints/generated-cba.zip"))
+
// Create a server, add service, start, and register for automatic graceful shutdown.
grpcServerRule.serviceRegistry.addService(bluePrintManagementGRPCHandler)
- deleteDir("target", "blueprints")
}
@AfterTest
@@ -84,7 +91,7 @@ class BluePrintManagementGRPCHandlerTest {
val bootstrapOutput = blockingStub.bootstrapBlueprint(req)
assertEquals(200, bootstrapOutput.status.code)
assertTrue(
- bootstrapOutput.status.message.contentEquals(BluePrintConstants.STATUS_SUCCESS),
+ bootstrapOutput.status.message!!.contentEquals(BluePrintConstants.STATUS_SUCCESS),
"failed to get success status"
)
assertEquals(id, bootstrapOutput.commonHeader.requestId)
@@ -99,7 +106,7 @@ class BluePrintManagementGRPCHandlerTest {
assertEquals(200, output.status.code)
assertTrue(
- output.status.message.contentEquals(BluePrintConstants.STATUS_SUCCESS),
+ output.status.message!!.contentEquals(BluePrintConstants.STATUS_SUCCESS),
"failed to get success status"
)
assertEquals(id, output.commonHeader.requestId)
@@ -110,7 +117,7 @@ class BluePrintManagementGRPCHandlerTest {
val downloadOutput = blockingStub.downloadBlueprint(downloadReq)
assertEquals(200, downloadOutput.status.code)
assertTrue(
- downloadOutput.status.message.contentEquals(BluePrintConstants.STATUS_SUCCESS),
+ downloadOutput.status.message!!.contentEquals(BluePrintConstants.STATUS_SUCCESS),
"failed to get success status"
)
assertNotNull(downloadOutput.fileChunk?.chunk, "failed to get cba file chunks")
@@ -126,7 +133,7 @@ class BluePrintManagementGRPCHandlerTest {
var output = blockingStub.uploadBlueprint(req)
assertEquals(200, output.status.code)
assertTrue(
- output.status.message.contentEquals(BluePrintConstants.STATUS_SUCCESS),
+ output.status.message!!.contentEquals(BluePrintConstants.STATUS_SUCCESS),
"failed to get success status"
)
assertEquals(id, output.commonHeader.requestId)
@@ -174,7 +181,7 @@ class BluePrintManagementGRPCHandlerTest {
}
private fun createUploadInputRequest(id: String, action: String): BluePrintUploadInput {
- val file = normalizedFile("./src/test/resources/test-cba.zip")
+ val file = normalizedFile("./target/blueprints/generated-cba.zip")
assertTrue(file.exists(), "couldnt get file ${file.absolutePath}")
val commonHeader = CommonHeader
diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintEnhancerServiceImplTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintEnhancerServiceImplTest.kt
index 2762725fa..a866dcad3 100644
--- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintEnhancerServiceImplTest.kt
+++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintEnhancerServiceImplTest.kt
@@ -65,34 +65,28 @@ class BluePrintEnhancerServiceImplTest {
resourceDictionaryLoadService.loadPathsResourceDictionary(dictPaths)
testBaseConfigEnhancementAndValidation()
- testVFWEnhancementAndValidation()
testGoldenEnhancementAndValidation()
testRemoteScriptsEnhancementAndValidation()
testCapabilityCliEnhancementAndValidation()
}
}
- fun testBaseConfigEnhancementAndValidation() {
+ private fun testBaseConfigEnhancementAndValidation() {
val basePath = "./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
testComponentInvokeEnhancementAndValidation(basePath, "base-enhance")
}
- fun testVFWEnhancementAndValidation() {
- val basePath = "./../../../../../components/model-catalog/blueprint-model/service-blueprint/vFW"
- testComponentInvokeEnhancementAndValidation(basePath, "vFW-enhance")
- }
-
- fun testGoldenEnhancementAndValidation() {
+ private fun testGoldenEnhancementAndValidation() {
val basePath = "./../../../../../components/model-catalog/blueprint-model/test-blueprint/golden"
testComponentInvokeEnhancementAndValidation(basePath, "golden-enhance")
}
- fun testRemoteScriptsEnhancementAndValidation() {
+ private fun testRemoteScriptsEnhancementAndValidation() {
val basePath = "./../../../../../components/model-catalog/blueprint-model/test-blueprint/remote_scripts"
testComponentInvokeEnhancementAndValidation(basePath, "remote_scripts-enhance")
}
- fun testCapabilityCliEnhancementAndValidation() {
+ private fun testCapabilityCliEnhancementAndValidation() {
val basePath = "./../../../../../components/model-catalog/blueprint-model/test-blueprint/capability_cli"
testComponentInvokeEnhancementAndValidation(basePath, "capability_cli-enhance")
}
@@ -111,8 +105,8 @@ class BluePrintEnhancerServiceImplTest {
Assert.assertTrue("blueprint($basePath) validation failed ", valid)
// Enable this to get the enhanced zip file
- // val compressFile = normalizedFile("target/blueprints/enrichment", "$targetDirName.zip")
- // normalizedFile(targetPath).compress(compressFile)
+ // val compressFile = normalizedFile("target/blueprints/enrichment", "$targetDirName.zip")
+ // normalizedFile(targetPath).compress(compressFile)
deleteDir(targetPath)
}
diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/test-cba.zip b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/test-cba.zip
deleted file mode 100644
index 785ec6c00..000000000
--- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/test-cba.zip
+++ /dev/null
Binary files differ