From 7a04ac414b690983d863e96b487e314780572c48 Mon Sep 17 00:00:00 2001 From: "Singal, Kapil (ks220y)" Date: Mon, 23 Sep 2019 16:11:17 -0400 Subject: Refactoring ResourceAssignmentUtils Refactoring ResourceAssignmentUtils parseResponseNodeForPrimitiveTypes API to remove cyclic value assignments Issue-ID: CCSDK-1748 Signed-off-by: Singal, Kapil (ks220y) Change-Id: I27b5a7d3ed2df38cf4e3e44686aec094ebdb5f25 Refactoring ResourceAssignmentUtils Changing isNull condition to isNullOrEmpty to make sure Empty value doesn't get assigned to resource Issue-ID: CCSDK-1748 Signed-off-by: Singal, Kapil (ks220y) Change-Id: I0744537c7ddec80f20ffd7e6545b947439f63743 Resource Resolution Refactoring Refactoring some logging statements and adding new loggers Issue-ID: CCSDK-1748 Signed-off-by: Singal, Kapil (ks220y) Change-Id: I5676659eea01056a7d29206f13473a4361516755 --- .../services/execution/AbstractComponentFunction.kt | 20 ++++++++++++++++++++ .../scripts/AbstractComponentFunctionTest.kt | 7 +------ 2 files changed, 21 insertions(+), 6 deletions(-) (limited to 'ms/blueprintsprocessor/modules/services') diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractComponentFunction.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractComponentFunction.kt index 8759338b7..5163a93ac 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractComponentFunction.kt +++ b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractComponentFunction.kt @@ -154,6 +154,26 @@ abstract class AbstractComponentFunction : BlueprintFunctionNode-request/data" + */ + fun requestPayloadActionProperty(expression: String?): JsonNode? { + val requestExpression = if (expression.isNullOrBlank()) { + "$operationName-request" + } else { + "$operationName-request.$expression" + } + return executionServiceInput.payload.jsonPathParse(".$requestExpression") + } + fun artifactContent(artifactName: String): String { return bluePrintRuntimeService.resolveNodeTemplateArtifact(nodeTemplateName, artifactName) } diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt index 07be8c809..24696b456 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt +++ b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt @@ -70,9 +70,6 @@ class AbstractComponentFunctionTest { every { blueprintContext.rootPath } returns normalizedPathName("target") } - /** - * Tests the abstract component functionality. - */ @Test fun testAbstractComponent() { runBlocking { @@ -95,9 +92,6 @@ class AbstractComponentFunctionTest { } } - /** - * Tests the abstract script component functionality. - */ @Test fun testAbstractScriptComponent() { runBlocking { @@ -190,5 +184,6 @@ class AbstractComponentFunctionTest { val componentScriptExecutor = BluePrintTypes.nodeTypeComponentScriptExecutor() assertNotNull(componentScriptExecutor.interfaces, "failed to get interface operations") } + } -- cgit 1.2.3-korg