From d2ec19b59ee0bdc1ba3a22baff5d0d30bd8a9e19 Mon Sep 17 00:00:00 2001 From: "Muthuramalingam, Brinda Santh(bs2796)" Date: Mon, 19 Nov 2018 12:48:31 -0500 Subject: Implement Base Jython Executor function. Change-Id: I3fb066a021de4a7b3aa1fce7f6c191bc3944fb51 Issue-ID: CCSDK-696 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) --- .../services/workflow/BlueprintServiceLogicTest.kt | 31 ++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'ms/blueprintsprocessor/modules/services/workflow-service/src/test') 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 = 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 -- cgit 1.2.3-korg