aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/python-executor/src/test
diff options
context:
space:
mode:
authorOleg Mitsura <oleg.mitsura@amdocs.com>2021-01-15 13:49:25 -0500
committerOleg Mitsura <oleg.mitsura@amdocs.com>2021-01-26 10:26:13 -0500
commitb62aabac76abe92f04e0991157292c276d3d9177 (patch)
tree41c7dc0b2a6881e15a1b6af2cbbe2fd5af461544 /ms/blueprintsprocessor/functions/python-executor/src/test
parent99856ebe10b933a11b683c58635c13a58e542abe (diff)
PV/PVC elimination
Issue-ID: CCSDK-3086 1. initial commit 2. fix accidental paste / rebased cleaned up unneeded validation call in cmd-exec upload Signed-off-by: Oleg Mitsura <oleg.mitsura@amdocs.com> Change-Id: Ife5460c5be59aa8d8592d82099b27c507b08c6c6
Diffstat (limited to 'ms/blueprintsprocessor/functions/python-executor/src/test')
-rw-r--r--ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorTest.kt18
1 files changed, 16 insertions, 2 deletions
diff --git a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorTest.kt b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorTest.kt
index cad1f8df2..2fd33f2a6 100644
--- a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorTest.kt
+++ b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorTest.kt
@@ -27,8 +27,11 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInpu
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.PrepareRemoteEnvInput
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.RemoteScriptExecutionInput
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.RemoteScriptExecutionOutput
+import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.RemoteScriptUploadBlueprintInput
+import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.RemoteScriptUploadBlueprintOutput
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.StatusType
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.StepData
+import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.repository.BlueprintModelRepository
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.RemoteScriptExecutionService
import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintError
@@ -50,7 +53,8 @@ class ComponentRemotePythonExecutorTest {
val componentRemotePythonExecutor = ComponentRemotePythonExecutor(
remoteScriptExecutionService,
- mockk<BlueprintPropertiesService>()
+ mockk<BlueprintPropertiesService>(),
+ mockk<BlueprintModelRepository>()
)
val executionServiceInput =
@@ -94,7 +98,8 @@ class ComponentRemotePythonExecutorTest {
val remoteScriptExecutionService = MockRemoteScriptExecutionService()
val componentRemotePythonExecutor = ComponentRemotePythonExecutor(
remoteScriptExecutionService,
- mockk<BlueprintPropertiesService>()
+ mockk<BlueprintPropertiesService>(),
+ mockk<BlueprintModelRepository>()
)
val bluePrintRuntime = mockk<DefaultBlueprintRuntimeService>("123456-1000")
@@ -223,6 +228,15 @@ class MockRemoteScriptExecutionService : RemoteScriptExecutionService {
override suspend fun init(selector: Any) {
}
+ override suspend fun uploadBlueprint(uploadBpInput: RemoteScriptUploadBlueprintInput): RemoteScriptUploadBlueprintOutput {
+ val uploadBpOutput = mockk<RemoteScriptUploadBlueprintOutput>()
+ every { uploadBpOutput.payload } returns "[]".asJsonPrimitive()
+ every { uploadBpOutput.status } returns StatusType.SUCCESS
+ every { uploadBpOutput.requestId } returns "123456-1000"
+ every { uploadBpOutput.subRequestId } returns "1234"
+ return uploadBpOutput
+ }
+
override suspend fun prepareEnv(prepareEnvInput: PrepareRemoteEnvInput): RemoteScriptExecutionOutput {
assertEquals(prepareEnvInput.requestId, "123456-1000", "failed to match request id")
assertNotNull(prepareEnvInput.packages, "failed to get packages")