aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/services/workflow-service/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'ms/blueprintsprocessor/modules/services/workflow-service/src/test')
-rw-r--r--ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/workflow/BlueprintServiceLogicTest.kt31
1 files changed, 29 insertions, 2 deletions
diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/workflow/BlueprintServiceLogicTest.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/workflow/BlueprintServiceLogicTest.kt
index 5c90852ee..6fe767ce2 100644
--- a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/workflow/BlueprintServiceLogicTest.kt
+++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/workflow/BlueprintServiceLogicTest.kt
@@ -16,11 +16,16 @@
package org.onap.ccsdk.apps.blueprintsprocessor.services.workflow
+import com.fasterxml.jackson.databind.JsonNode
import org.junit.Test
import org.junit.runner.RunWith
+import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ActionIdentifiers
+import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.CommonHeader
import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ExecutionServiceInput
import org.onap.ccsdk.apps.blueprintsprocessor.services.workflow.executor.ComponentExecuteNodeExecutor
import org.onap.ccsdk.apps.blueprintsprocessor.services.workflow.utils.SvcGraphUtils
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.apps.controllerblueprints.core.putJsonElement
import org.onap.ccsdk.apps.controllerblueprints.core.utils.BluePrintMetadataUtils
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
@@ -45,7 +50,7 @@ class BlueprintServiceLogicTest {
val graph = SvcGraphUtils.getSvcGraphFromClassPathFile("service-logic/one-component.xml")
val svcLogicContext = BlueprintSvcLogicContext()
svcLogicContext.setBluePrintRuntimeService(bluePrintRuntimeService)
- svcLogicContext.setRequest(ExecutionServiceInput())
+ svcLogicContext.setRequest(getDefaultExecutionServiceInput())
blueprintSvcLogicService.execute(graph, svcLogicContext)
}
@@ -55,8 +60,30 @@ class BlueprintServiceLogicTest {
val graph = SvcGraphUtils.getSvcGraphFromClassPathFile("service-logic/two-component.xml")
val svcLogicContext = BlueprintSvcLogicContext()
svcLogicContext.setBluePrintRuntimeService(bluePrintRuntimeService)
- svcLogicContext.setRequest(ExecutionServiceInput())
+ svcLogicContext.setRequest(getDefaultExecutionServiceInput())
blueprintSvcLogicService.execute(graph, svcLogicContext)
}
+
+ private fun getDefaultExecutionServiceInput(): ExecutionServiceInput {
+ val executionServiceInput = ExecutionServiceInput()
+ val commonHeader = CommonHeader()
+ commonHeader.requestId = "1234"
+ executionServiceInput.commonHeader = commonHeader
+
+ val actionIdentifiers = ActionIdentifiers()
+ actionIdentifiers.blueprintName = "baseconfiguration"
+ actionIdentifiers.blueprintVersion = "1.0.0"
+ actionIdentifiers.actionName = "activate"
+ executionServiceInput.actionIdentifiers = actionIdentifiers
+
+ val metaData: MutableMap<String, JsonNode> = hashMapOf()
+ metaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_STEP,"resource-assignment-py")
+ metaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE, "resource-assignment-py")
+ metaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_INTERFACE, "DefaultComponentNode")
+ metaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_OPERATION, "process")
+ executionServiceInput.metadata = metaData
+
+ return executionServiceInput
+ }
} \ No newline at end of file