Add cli executor component 06/87806/6
authorBrinda Santh <brindasanth@in.ibm.com>
Wed, 15 May 2019 19:21:34 +0000 (15:21 -0400)
committerSteve Siani <alphonse.steve.siani.djissitchi@ibm.com>
Thu, 23 May 2019 04:15:54 +0000 (00:15 -0400)
Change-Id: I0997e9bc71b74bdff57bd2405a9b1ec962130715
Issue-ID: CCSDK-1335
Signed-off-by: Brinda Santh <brindasanth@in.ibm.com>
15 files changed:
ms/blueprintsprocessor/application/src/main/resources/application-dev.properties
ms/blueprintsprocessor/application/src/main/resources/application.properties
ms/blueprintsprocessor/application/src/test/resources/application.properties
ms/blueprintsprocessor/functions/cli-executor/pom.xml
ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/CliComponentFunction.kt [new file with mode: 0644]
ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/CliExecutorConfiguration.kt
ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/ComponentCliExecutor.kt [new file with mode: 0644]
ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/api/CliExecutorService.kt [deleted file]
ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/service/CliExecutorServiceImpl.kt [deleted file]
ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/scripts/InternalSimpleCli.cba.kts [new file with mode: 0644]
ms/blueprintsprocessor/functions/cli-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/ComponentCliExecutorTest.kt [new file with mode: 0644]
ms/blueprintsprocessor/functions/cli-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/service/CliExecutorServiceImplTest.kt [deleted file]
ms/blueprintsprocessor/functions/cli-executor/src/test/resources/application-test.properties [new file with mode: 0644]
ms/blueprintsprocessor/modules/commons/ssh-lib/src/test/resources/logback-test.xml
ms/blueprintsprocessor/parent/pom.xml

index 2b90998..e34c024 100755 (executable)
@@ -47,10 +47,11 @@ blueprintsprocessor.restconfEnabled=true
 blueprintsprocessor.restclient.sdncodl.type=basic-auth\r
 blueprintsprocessor.restclient.sdncodl.url=http://localhost:8282/\r
 blueprintsprocessor.restclient.sdncodl.username=admin\r
-blueprintsprocessor.restclient.sdncodl.password=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U
-
-# Executor Options
-blueprintprocessor.resourceResolution.enabled=true
-blueprintprocessor.netconfExecutor.enabled=true
-blueprintprocessor.restConfExecutor.enabled=true
+blueprintsprocessor.restclient.sdncodl.password=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U\r
+\r
+# Executor Options\r
+blueprintprocessor.resourceResolution.enabled=true\r
+blueprintprocessor.netconfExecutor.enabled=true\r
+blueprintprocessor.restConfExecutor.enabled=true\r
+blueprintsprocessor.cliExecutor.enabled=true\r
 blueprintprocessor.remoteScriptCommand.enabled=false
\ No newline at end of file
index e5b1fe5..1e0b4b8 100755 (executable)
@@ -51,6 +51,7 @@ blueprintsprocessor.restclient.sdncodl.password=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84v
 blueprintprocessor.resourceResolution.enabled=true
 blueprintprocessor.netconfExecutor.enabled=true
 blueprintprocessor.restConfExecutor.enabled=true
+blueprintsprocessor.cliExecutor.enabled=true
 blueprintprocessor.remoteScriptCommand.enabled=true
 
 blueprintsprocessor.grpcclient.remote-python.type=token-auth
index 7e462f2..09ee651 100644 (file)
@@ -44,4 +44,5 @@ security.user.name:ccsdkapps
 blueprintprocessor.resourceResolution.enabled=true
 blueprintprocessor.netconfExecutor.enabled=true
 blueprintprocessor.restConfExecutor.enabled=true
+blueprintsprocessor.cliExecutor.enabled=true
 blueprintprocessor.remoteScriptCommand.enabled=false
index af76d12..6f7543f 100644 (file)
 
     <dependencies>
         <dependency>
-            <groupId>org.apache.sshd</groupId>
-            <artifactId>sshd-core</artifactId>
+            <groupId>org.onap.ccsdk.cds.blueprintsprocessor.functions</groupId>
+            <artifactId>resource-resolution</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+            <artifactId>ssh-lib</artifactId>
         </dependency>
-
     </dependencies>
 
 
