summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/inbounds/selfservice-api
diff options
context:
space:
mode:
authorAlexis de Talhouët <adetalhouet89@gmail.com>2019-01-12 15:48:20 -0500
committerAlexis de Talhouët <adetalhouet89@gmail.com>2019-01-18 13:56:01 -0500
commit125b60f22593467dd633c19a296b92ddcb4b260b (patch)
tree8c279361132219433e496eea5edf60ec25249072 /ms/blueprintsprocessor/modules/inbounds/selfservice-api
parent78702c12bd0b6cb8ec0fd621f27fa61c9a017fbe (diff)
Implement BluePrintCatalogService
Change-Id: Ifcb0d730daec4da747d704c270b72b991e01f474 Issue-ID: CCSDK-908 Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
Diffstat (limited to 'ms/blueprintsprocessor/modules/inbounds/selfservice-api')
-rw-r--r--ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandler.kt4
-rwxr-xr-xms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/mock/SelfServiceApiMocks.kt16
2 files changed, 9 insertions, 11 deletions
diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandler.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandler.kt
index 69758ecf..56a6393a 100644
--- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandler.kt
+++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandler.kt
@@ -40,10 +40,10 @@ class ExecutionServiceHandler(private val bluePrintCatalogService: BluePrintCata
val blueprintName = actionIdentifiers.blueprintName
val blueprintVersion = actionIdentifiers.blueprintVersion
- val basePath = bluePrintCatalogService.prepareBluePrint(blueprintName, blueprintVersion)
+ val basePath = bluePrintCatalogService.getFromDatabase(blueprintName, blueprintVersion)
log.info("blueprint base path $basePath")
- val blueprintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(requestId, basePath)
+ val blueprintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(requestId, basePath.toString())
return blueprintDGExecutionService.executeDirectedGraph(blueprintRuntimeService, executionServiceInput)
}
diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/mock/SelfServiceApiMocks.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/mock/SelfServiceApiMocks.kt
index 656d92f1..e8f25a89 100755
--- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/mock/SelfServiceApiMocks.kt
+++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/mock/SelfServiceApiMocks.kt
@@ -22,6 +22,9 @@ import org.onap.ccsdk.apps.blueprintsprocessor.services.workflow.BlueprintDGExec
import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintCatalogService
import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintRuntimeService
import org.springframework.stereotype.Service
+import java.io.File
+import java.nio.file.Path
+import java.nio.file.Paths
import kotlin.test.assertNotNull
@Service
@@ -38,22 +41,17 @@ class MockBlueprintDGExecutionService : BlueprintDGExecutionService {
@Service
class MockBluePrintCatalogService : BluePrintCatalogService {
-
- override fun uploadToDataBase(file: String, validate : Boolean): String {
+ override fun deleteFromDatabase(name: String, version: String) {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
- override fun downloadFromDataBase(name: String, version: String, path: String): String {
+ override fun saveToDatabase(blueprintFile: File, validate: Boolean): String {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
- override fun prepareBluePrint(name: String, version: String): String {
+ override fun getFromDatabase(name: String, version: String, extract: Boolean): Path {
assertNotNull(name, "failed to get blueprint Name")
assertNotNull(version, "failed to get blueprint version")
- return "./../../../../../components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration"
- }
-
- override fun downloadFromDataBase(uuid: String, path: String): String {
- TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ return Paths.get("./../../../../../components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration")
}
} \ No newline at end of file