diff options
Diffstat (limited to 'ms/blueprintsprocessor/functions/cli-executor/src')
4 files changed, 24 insertions, 14 deletions
diff --git a/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/internal/scripts/InternalSimpleCli.kt b/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/internal/scripts/InternalSimpleCli.kt index 15365e176..b3708a092 100644 --- a/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/internal/scripts/InternalSimpleCli.kt +++ b/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/internal/scripts/InternalSimpleCli.kt @@ -24,7 +24,6 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.cli.executor.getSshClien import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentScriptExecutor import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive - import org.slf4j.LoggerFactory open class TestCliScriptFunction : AbstractScriptComponentFunction() { @@ -44,7 +43,6 @@ open class TestCliScriptFunction : AbstractScriptComponentFunction() { } } - open class Check : AbstractScriptComponentFunction() { private val log = LoggerFactory.getLogger(AbstractScriptComponentFunction::class.java)!! diff --git a/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/CliExecutorConfiguration.kt b/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/CliExecutorConfiguration.kt index 13afc58af..dc2f9edb1 100644 --- a/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/CliExecutorConfiguration.kt +++ b/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/CliExecutorConfiguration.kt @@ -25,4 +25,4 @@ import org.springframework.context.annotation.Configuration @ComponentScan @EnableConfigurationProperties @ConditionalOnProperty(name = ["blueprintsprocessor.cliExecutor.enabled"], havingValue = "true") -open class CliExecutorConfiguration
\ No newline at end of file +open class CliExecutorConfiguration diff --git a/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/CliExecutorExtensions.kt b/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/CliExecutorExtensions.kt index ad95759a9..b6f2dcb94 100644 --- a/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/CliExecutorExtensions.kt +++ b/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/CliExecutorExtensions.kt @@ -33,4 +33,3 @@ fun AbstractComponentFunction.cliDeviceInfo(requirementName: String): JsonNode { fun AbstractComponentFunction.getSshClientService(cliDeviceInfo: JsonNode): BlueprintSshClientService { return BluePrintDependencyService.sshClientService(cliDeviceInfo) } - diff --git a/ms/blueprintsprocessor/functions/cli-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/ComponentCliExecutorTest.kt b/ms/blueprintsprocessor/functions/cli-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/ComponentCliExecutorTest.kt index c4e674c91..50268d39b 100644 --- a/ms/blueprintsprocessor/functions/cli-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/ComponentCliExecutorTest.kt +++ b/ms/blueprintsprocessor/functions/cli-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/ComponentCliExecutorTest.kt @@ -34,6 +34,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ExecutionServic import org.onap.ccsdk.cds.blueprintsprocessor.ssh.BluePrintSshLibConfiguration 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.scripts.BluePrintScriptsServiceImpl import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService @@ -47,10 +48,12 @@ import org.springframework.test.context.junit4.SpringRunner import kotlin.test.assertNotNull @RunWith(SpringRunner::class) -@ContextConfiguration(classes = [CliExecutorConfiguration::class, - ExecutionServiceConfiguration::class, - BluePrintSshLibConfiguration::class, BluePrintScriptsServiceImpl::class, - BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class, BluePrintDependencyService::class]) +@ContextConfiguration( + classes = [CliExecutorConfiguration::class, + ExecutionServiceConfiguration::class, + BluePrintSshLibConfiguration::class, BluePrintScriptsServiceImpl::class, + BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class, BluePrintDependencyService::class] +) @DirtiesContext @TestPropertySource(properties = [], locations = ["classpath:application-test.properties"]) class ComponentCliExecutorTest { @@ -81,7 +84,7 @@ class ComponentCliExecutorTest { operationInputs[BluePrintConstants.PROPERTY_CURRENT_OPERATION] = "operationName".asJsonPrimitive() operationInputs[ComponentScriptExecutor.INPUT_SCRIPT_TYPE] = BluePrintConstants.SCRIPT_INTERNAL.asJsonPrimitive() operationInputs[ComponentScriptExecutor.INPUT_SCRIPT_CLASS_REFERENCE] = - "internal.scripts.TestCliScriptFunction".asJsonPrimitive() + "internal.scripts.TestCliScriptFunction".asJsonPrimitive() val stepInputData = StepData().apply { name = "activate-cli" @@ -90,19 +93,29 @@ class ComponentCliExecutorTest { executionServiceInput.stepData = stepInputData val blueprintContext = mockk<BluePrintContext>() + every { + blueprintContext.nodeTemplateOperationImplementation( + any(), any(), any() + ) + } returns Implementation() + every { bluePrintRuntime.bluePrintContext() } returns blueprintContext every { - bluePrintRuntime.resolveNodeTemplateInterfaceOperationInputs("activate-cli", - "interfaceName", "operationName") + bluePrintRuntime.resolveNodeTemplateInterfaceOperationInputs( + "activate-cli", + "interfaceName", "operationName" + ) } returns operationInputs val operationOutputs = hashMapOf<String, JsonNode>() every { - bluePrintRuntime.resolveNodeTemplateInterfaceOperationOutputs("activate-cli", - "interfaceName", "operationName") + bluePrintRuntime.resolveNodeTemplateInterfaceOperationOutputs( + "activate-cli", + "interfaceName", "operationName" + ) } returns operationOutputs componentScriptExecutor.applyNB(executionServiceInput) } } -}
\ No newline at end of file +} |