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 --- .../functions/resource/resolution/ResourceResolutionComponentTest.kt | 5 +++-- .../functions/resource/resolution/ResourceResolutionServiceTest.kt | 3 ++- .../resource/resolution/mock/MockRestResourceResolutionProcessor.kt | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/test') diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentTest.kt index 80ba8315b..74a88b4e3 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentTest.kt @@ -145,7 +145,8 @@ class ResourceResolutionComponentTest { any(), any(), any>(), - any>() + any>(), + "step" ) } returns ResourceResolutionResult(mutableMapOf(), mutableMapOf()) @@ -168,7 +169,7 @@ class ResourceResolutionComponentTest { every { bluePrintRuntimeService.getBlueprintError() } returns blueprintError resourceResolutionComponent.recoverNB(exception, executionRequest) - assertEquals(1, blueprintError.errors.size) + assertEquals(1, blueprintError.allErrors().size) } } } diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt index 00fb39515..a1de557d5 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt @@ -182,7 +182,8 @@ class ResourceResolutionServiceTest { bluePrintRuntimeService, "resource-assignment", artifactNames, - props + props, + "mockStep" ) }.let { assertEquals(artifactNames.toSet(), it.templateMap.keys) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt index de46fe6f3..77c90ba51 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt @@ -110,7 +110,7 @@ class MockRestResourceResolutionProcessor( } override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ResourceAssignment) { - raRuntimeService.getBlueprintError().addError(runtimeException.message!!) + addError(runtimeException.message!!) } private fun blueprintWebClientService(resourceAssignment: ResourceAssignment): MockBlueprintWebClientService { -- cgit 1.2.3-korg