summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/resource-resolution/src/test
diff options
context:
space:
mode:
authorAlexis de Talhouët <adetalhouet89@gmail.com>2019-06-27 07:11:24 -0400
committerAlexis de Talhouët <adetalhouet89@gmail.com>2019-07-04 15:53:42 -0400
commitc48ca03872b11a54cf898c93d4a62ef220f3c55f (patch)
tree4c9fa45b6ce5b80fc40b1acb596ede7f35d94d64 /ms/blueprintsprocessor/functions/resource-resolution/src/test
parent2791db21e7d7f7d31ea402fe978dab216a41367f (diff)
Share RR context within node template
Also, mark resolution as failed for capability when failure. Change-Id: I3c1704b5b99ace7096f1d9e1cd9bb7f5b595db13 Issue-ID: CCSDK-1422 Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
Diffstat (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/test')
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt16
1 files changed, 13 insertions, 3 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt
index 4a3e75cde..abf0011e6 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt
@@ -28,6 +28,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInpu
import org.onap.ccsdk.cds.blueprintsprocessor.core.utils.PayloadUtils
import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibConfiguration
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor.*
+import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils
import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration
import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
@@ -81,13 +82,16 @@ class ResourceResolutionServiceTest {
val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime("1234",
"./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration")
+ val resourceAssignmentRuntimeService =
+ ResourceAssignmentUtils.transformToRARuntimeService(bluePrintRuntimeService, "test")
+
val executionServiceInput = JacksonUtils.readValueFromClassPathFile("payload/requests/sample-resourceresolution-request.json",
ExecutionServiceInput::class.java)!!
// Prepare Inputs
PayloadUtils.prepareInputsFromWorkflowPayload(bluePrintRuntimeService, executionServiceInput.payload, "resource-assignment")
- resourceResolutionService.resolveResources(bluePrintRuntimeService, "resource-assignment", "baseconfig", mapOf())
+ resourceResolutionService.resolveResources(resourceAssignmentRuntimeService, "resource-assignment", "baseconfig", mapOf())
}
}
@@ -101,6 +105,9 @@ class ResourceResolutionServiceTest {
val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime("1234",
"./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration")
+ val resourceAssignmentRuntimeService =
+ ResourceAssignmentUtils.transformToRARuntimeService(bluePrintRuntimeService, "test")
+
val executionServiceInput = JacksonUtils.readValueFromClassPathFile("payload/requests/sample-resourceresolution-request.json",
ExecutionServiceInput::class.java)!!
@@ -109,7 +116,7 @@ class ResourceResolutionServiceTest {
// Prepare Inputs
PayloadUtils.prepareInputsFromWorkflowPayload(bluePrintRuntimeService, executionServiceInput.payload, "resource-assignment")
- resourceResolutionService.resolveResources(bluePrintRuntimeService, "resource-assignment", artefactNames, mapOf())
+ resourceResolutionService.resolveResources(resourceAssignmentRuntimeService, "resource-assignment", artefactNames, mapOf())
}
}
@@ -123,6 +130,9 @@ class ResourceResolutionServiceTest {
val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime("1234",
"./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration")
+ val resourceAssignmentRuntimeService =
+ ResourceAssignmentUtils.transformToRARuntimeService(bluePrintRuntimeService, "test")
+
val executionServiceInput = JacksonUtils.readValueFromClassPathFile("payload/requests/sample-resourceresolution-request.json",
ExecutionServiceInput::class.java)!!
@@ -131,7 +141,7 @@ class ResourceResolutionServiceTest {
// Prepare Inputs
PayloadUtils.prepareInputsFromWorkflowPayload(bluePrintRuntimeService, executionServiceInput.payload, "resource-assignment")
- resourceResolutionService.resolveResources(bluePrintRuntimeService, "resource-assignment", artifactPrefix, mapOf<String, String>())
+ resourceResolutionService.resolveResources(resourceAssignmentRuntimeService, "resource-assignment", artifactPrefix, mapOf<String, String>())
}
}
}