diff --git a/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/CliComponentFunction.kt b/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/CliComponentFunction.kt
new file mode 100644 (file)
index 0000000..6dcffca
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ *  Copyright © 2019 IBM.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.onap.ccsdk.cds.blueprintsprocessor.functions.cli.executor
+
+import kotlinx.coroutines.runBlocking
+import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants
+import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionService
+import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction
+import org.onap.ccsdk.cds.blueprintsprocessor.ssh.SshLibConstants
+import org.onap.ccsdk.cds.blueprintsprocessor.ssh.service.BluePrintSshLibPropertyService
+
+abstract class CliComponentFunction : AbstractScriptComponentFunction() {
+
+    open fun bluePrintSshLibPropertyService(): BluePrintSshLibPropertyService =
+            functionDependencyInstanceAsType(SshLibConstants.SERVICE_BLUEPRINT_SSH_LIB_PROPERTY)
+
+    open fun resourceResolutionService(): ResourceResolutionService =
+            functionDependencyInstanceAsType(ResourceResolutionConstants.SERVICE_RESOURCE_RESOLUTION)
+
+
+    fun generateMessage(artifactName: String): String {
+        return bluePrintRuntimeService.resolveNodeTemplateArtifact(nodeTemplateName, artifactName)
+    }
+
+    fun resolveFromDatabase(resolutionKey: String, artifactName: String): String = runBlocking {
+        resourceResolutionService().resolveFromDatabase(bluePrintRuntimeService, artifactName, resolutionKey)
+    }
+
+    fun resolveAndGenerateMessage(artifactMapping: String, artifactTemplate: String): String = runBlocking {
+        resourceResolutionService().resolveResources(bluePrintRuntimeService, nodeTemplateName,
+                artifactMapping, artifactTemplate)
+    }
+
+    fun resolveAndGenerateMessage(artifactPrefix: String): String = runBlocking {
+        resourceResolutionService().resolveResources(bluePrintRuntimeService, nodeTemplateName,
+                artifactPrefix, mapOf())
+    }
+}
\ No newline at end of file
index f930206..13afc58 100644 (file)
 
 package org.onap.ccsdk.cds.blueprintsprocessor.functions.cli.executor
 
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
+import org.springframework.boot.context.properties.EnableConfigurationProperties
+import org.springframework.context.annotation.ComponentScan
 import org.springframework.context.annotation.Configuration
 
 @Configuration
+@ComponentScan
+@EnableConfigurationProperties
+@ConditionalOnProperty(name = ["blueprintsprocessor.cliExecutor.enabled"], havingValue = "true")
 open class CliExecutorConfiguration
