aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/services/workflow-service
diff options
context:
space:
mode:
Diffstat (limited to 'ms/blueprintsprocessor/modules/services/workflow-service')
-rw-r--r--ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BluePrintWorkflowExecutionServiceImpl.kt (renamed from ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintWorkflowExecutionServiceImpl.kt)36
-rw-r--r--ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintSvcLogicContext.kt8
-rw-r--r--ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintSvcLogicService.kt8
-rw-r--r--ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ComponentWorkflowExecutionService.kt10
-rw-r--r--ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionService.kt10
-rw-r--r--ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ImperativeWorkflowExecutionService.kt44
-rw-r--r--ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/NodeTemplateExecutionService.kt20
-rw-r--r--ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/executor/ComponentExecuteNodeExecutor.kt2
-rw-r--r--ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BluePrintWorkflowExecutionServiceImplTest.kt (renamed from ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintWorkflowExecutionServiceImplTest.kt)64
-rw-r--r--ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintServiceLogicTest.kt24
-rw-r--r--ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionServiceTest.kt18
-rw-r--r--ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ImperativeWorkflowExecutionServiceTest.kt24
-rw-r--r--ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/NodeTemplateExecutionServiceTest.kt18
-rw-r--r--ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/mock/MockComponentFunction.kt4
14 files changed, 145 insertions, 145 deletions
diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintWorkflowExecutionServiceImpl.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BluePrintWorkflowExecutionServiceImpl.kt
index 5a175b056..0f8007658 100644
--- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintWorkflowExecutionServiceImpl.kt
+++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BluePrintWorkflowExecutionServiceImpl.kt
@@ -19,26 +19,26 @@ package org.onap.ccsdk.cds.blueprintsprocessor.services.workflow
import com.fasterxml.jackson.databind.JsonNode
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutput
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.asObjectNode
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintWorkflowExecutionService
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintWorkflowExecutionService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.slf4j.LoggerFactory
import org.springframework.stereotype.Service
@Service("bluePrintWorkflowExecutionService")
-open class BlueprintWorkflowExecutionServiceImpl(
+open class BluePrintWorkflowExecutionServiceImpl(
private val componentWorkflowExecutionService: ComponentWorkflowExecutionService,
private val dgWorkflowExecutionService: DGWorkflowExecutionService,
private val imperativeWorkflowExecutionService: ImperativeWorkflowExecutionService
-) : BlueprintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput> {
+) : BluePrintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput> {
- private val log = LoggerFactory.getLogger(BlueprintWorkflowExecutionServiceImpl::class.java)!!
+ private val log = LoggerFactory.getLogger(BluePrintWorkflowExecutionServiceImpl::class.java)!!
- override suspend fun executeBlueprintWorkflow(
- bluePrintRuntimeService: BlueprintRuntimeService<*>,
+ override suspend fun executeBluePrintWorkflow(
+ bluePrintRuntimeService: BluePrintRuntimeService<*>,
executionServiceInput: ExecutionServiceInput,
properties: MutableMap<String, Any>
): ExecutionServiceOutput {
@@ -50,19 +50,19 @@ open class BlueprintWorkflowExecutionServiceImpl(
// Assign Workflow inputs
// check if request structure exists
if (!executionServiceInput.payload.has("$workflowName-request")) {
- throw BlueprintProcessorException("Input request missing the expected '$workflowName-request' block!")
+ throw BluePrintProcessorException("Input request missing the expected '$workflowName-request' block!")
}
val input = executionServiceInput.payload.get("$workflowName-request")
bluePrintRuntimeService.assignWorkflowInputs(workflowName, input)
val workflow = bluePrintContext.workflowByName(workflowName)
- val steps = workflow.steps ?: throw BlueprintProcessorException("could't get steps for workflow($workflowName)")
+ val steps = workflow.steps ?: throw BluePrintProcessorException("could't get steps for workflow($workflowName)")
/** If workflow has multiple steps, then it is imperative workflow */
val executionServiceOutput: ExecutionServiceOutput = if (steps.size > 1) {
imperativeWorkflowExecutionService
- .executeBlueprintWorkflow(bluePrintRuntimeService, executionServiceInput, properties)
+ .executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, properties)
} else {
// Get the DG Node Template
val nodeTemplateName = bluePrintContext.workflowFirstStepNodeTemplate(workflowName)
@@ -72,16 +72,16 @@ open class BlueprintWorkflowExecutionServiceImpl(
log.info("Executing workflow($workflowName) NodeTemplate($nodeTemplateName), derived from($derivedFrom)")
/** Return ExecutionServiceOutput based on DG node or Component Node */
when {
- derivedFrom.startsWith(BlueprintConstants.MODEL_TYPE_NODE_COMPONENT, true) -> {
+ derivedFrom.startsWith(BluePrintConstants.MODEL_TYPE_NODE_COMPONENT, true) -> {
componentWorkflowExecutionService
- .executeBlueprintWorkflow(bluePrintRuntimeService, executionServiceInput, properties)
+ .executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, properties)
}
- derivedFrom.startsWith(BlueprintConstants.MODEL_TYPE_NODE_WORKFLOW, true) -> {
+ derivedFrom.startsWith(BluePrintConstants.MODEL_TYPE_NODE_WORKFLOW, true) -> {
dgWorkflowExecutionService
- .executeBlueprintWorkflow(bluePrintRuntimeService, executionServiceInput, properties)
+ .executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, properties)
}
else -> {
- throw BlueprintProcessorException(
+ throw BluePrintProcessorException(
"couldn't execute workflow($workflowName) step mapped " +
"to node template($nodeTemplateName) derived from($derivedFrom)"
)
@@ -97,7 +97,7 @@ open class BlueprintWorkflowExecutionServiceImpl(
workflowOutputs = bluePrintRuntimeService.resolveWorkflowOutputs(workflowName)
} catch (e: RuntimeException) {
log.error("Failed to resolve outputs for workflow: $workflowName", e)
- e.message?.let { bluePrintRuntimeService.getBlueprintError().addError(it, "workflow") }
+ e.message?.let { bluePrintRuntimeService.getBluePrintError().addError(it, "workflow") }
}
// Set the Response Payload
diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintSvcLogicContext.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintSvcLogicContext.kt
index 64bb70e63..044e8cf53 100644
--- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintSvcLogicContext.kt
+++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintSvcLogicContext.kt
@@ -16,20 +16,20 @@
package org.onap.ccsdk.cds.blueprintsprocessor.services.workflow
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService
import org.onap.ccsdk.sli.core.sli.SvcLogicContext
class BlueprintSvcLogicContext : SvcLogicContext() {
- private var bluePrintRuntimeService: BlueprintRuntimeService<*>? = null
+ private var bluePrintRuntimeService: BluePrintRuntimeService<*>? = null
private var request: Any? = null
private var response: Any? = null
- fun getBlueprintService(): BlueprintRuntimeService<*> {
+ fun getBluePrintService(): BluePrintRuntimeService<*> {
return this.bluePrintRuntimeService!!
}
- fun setBlueprintRuntimeService(bluePrintRuntimeService: BlueprintRuntimeService<*>) {
+ fun setBluePrintRuntimeService(bluePrintRuntimeService: BluePrintRuntimeService<*>) {
this.bluePrintRuntimeService = bluePrintRuntimeService
}
diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintSvcLogicService.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintSvcLogicService.kt
index ebad1501b..4efe9f12d 100644
--- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintSvcLogicService.kt
+++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintSvcLogicService.kt
@@ -17,7 +17,7 @@
package org.onap.ccsdk.cds.blueprintsprocessor.services.workflow
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService
import org.onap.ccsdk.sli.core.sli.ExitNodeException
import org.onap.ccsdk.sli.core.sli.SvcLogicContext
import org.onap.ccsdk.sli.core.sli.SvcLogicException
@@ -47,7 +47,7 @@ interface BlueprintSvcLogicService : SvcLogicServiceBase {
fun unRegisterExecutors(name: String)
- suspend fun execute(graph: SvcLogicGraph, bluePrintRuntimeService: BlueprintRuntimeService<*>, input: Any): Any
+ suspend fun execute(graph: SvcLogicGraph, bluePrintRuntimeService: BluePrintRuntimeService<*>, input: Any): Any
override fun execute(module: String, rpc: String, version: String, mode: String, ctx: SvcLogicContext): SvcLogicContext {
TODO("not implemented")
@@ -104,12 +104,12 @@ class DefaultBlueprintSvcLogicService : BlueprintSvcLogicService {
override suspend fun execute(
graph: SvcLogicGraph,
- bluePrintRuntimeService: BlueprintRuntimeService<*>,
+ bluePrintRuntimeService: BluePrintRuntimeService<*>,
input: Any
): Any {
// Initialise BlueprintSvcLogic Context with Blueprint Runtime Service and Input Request
val blueprintSvcLogicContext = BlueprintSvcLogicContext()
- blueprintSvcLogicContext.setBlueprintRuntimeService(bluePrintRuntimeService)
+ blueprintSvcLogicContext.setBluePrintRuntimeService(bluePrintRuntimeService)
blueprintSvcLogicContext.setRequest(input)
// Execute the Graph
execute(graph, blueprintSvcLogicContext)
diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ComponentWorkflowExecutionService.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ComponentWorkflowExecutionService.kt
index 322180893..397dd3ffd 100644
--- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ComponentWorkflowExecutionService.kt
+++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ComponentWorkflowExecutionService.kt
@@ -18,16 +18,16 @@ package org.onap.ccsdk.cds.blueprintsprocessor.services.workflow
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutput
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintWorkflowExecutionService
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintWorkflowExecutionService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService
import org.springframework.stereotype.Service
@Service("componentWorkflowExecutionService")
open class ComponentWorkflowExecutionService(private val nodeTemplateExecutionService: NodeTemplateExecutionService) :
- BlueprintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput> {
+ BluePrintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput> {
- override suspend fun executeBlueprintWorkflow(
- bluePrintRuntimeService: BlueprintRuntimeService<*>,
+ override suspend fun executeBluePrintWorkflow(
+ bluePrintRuntimeService: BluePrintRuntimeService<*>,
executionServiceInput: ExecutionServiceInput,
properties: MutableMap<String, Any>
): ExecutionServiceOutput {
diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionService.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionService.kt
index efcae4aee..d40b8f144 100644
--- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionService.kt
+++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionService.kt
@@ -21,20 +21,20 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInpu
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutput
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.StepData
import org.onap.ccsdk.cds.blueprintsprocessor.services.workflow.utils.SvcGraphUtils
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintWorkflowExecutionService
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintWorkflowExecutionService
import org.onap.ccsdk.cds.controllerblueprints.core.normalizedPathName
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService
import org.slf4j.LoggerFactory
import org.springframework.stereotype.Service
@Service("dgWorkflowExecutionService")
open class DGWorkflowExecutionService(private val blueprintSvcLogicService: BlueprintSvcLogicService) :
- BlueprintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput> {
+ BluePrintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput> {
private val log = LoggerFactory.getLogger(DGWorkflowExecutionService::class.java)
- override suspend fun executeBlueprintWorkflow(
- bluePrintRuntimeService: BlueprintRuntimeService<*>,
+ override suspend fun executeBluePrintWorkflow(
+ bluePrintRuntimeService: BluePrintRuntimeService<*>,
executionServiceInput: ExecutionServiceInput,
properties: MutableMap<String, Any>
): ExecutionServiceOutput {
diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ImperativeWorkflowExecutionService.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ImperativeWorkflowExecutionService.kt
index 29019b7cc..b8350f4f1 100644
--- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ImperativeWorkflowExecutionService.kt
+++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ImperativeWorkflowExecutionService.kt
@@ -22,19 +22,19 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInpu
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutput
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.Status
import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException
import org.onap.ccsdk.cds.controllerblueprints.core.MDCContext
import org.onap.ccsdk.cds.controllerblueprints.core.asGraph
import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty
import org.onap.ccsdk.cds.controllerblueprints.core.data.EdgeLabel
import org.onap.ccsdk.cds.controllerblueprints.core.data.Graph
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintWorkflowExecutionService
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintWorkflowExecutionService
import org.onap.ccsdk.cds.controllerblueprints.core.isAcyclic
import org.onap.ccsdk.cds.controllerblueprints.core.logger
-import org.onap.ccsdk.cds.controllerblueprints.core.service.AbstractBlueprintWorkFlowService
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.AbstractBluePrintWorkFlowService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService
import org.onap.ccsdk.cds.controllerblueprints.core.service.NodeExecuteMessage
import org.onap.ccsdk.cds.controllerblueprints.core.service.NodeSkipMessage
import org.onap.ccsdk.cds.controllerblueprints.core.service.WorkflowExecuteMessage
@@ -45,10 +45,10 @@ import kotlin.coroutines.CoroutineContext
class ImperativeWorkflowExecutionService(
private val nodeTemplateExecutionService: NodeTemplateExecutionService
) :
- BlueprintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput> {
+ BluePrintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput> {
- override suspend fun executeBlueprintWorkflow(
- bluePrintRuntimeService: BlueprintRuntimeService<*>,
+ override suspend fun executeBluePrintWorkflow(
+ bluePrintRuntimeService: BluePrintRuntimeService<*>,
executionServiceInput: ExecutionServiceInput,
properties: MutableMap<String, Any>
): ExecutionServiceOutput {
@@ -60,11 +60,11 @@ class ImperativeWorkflowExecutionService(
val graph = bluePrintContext.workflowByName(workflowName).asGraph()
if (!graph.isAcyclic()) {
- throw BlueprintException("Imperative workflow must be acyclic. Check on_success/on_failure for circular references")
+ throw BluePrintException("Imperative workflow must be acyclic. Check on_success/on_failure for circular references")
}
return coroutineScope {
- ImperativeBlueprintWorkflowService(
+ ImperativeBluePrintWorkflowService(
nodeTemplateExecutionService,
this.coroutineContext[MDCContext]
)
@@ -72,21 +72,21 @@ class ImperativeWorkflowExecutionService(
}
}
-open class ImperativeBlueprintWorkflowService(private val nodeTemplateExecutionService: NodeTemplateExecutionService, private val mdcContext: CoroutineContext?) :
- AbstractBlueprintWorkFlowService<ExecutionServiceInput, ExecutionServiceOutput>() {
+open class ImperativeBluePrintWorkflowService(private val nodeTemplateExecutionService: NodeTemplateExecutionService, private val mdcContext: CoroutineContext?) :
+ AbstractBluePrintWorkFlowService<ExecutionServiceInput, ExecutionServiceOutput>() {
final override val coroutineContext: CoroutineContext
get() = mdcContext?.let { super.coroutineContext + it } ?: super.coroutineContext
- val log = logger(ImperativeBlueprintWorkflowService::class)
+ val log = logger(ImperativeBluePrintWorkflowService::class)
- lateinit var bluePrintRuntimeService: BlueprintRuntimeService<*>
+ lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*>
lateinit var executionServiceInput: ExecutionServiceInput
lateinit var workflowName: String
override suspend fun executeWorkflow(
graph: Graph,
- bluePrintRuntimeService: BlueprintRuntimeService<*>,
+ bluePrintRuntimeService: BluePrintRuntimeService<*>,
input: ExecutionServiceInput
): ExecutionServiceOutput {
this.graph = graph
@@ -100,7 +100,7 @@ open class ImperativeBlueprintWorkflowService(private val nodeTemplateExecutionS
if (!workflowActor.isClosedForSend) {
workflowActor.send(startMessage)
} else {
- throw BlueprintProcessorException("workflow($workflowActor) actor is closed")
+ throw BluePrintProcessorException("workflow($workflowActor) actor is closed")
}
return output.await()
}
@@ -114,12 +114,12 @@ open class ImperativeBlueprintWorkflowService(private val nodeTemplateExecutionS
if (exceptions.isNotEmpty()) {
exceptions.forEach {
val errorMessage = it.message ?: ""
- bluePrintRuntimeService.getBlueprintError().addError(errorMessage, "workflow")
+ bluePrintRuntimeService.getBluePrintError().addError(errorMessage, "workflow")
log.error("workflow($workflowId) exception :", it)
}
- message = BlueprintConstants.STATUS_FAILURE
+ message = BluePrintConstants.STATUS_FAILURE
} else {
- message = BlueprintConstants.STATUS_SUCCESS
+ message = BluePrintConstants.STATUS_SUCCESS
}
eventType = EventType.EVENT_COMPONENT_EXECUTED.name
}
@@ -162,9 +162,9 @@ open class ImperativeBlueprintWorkflowService(private val nodeTemplateExecutionS
val executionServiceOutput = nodeTemplateExecutionService
.executeNodeTemplate(bluePrintRuntimeService, node.id, nodeTemplateName, nodeInput)
- if (executionServiceOutput.status.message == BlueprintConstants.STATUS_FAILURE) {
+ if (executionServiceOutput.status.message == BluePrintConstants.STATUS_FAILURE) {
// Clear step errors so that the workflow does not fail
- bluePrintRuntimeService.getBlueprintError().stepErrors(node.id)?.clear()
+ bluePrintRuntimeService.getBluePrintError().stepErrors(node.id)?.clear()
return EdgeLabel.FAILURE
}
diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/NodeTemplateExecutionService.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/NodeTemplateExecutionService.kt
index ff8f5b8cf..88799d102 100644
--- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/NodeTemplateExecutionService.kt
+++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/NodeTemplateExecutionService.kt
@@ -20,23 +20,23 @@ import com.fasterxml.jackson.databind.JsonNode
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutput
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.StepData
-import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterService
+import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BluePrintClusterService
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive
import org.onap.ccsdk.cds.controllerblueprints.core.data.Implementation
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService
import org.slf4j.LoggerFactory
import org.springframework.stereotype.Service
@Service
-open class NodeTemplateExecutionService(private val bluePrintClusterService: BlueprintClusterService) {
+open class NodeTemplateExecutionService(private val bluePrintClusterService: BluePrintClusterService) {
private val log = LoggerFactory.getLogger(NodeTemplateExecutionService::class.java)!!
suspend fun executeNodeTemplate(
- bluePrintRuntimeService: BlueprintRuntimeService<*>,
+ bluePrintRuntimeService: BluePrintRuntimeService<*>,
stepName: String,
nodeTemplateName: String,
executionServiceInput: ExecutionServiceInput
@@ -63,7 +63,7 @@ open class NodeTemplateExecutionService(private val bluePrintClusterService: Blu
)
// Get the Component Instance
- val plugin = BlueprintDependencyService.instance<AbstractComponentFunction>(componentName)
+ val plugin = BluePrintDependencyService.instance<AbstractComponentFunction>(componentName)
// Set the Blueprint Services
plugin.bluePrintRuntimeService = bluePrintRuntimeService
plugin.bluePrintClusterService = bluePrintClusterService
@@ -79,9 +79,9 @@ open class NodeTemplateExecutionService(private val bluePrintClusterService: Blu
// Populate Step Meta Data
val stepInputs: MutableMap<String, JsonNode> = hashMapOf()
- stepInputs[BlueprintConstants.PROPERTY_CURRENT_NODE_TEMPLATE] = nodeTemplateName.asJsonPrimitive()
- stepInputs[BlueprintConstants.PROPERTY_CURRENT_INTERFACE] = interfaceName.asJsonPrimitive()
- stepInputs[BlueprintConstants.PROPERTY_CURRENT_OPERATION] = operationName.asJsonPrimitive()
+ stepInputs[BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE] = nodeTemplateName.asJsonPrimitive()
+ stepInputs[BluePrintConstants.PROPERTY_CURRENT_INTERFACE] = interfaceName.asJsonPrimitive()
+ stepInputs[BluePrintConstants.PROPERTY_CURRENT_OPERATION] = operationName.asJsonPrimitive()
val stepInputData = StepData().apply {
name = stepName
properties = stepInputs
diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/executor/ComponentExecuteNodeExecutor.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/executor/ComponentExecuteNodeExecutor.kt
index 2e3f78a69..8ef74152c 100644
--- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/executor/ComponentExecuteNodeExecutor.kt
+++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/executor/ComponentExecuteNodeExecutor.kt
@@ -52,7 +52,7 @@ open class ComponentExecuteNodeExecutor(private val nodeTemplateExecutionService
try { // Get the Request from the Context and Set to the Function Input and Invoke the function
val executionOutput = nodeTemplateExecutionService.executeNodeTemplate(
- ctx.getBlueprintService(), stepName, nodeTemplateName, executionInput
+ ctx.getBluePrintService(), stepName, nodeTemplateName, executionInput
)
ctx.setResponse(executionOutput)
diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintWorkflowExecutionServiceImplTest.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BluePrintWorkflowExecutionServiceImplTest.kt
index b7087b338..c28e36acc 100644
--- a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintWorkflowExecutionServiceImplTest.kt
+++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BluePrintWorkflowExecutionServiceImplTest.kt
@@ -31,19 +31,19 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ActionIdentifiers
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.CommonHeader
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutput
-import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterService
+import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BluePrintClusterService
import org.onap.ccsdk.cds.blueprintsprocessor.services.workflow.mock.MockComponentFunction
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintError
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintError
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType
import org.onap.ccsdk.cds.controllerblueprints.core.data.Step
import org.onap.ccsdk.cds.controllerblueprints.core.data.Workflow
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintWorkflowExecutionService
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService
-import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintWorkflowExecutionService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.mock.mockito.MockBean
@@ -55,18 +55,18 @@ import kotlin.test.assertNotNull
@RunWith(SpringRunner::class)
@ContextConfiguration(classes = [WorkflowServiceConfiguration::class])
-class BlueprintWorkflowExecutionServiceImplTest {
+class BluePrintWorkflowExecutionServiceImplTest {
@Autowired
- lateinit var bluePrintWorkflowExecutionService: BlueprintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput>
+ lateinit var bluePrintWorkflowExecutionService: BluePrintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput>
@MockBean
- lateinit var bluePrintClusterService: BlueprintClusterService
+ lateinit var bluePrintClusterService: BluePrintClusterService
@Before
fun init() {
- mockkObject(BlueprintDependencyService)
- every { BlueprintDependencyService.applicationContext.getBean(any()) } returns MockComponentFunction()
+ mockkObject(BluePrintDependencyService)
+ every { BluePrintDependencyService.applicationContext.getBean(any()) } returns MockComponentFunction()
}
@After
@@ -75,9 +75,9 @@ class BlueprintWorkflowExecutionServiceImplTest {
}
@Test
- fun testBlueprintWorkflowExecutionService() {
+ fun testBluePrintWorkflowExecutionService() {
runBlocking {
- val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime(
+ val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
"1234",
"./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
)
@@ -88,20 +88,20 @@ class BlueprintWorkflowExecutionServiceImplTest {
)!!
val executionServiceOutput = bluePrintWorkflowExecutionService
- .executeBlueprintWorkflow(bluePrintRuntimeService, executionServiceInput, hashMapOf())
+ .executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, hashMapOf())
assertNotNull(executionServiceOutput, "failed to get response")
assertEquals(
- BlueprintConstants.STATUS_SUCCESS, executionServiceOutput.status.message,
+ BluePrintConstants.STATUS_SUCCESS, executionServiceOutput.status.message,
"failed to get successful response"
)
}
}
@Test
- fun testImperativeBlueprintWorkflowExecutionService() {
+ fun testImperativeBluePrintWorkflowExecutionService() {
runBlocking {
- val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime(
+ val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
"1234",
"./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
)
@@ -112,11 +112,11 @@ class BlueprintWorkflowExecutionServiceImplTest {
)!!
val executionServiceOutput = bluePrintWorkflowExecutionService
- .executeBlueprintWorkflow(bluePrintRuntimeService, executionServiceInput, hashMapOf())
+ .executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, hashMapOf())
assertNotNull(executionServiceOutput, "failed to get response")
assertEquals(
- BlueprintConstants.STATUS_SUCCESS, executionServiceOutput.status.message,
+ BluePrintConstants.STATUS_SUCCESS, executionServiceOutput.status.message,
"failed to get successful response"
)
}
@@ -124,9 +124,9 @@ class BlueprintWorkflowExecutionServiceImplTest {
@Test
fun `Blueprint fails on missing workflowName-parameters with a useful message`() {
- assertFailsWith(exceptionClass = BlueprintProcessorException::class) {
+ assertFailsWith(exceptionClass = BluePrintProcessorException::class) {
runBlocking {
- val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime(
+ val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
"1234",
"./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
)
@@ -138,7 +138,7 @@ class BlueprintWorkflowExecutionServiceImplTest {
)!!
val executionServiceOutput = bluePrintWorkflowExecutionService
- .executeBlueprintWorkflow(bluePrintRuntimeService, executionServiceInput, hashMapOf())
+ .executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, hashMapOf())
}
}
}
@@ -146,11 +146,11 @@ class BlueprintWorkflowExecutionServiceImplTest {
@Test
fun `Should handle errors from resolve workflow output`() {
val imperativeWorkflowExecutionService: ImperativeWorkflowExecutionService = mockk()
- val bluePrintWorkflowExecutionServiceImpl = BlueprintWorkflowExecutionServiceImpl(
+ val bluePrintWorkflowExecutionServiceImpl = BluePrintWorkflowExecutionServiceImpl(
mockk(), mockk(), imperativeWorkflowExecutionService
)
- val bluePrintRuntimeService: BlueprintRuntimeService<MutableMap<String, JsonNode>> = mockk()
- val bluePrintContext: BlueprintContext = mockk()
+ val bluePrintRuntimeService: BluePrintRuntimeService<MutableMap<String, JsonNode>> = mockk()
+ val bluePrintContext: BluePrintContext = mockk()
val executionServiceInput = ExecutionServiceInput().apply {
this.actionIdentifiers = ActionIdentifiers().apply { this.actionName = "config-assign" }
this.commonHeader = CommonHeader()
@@ -159,7 +159,7 @@ class BlueprintWorkflowExecutionServiceImplTest {
val workflow = Workflow().apply {
this.steps = mutableMapOf("one" to Step(), "two" to Step())
}
- val blueprintError = BlueprintError()
+ val blueprintError = BluePrintError()
every { bluePrintRuntimeService.bluePrintContext() } returns bluePrintContext
every { bluePrintRuntimeService.assignWorkflowInputs(any(), any()) } returns Unit
@@ -169,13 +169,13 @@ class BlueprintWorkflowExecutionServiceImplTest {
} throws RuntimeException("failed to resolve property...")
every {
runBlocking {
- imperativeWorkflowExecutionService.executeBlueprintWorkflow(any(), any(), any())
+ imperativeWorkflowExecutionService.executeBluePrintWorkflow(any(), any(), any())
}
} returns ExecutionServiceOutput()
- every { bluePrintRuntimeService.getBlueprintError() } returns blueprintError
+ every { bluePrintRuntimeService.getBluePrintError() } returns blueprintError
runBlocking {
- val output = bluePrintWorkflowExecutionServiceImpl.executeBlueprintWorkflow(
+ val output = bluePrintWorkflowExecutionServiceImpl.executeBluePrintWorkflow(
bluePrintRuntimeService, executionServiceInput, mutableMapOf()
)
assertEquals("failed to resolve property...", blueprintError.allErrors()[0])
diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintServiceLogicTest.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintServiceLogicTest.kt
index e7dd9dedb..d391050a6 100644
--- a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintServiceLogicTest.kt
+++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintServiceLogicTest.kt
@@ -22,13 +22,13 @@ import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
-import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterService
+import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BluePrintClusterService
import org.onap.ccsdk.cds.blueprintsprocessor.services.workflow.executor.ComponentExecuteNodeExecutor
import org.onap.ccsdk.cds.blueprintsprocessor.services.workflow.mock.PrototypeComponentFunction
import org.onap.ccsdk.cds.blueprintsprocessor.services.workflow.mock.SingletonComponentFunction
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService
-import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService
+import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonReactorUtils
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.mock.mockito.MockBean
@@ -49,17 +49,17 @@ class BlueprintServiceLogicTest {
lateinit var dgWorkflowExecutionService: DGWorkflowExecutionService
@MockBean
- lateinit var bluePrintClusterService: BlueprintClusterService
+ lateinit var bluePrintClusterService: BluePrintClusterService
@Before
fun init() {
- BlueprintDependencyService.inject(applicationContext)
+ BluePrintDependencyService.inject(applicationContext)
}
@Test
fun testExecuteGraphWithSingleComponent() {
runBlocking {
- val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime(
+ val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
"1234",
"./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
)
@@ -72,10 +72,10 @@ class BlueprintServiceLogicTest {
bluePrintRuntimeService.assignWorkflowInputs("resource-assignment", input)
val executionServiceOutput = dgWorkflowExecutionService
- .executeBlueprintWorkflow(bluePrintRuntimeService, executionServiceInput, mutableMapOf())
+ .executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, mutableMapOf())
assertNotNull(executionServiceOutput, "failed to get response")
assertEquals(
- BlueprintConstants.STATUS_SUCCESS, executionServiceOutput.status.message,
+ BluePrintConstants.STATUS_SUCCESS, executionServiceOutput.status.message,
"failed to get successful response"
)
}
@@ -84,7 +84,7 @@ class BlueprintServiceLogicTest {
@Test
fun testExecuteGraphWithMultipleComponents() {
runBlocking {
- val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime(
+ val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
"1234",
"./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
)
@@ -97,10 +97,10 @@ class BlueprintServiceLogicTest {
bluePrintRuntimeService.assignWorkflowInputs("assign-activate", input)
val executionServiceOutput = dgWorkflowExecutionService
- .executeBlueprintWorkflow(bluePrintRuntimeService, executionServiceInput, mutableMapOf())
+ .executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, mutableMapOf())
assertNotNull(executionServiceOutput, "failed to get response")
assertEquals(
- BlueprintConstants.STATUS_SUCCESS, executionServiceOutput.status.message,
+ BluePrintConstants.STATUS_SUCCESS, executionServiceOutput.status.message,
"failed to get successful response"
)
}
diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionServiceTest.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionServiceTest.kt
index 355939cdd..cc1bfee7f 100644
--- a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionServiceTest.kt
+++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionServiceTest.kt
@@ -22,11 +22,11 @@ import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
-import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterService
+import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BluePrintClusterService
import org.onap.ccsdk.cds.blueprintsprocessor.services.workflow.executor.ComponentExecuteNodeExecutor
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService
-import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService
+import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonReactorUtils
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.mock.mockito.MockBean
@@ -47,18 +47,18 @@ class DGWorkflowExecutionServiceTest {
lateinit var dgWorkflowExecutionService: DGWorkflowExecutionService
@MockBean
- lateinit var bluePrintClusterService: BlueprintClusterService
+ lateinit var bluePrintClusterService: BluePrintClusterService
@Before
fun init() {
- BlueprintDependencyService.inject(applicationContext)
+ BluePrintDependencyService.inject(applicationContext)
}
@Test
fun testExecuteDirectedGraph() {
runBlocking {
- val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime(
+ val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
"1234",
"./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
)
@@ -70,14 +70,14 @@ class DGWorkflowExecutionServiceTest {
val input = executionServiceInput.payload.get("resource-assignment-request")
bluePrintRuntimeService.assignWorkflowInputs("resource-assignment", input)
- val executionServiceOutput = dgWorkflowExecutionService.executeBlueprintWorkflow(
+ val executionServiceOutput = dgWorkflowExecutionService.executeBluePrintWorkflow(
bluePrintRuntimeService,
executionServiceInput, mutableMapOf()
)
assertNotNull(executionServiceOutput, "failed to get response")
assertEquals(
- BlueprintConstants.STATUS_SUCCESS, executionServiceOutput.status.message,
+ BluePrintConstants.STATUS_SUCCESS, executionServiceOutput.status.message,
"failed to get successful response"
)
}
diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ImperativeWorkflowExecutionServiceTest.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ImperativeWorkflowExecutionServiceTest.kt
index 9ba607cd4..2367422a7 100644
--- a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ImperativeWorkflowExecutionServiceTest.kt
+++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ImperativeWorkflowExecutionServiceTest.kt
@@ -28,15 +28,15 @@ import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.nodeTypeCompone
import org.onap.ccsdk.cds.blueprintsprocessor.services.workflow.mock.MockComponentFunction
import org.onap.ccsdk.cds.blueprintsprocessor.services.workflow.mock.mockNodeTemplateComponentScriptExecutor
import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
import org.onap.ccsdk.cds.controllerblueprints.core.data.ServiceTemplate
import org.onap.ccsdk.cds.controllerblueprints.core.dsl.serviceTemplate
import org.onap.ccsdk.cds.controllerblueprints.core.logger
import org.onap.ccsdk.cds.controllerblueprints.core.normalizedPathName
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService
-import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService
+import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import kotlin.test.Test
import kotlin.test.assertEquals
@@ -48,8 +48,8 @@ class ImperativeWorkflowExecutionServiceTest {
@Before
fun init() {
- mockkObject(BlueprintDependencyService)
- every { BlueprintDependencyService.applicationContext.getBean(any()) } returns MockComponentFunction()
+ mockkObject(BluePrintDependencyService)
+ every { BluePrintDependencyService.applicationContext.getBean(any()) } returns MockComponentFunction()
}
@After
@@ -101,7 +101,7 @@ class ImperativeWorkflowExecutionServiceTest {
step("activate-licence", "activate-licence", "")
}
}
- nodeType(BlueprintTypes.nodeTypeComponentScriptExecutor())
+ nodeType(BluePrintTypes.nodeTypeComponentScriptExecutor())
}
}
@@ -109,10 +109,10 @@ class ImperativeWorkflowExecutionServiceTest {
fun testImperativeExecutionService() {
runBlocking {
val serviceTemplate = mockServiceTemplate()
- val bluePrintContext = BlueprintContext(serviceTemplate)
+ val bluePrintContext = BluePrintContext(serviceTemplate)
bluePrintContext.rootPath = normalizedPathName(".")
bluePrintContext.entryDefinition = "cba.imperative.test.ImperativeTestDefinitions.kt"
- val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime("12345", bluePrintContext)
+ val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime("12345", bluePrintContext)
val executionServiceInput = JacksonUtils
.readValueFromClassPathFile(
@@ -122,10 +122,10 @@ class ImperativeWorkflowExecutionServiceTest {
val imperativeWorkflowExecutionService = ImperativeWorkflowExecutionService(NodeTemplateExecutionService(mockk()))
val output = imperativeWorkflowExecutionService
- .executeBlueprintWorkflow(bluePrintRuntimeService, executionServiceInput, hashMapOf())
+ .executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, hashMapOf())
assertNotNull(output, "failed to get imperative workflow output")
assertNotNull(output.status, "failed to get imperative workflow output status")
- assertEquals(output.status.message, BlueprintConstants.STATUS_SUCCESS)
+ assertEquals(output.status.message, BluePrintConstants.STATUS_SUCCESS)
assertEquals(output.status.eventType, EventType.EVENT_COMPONENT_EXECUTED.name)
}
}
diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/NodeTemplateExecutionServiceTest.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/NodeTemplateExecutionServiceTest.kt
index b113987e5..783939880 100644
--- a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/NodeTemplateExecutionServiceTest.kt
+++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/NodeTemplateExecutionServiceTest.kt
@@ -24,11 +24,11 @@ import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
-import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterService
+import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BluePrintClusterService
import org.onap.ccsdk.cds.blueprintsprocessor.services.workflow.mock.MockComponentFunction
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService
-import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService
+import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.springframework.boot.test.mock.mockito.MockBean
import org.springframework.test.context.ContextConfiguration
@@ -42,12 +42,12 @@ import kotlin.test.assertNotNull
class NodeTemplateExecutionServiceTest {
@MockBean
- lateinit var bluePrintClusterService: BlueprintClusterService
+ lateinit var bluePrintClusterService: BluePrintClusterService
@Before
fun init() {
- mockkObject(BlueprintDependencyService)
- every { BlueprintDependencyService.applicationContext.getBean(any()) } returns MockComponentFunction()
+ mockkObject(BluePrintDependencyService)
+ every { BluePrintDependencyService.applicationContext.getBean(any()) } returns MockComponentFunction()
}
@After
@@ -58,7 +58,7 @@ class NodeTemplateExecutionServiceTest {
@Test
fun testExecuteNodeTemplate() {
runBlocking {
- val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime(
+ val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
"1234",
"./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
)
@@ -81,7 +81,7 @@ class NodeTemplateExecutionServiceTest {
assertNotNull(executionServiceOutput, "failed to get response")
assertEquals(
- BlueprintConstants.STATUS_SUCCESS, executionServiceOutput.status.message,
+ BluePrintConstants.STATUS_SUCCESS, executionServiceOutput.status.message,
"failed to get successful response"
)
}
diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/mock/MockComponentFunction.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/mock/MockComponentFunction.kt
index e2bc0f131..9c3727288 100644
--- a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/mock/MockComponentFunction.kt
+++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/mock/MockComponentFunction.kt
@@ -20,7 +20,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.services.workflow.mock
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.nodeTemplateComponentScriptExecutor
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.config.ConfigurableBeanFactory
@@ -29,7 +29,7 @@ import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Scope
import org.springframework.stereotype.Component
-fun mockNodeTemplateComponentScriptExecutor(id: String, script: String) = BlueprintTypes.nodeTemplateComponentScriptExecutor(
+fun mockNodeTemplateComponentScriptExecutor(id: String, script: String) = BluePrintTypes.nodeTemplateComponentScriptExecutor(
id,
"mock($id) component function"
) {