From b96b44d6d7ca11dbbc3ad4bd2194df31fba5efb6 Mon Sep 17 00:00:00 2001 From: Jozsef Csongvai Date: Wed, 9 Dec 2020 19:49:48 -0500 Subject: Refactoring to enable on_failure for imperative workflow BlueprintError needs to associate errors with the steps in which they occurred in order for imperative workflow to handle on_failure properly. Made stepName more accessible and corrected places where stepName was assigned to nodeTemplateName. Issue-ID: CCSDK-3219 Change-Id: I7e5805745c63558cff6be533e1b99c32ad06c3db Signed-off-by: Jozsef Csongvai --- .../services/workflow/BlueprintWorkflowExecutionServiceImplTest.kt | 2 +- .../services/workflow/NodeTemplateExecutionServiceTest.kt | 4 +++- 2 files changed, 4 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/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 0bd1c33c9..b7087b338 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 @@ -178,7 +178,7 @@ class BlueprintWorkflowExecutionServiceImplTest { val output = bluePrintWorkflowExecutionServiceImpl.executeBlueprintWorkflow( bluePrintRuntimeService, executionServiceInput, mutableMapOf() ) - assertEquals("failed to resolve property...", blueprintError.errors[0]) + assertEquals("failed to resolve property...", blueprintError.allErrors()[0]) assertEquals("""{"config-assign-response":{}}""".asJsonType(), output.payload) } } 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 70b52d053..b113987e5 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 @@ -72,10 +72,12 @@ class NodeTemplateExecutionServiceTest { val input = executionServiceInput.payload.get("resource-assignment-request") bluePrintRuntimeService.assignWorkflowInputs("resource-assignment", input) + val stepName = bluePrintRuntimeService.bluePrintContext() + .workflowSteps("resource-assignment").keys.first() val nodeTemplate = "resource-assignment" val nodeTemplateExecutionService = NodeTemplateExecutionService(bluePrintClusterService) val executionServiceOutput = nodeTemplateExecutionService - .executeNodeTemplate(bluePrintRuntimeService, nodeTemplate, executionServiceInput) + .executeNodeTemplate(bluePrintRuntimeService, stepName, nodeTemplate, executionServiceInput) assertNotNull(executionServiceOutput, "failed to get response") assertEquals( -- cgit 1.2.3-korg