diff options
Diffstat (limited to 'ms/blueprintsprocessor/functions/netconf-executor')
-rw-r--r-- | ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutor.kt | 8 | ||||
-rw-r--r-- | ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/NetconfExecutorExtensions.kt (renamed from ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ScriptComponentExtensions.kt) | 0 | ||||
-rw-r--r-- | ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutorTest.kt | 17 |
3 files changed, 20 insertions, 5 deletions
diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutor.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutor.kt index 663daf54e..cdee3903b 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutor.kt +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutor.kt @@ -22,6 +22,7 @@ import com.fasterxml.jackson.databind.node.ArrayNode import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction +import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentFunctionScriptingService import org.onap.ccsdk.cds.controllerblueprints.core.getAsString import org.springframework.beans.factory.config.ConfigurableBeanFactory @@ -39,7 +40,7 @@ open class ComponentNetconfExecutor(private var componentFunctionScriptingServic const val INSTANCE_DEPENDENCIES = "instance-dependencies" } - lateinit var scriptComponent: NetconfComponentFunction + lateinit var scriptComponent: AbstractScriptComponentFunction override suspend fun processNB(executionRequest: ExecutionServiceInput) { @@ -54,8 +55,9 @@ open class ComponentNetconfExecutor(private var componentFunctionScriptingServic scriptDependencies.add(instanceName.textValue()) } - scriptComponent = componentFunctionScriptingService.scriptInstance<NetconfComponentFunction>(this, scriptType, - scriptClassReference, scriptDependencies) + scriptComponent = componentFunctionScriptingService + .scriptInstance<AbstractScriptComponentFunction>(this, scriptType, + scriptClassReference, scriptDependencies) checkNotNull(scriptComponent) { "failed to get netconf script component" } diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ScriptComponentExtensions.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/NetconfExecutorExtensions.kt index 510621b2e..510621b2e 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ScriptComponentExtensions.kt +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/NetconfExecutorExtensions.kt diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutorTest.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutorTest.kt index 575117b15..8a08268d8 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutorTest.kt +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutorTest.kt @@ -26,7 +26,7 @@ import org.junit.runner.RunWith import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.StepData import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.asJsonNode +import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType import org.onap.ccsdk.cds.controllerblueprints.core.putJsonElement import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils @@ -61,8 +61,21 @@ class ComponentNetconfExecutorTest { val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime("1234", "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration") - val executionContext = bluePrintRuntimeService.getExecutionContext() + val assignmentParams = "{\n" + + " \"ipAddress\": \"127.0.0.1\",\n" + + " \"hostName\": \"vnf-host\"\n" + + " }" + + val json = """{ + "hostname" : "127.0.0.1" + } + """.trimIndent() + bluePrintRuntimeService.assignInputs(json.asJsonType()) + bluePrintRuntimeService.setNodeTemplateAttributeValue("resource-assignment", "assignment-params", + JacksonUtils.jsonNode(assignmentParams)) + + val executionContext = bluePrintRuntimeService.getExecutionContext() componentNetconfExecutor.bluePrintRuntimeService = bluePrintRuntimeService |