\ No newline at end of file
diff --git a/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/ComponentCliExecutor.kt b/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/ComponentCliExecutor.kt
new file mode 100644 (file)
index 0000000..8c58272
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ *  Copyright © 2019 IBM.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.onap.ccsdk.cds.blueprintsprocessor.functions.cli.executor
+
+import com.fasterxml.jackson.databind.node.ArrayNode
+import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
+import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction
+import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentFunctionScriptingService
+import org.onap.ccsdk.cds.blueprintsprocessor.ssh.SshLibConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.getAsString
+import org.springframework.beans.factory.config.ConfigurableBeanFactory
+import org.springframework.context.annotation.Scope
+import org.springframework.stereotype.Component
+
+@Component("component-cli-executor")
+@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+open class ComponentCliExecutor(private var componentFunctionScriptingService: ComponentFunctionScriptingService)
+    : AbstractComponentFunction() {
+
+    companion object {
+        const val SCRIPT_TYPE = "script-type"
+        const val SCRIPT_CLASS_REFERENCE = "script-class-reference"
+        const val INSTANCE_DEPENDENCIES = "instance-dependencies"
+    }
+
+    private lateinit var scriptComponent: CliComponentFunction
+
+    override suspend fun processNB(executionRequest: ExecutionServiceInput) {
+
+        val scriptType = operationInputs.getAsString(SCRIPT_TYPE)
+        val scriptClassReference = operationInputs.getAsString(SCRIPT_CLASS_REFERENCE)
+        val instanceDependenciesNode = operationInputs[INSTANCE_DEPENDENCIES] as? ArrayNode
+
+        val scriptDependencies: MutableList<String> = arrayListOf()
+        scriptDependencies.add(SshLibConstants.SERVICE_BLUEPRINT_SSH_LIB_PROPERTY)
+        // May be injected from model, not by default
+        //scriptDependencies.add(ResourceResolutionConstants.SERVICE_RESOURCE_RESOLUTION)
+
+        instanceDependenciesNode?.forEach { instanceName ->
+            scriptDependencies.add(instanceName.textValue())
+        }
+
+        scriptComponent = componentFunctionScriptingService.scriptInstance(this, scriptType,
+                scriptClassReference, scriptDependencies)
+
+
+        // Handles both script processing and error handling
+        scriptComponent.executeScript(executionServiceInput)
+    }
+
+    override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
+        bluePrintRuntimeService.getBluePrintError()
+                .addError("Failed in ComponentCliExecutor : ${runtimeException.message}")
+
+    }
+}
\ No newline at end of file
diff --git a/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/api/CliExecutorService.kt b/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/api/CliExecutorService.kt
deleted file mode 100644 (file)
index 5ad671b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- *  Copyright © 2019 IBM.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.onap.ccsdk.cds.blueprintsprocessor.functions.cli.executor.api
-
-interface CliExecutorService {
-
-
-}
\ No newline at end of file
diff --git a/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/service/CliExecutorServiceImpl.kt b/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/service/CliExecutorServiceImpl.kt
deleted file mode 100644 (file)
index 43047b3..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- *  Copyright © 2019 IBM.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.onap.ccsdk.cds.blueprintsprocessor.functions.cli.executor.service
-
-import org.onap.ccsdk.cds.blueprintsprocessor.functions.cli.executor.api.CliExecutorService
-import org.springframework.stereotype.Service
-
-@Service
-open class CliExecutorServiceImpl : CliExecutorService {
-
-}
\ No newline at end of file
diff --git a/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/scripts/InternalSimpleCli.cba.kts b/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/scripts/InternalSimpleCli.cba.kts
new file mode 100644 (file)
index 0000000..136d011
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ *  Copyright © 2019 IBM.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+@file:Suppress("unused")
+
+import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
+import org.onap.ccsdk.cds.blueprintsprocessor.functions.cli.executor.CliComponentFunction
+import org.slf4j.LoggerFactory
+
+open class TestCliScriptFunction : CliComponentFunction() {
+
+    private val log = LoggerFactory.getLogger(CliComponentFunction::class.java)!!
+
+    override fun getName(): String {
+        return "SimpleCliConfigure"
+    }
+
+    override suspend fun processNB(executionRequest: ExecutionServiceInput) {
+        log.info("Executing process")
+    }
+
+    override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
+        log.info("Executing Recovery")
+    }
+}
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
new file mode 100644 (file)
index 0000000..6455513
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ *  Copyright © 2019 IBM.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.onap.ccsdk.cds.blueprintsprocessor.functions.cli.executor
+
+import com.fasterxml.jackson.databind.JsonNode
+import com.fasterxml.jackson.databind.node.ArrayNode
+import com.fasterxml.jackson.databind.node.ObjectNode
+import io.mockk.every
+import io.mockk.mockk
+import kotlinx.coroutines.runBlocking
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintProperties
+import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration
+import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ActionIdentifiers
+import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.CommonHeader
+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.blueprintsprocessor.services.execution.ExecutionServiceConfiguration
+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.service.BluePrintContext
+import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBluePrintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
+import org.onap.ccsdk.cds.controllerblueprints.scripts.BluePrintScriptsServiceImpl
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.test.annotation.DirtiesContext
+import org.springframework.test.context.ContextConfiguration
+import org.springframework.test.context.TestPropertySource
+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, BluePrintProperties::class])
+@DirtiesContext
+@TestPropertySource(properties = [], locations = ["classpath:application-test.properties"])
+class ComponentCliExecutorTest {
+
+    @Autowired
+    lateinit var componentCliExecutor: ComponentCliExecutor
+
+    @Test
+    fun `test CLI Component Instance`() {
+        runBlocking {
+            assertNotNull(componentCliExecutor, "failed to get ComponentCliExecutor instance")
+            val executionServiceInput = ExecutionServiceInput().apply {
+                commonHeader = CommonHeader().apply {
+                    requestId = "1234"
+                }
+                actionIdentifiers = ActionIdentifiers().apply {
+                    actionName = "activate"
+                }
+                payload = JacksonUtils.jsonNode("{}") as ObjectNode
+            }
+            val bluePrintRuntime = mockk<DefaultBluePrintRuntimeService>("1234")
+            componentCliExecutor.bluePrintRuntimeService = bluePrintRuntime
+            componentCliExecutor.stepName = "sample-step"
+
+            val operationInputs = hashMapOf<String, JsonNode>()
+            operationInputs[BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE] = "activate-cli".asJsonPrimitive()
+            operationInputs[BluePrintConstants.PROPERTY_CURRENT_INTERFACE] = "interfaceName".asJsonPrimitive()
+            operationInputs[BluePrintConstants.PROPERTY_CURRENT_OPERATION] = "operationName".asJsonPrimitive()
+            operationInputs[ComponentCliExecutor.SCRIPT_TYPE] = BluePrintConstants.SCRIPT_INTERNAL.asJsonPrimitive()
+            operationInputs[ComponentCliExecutor.SCRIPT_CLASS_REFERENCE] =
+                    "InternalSimpleCli_cba\$TestCliScriptFunction".asJsonPrimitive()
+            operationInputs[ComponentCliExecutor.INSTANCE_DEPENDENCIES] = JacksonUtils.jsonNode("[]") as ArrayNode
+
+            val stepInputData = StepData().apply {
+                name = "activate-cli"
+                properties = operationInputs
+            }
+            executionServiceInput.stepData = stepInputData
+
+            val blueprintContext = mockk<BluePrintContext>()
+            every { bluePrintRuntime.bluePrintContext() } returns blueprintContext
+            every {
+                bluePrintRuntime.resolveNodeTemplateInterfaceOperationInputs("activate-cli",
+                        "interfaceName", "operationName")
+            } returns operationInputs
+
+            val operationOutputs = hashMapOf<String, JsonNode>()
+            every {
+                bluePrintRuntime.resolveNodeTemplateInterfaceOperationOutputs("activate-cli",
+                        "interfaceName", "operationName")
+            } returns operationOutputs
+
+            componentCliExecutor.applyNB(executionServiceInput)
+        }
+    }
+}
\ No newline at end of file
diff --git a/ms/blueprintsprocessor/functions/cli-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/service/CliExecutorServiceImplTest.kt b/ms/blueprintsprocessor/functions/cli-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/service/CliExecutorServiceImplTest.kt
deleted file mode 100644 (file)
index 51dd62c..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *  Copyright © 2019 IBM.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.onap.ccsdk.cds.blueprintsprocessor.functions.cli.executor.service
-
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.onap.ccsdk.cds.blueprintsprocessor.functions.cli.executor.api.CliExecutorService
-import org.springframework.beans.factory.annotation.Autowired
-import org.springframework.test.context.ContextConfiguration
-import org.springframework.test.context.junit4.SpringRunner
-import kotlin.test.assertNotNull
-
-@RunWith(SpringRunner::class)
-@ContextConfiguration(classes = [CliExecutorServiceImpl::class])
-class CliExecutorServiceImplTest {
-
-    @Autowired
-    lateinit var cliExecutorService: CliExecutorService
-
-    @Test
-    fun testCliExecutorService() {
-        assertNotNull(cliExecutorService, "failed to intilise cliExecutorService")
-    }
-}
\ No newline at end of file
diff --git a/ms/blueprintsprocessor/functions/cli-executor/src/test/resources/application-test.properties b/ms/blueprintsprocessor/functions/cli-executor/src/test/resources/application-test.properties
new file mode 100644 (file)
index 0000000..34e07e0
--- /dev/null
@@ -0,0 +1,18 @@
+#
+#  Copyright © 2019 IBM.
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#
+
+# Executor Options
+blueprintsprocessor.cliExecutor.enabled=true
\ No newline at end of file
index 365c41c..626b8f9 100644 (file)
@@ -1,17 +1,17 @@
 <!--
-  ~ Copyright © 2017-2018 AT&T Intellectual Property.
+  ~  Copyright © 2019 IBM.
   ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
+  ~  Licensed under the Apache License, Version 2.0 (the "License");
+  ~  you may not use this file except in compliance with the License.
+  ~  You may obtain a copy of the License at
   ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~      http://www.apache.org/licenses/LICENSE-2.0
   ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
+  ~  Unless required by applicable law or agreed to in writing, software
+  ~  distributed under the License is distributed on an "AS IS" BASIS,
+  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~  See the License for the specific language governing permissions and
+  ~  limitations under the License.
   -->
 
 <configuration>
index f087104..8a1f7ac 100755 (executable)
                 <artifactId>rest-lib</artifactId>
                 <version>${project.version}</version>
             </dependency>
+            <dependency>
+                <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+                <artifactId>ssh-lib</artifactId>
+                <version>${project.version}</version>
+            </dependency>
             <dependency>
                 <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
                 <artifactId>dmaap-lib</artifactId>