aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/resource-resolution/src/test
diff options
context:
space:
mode:
authorSingal, Kapil (ks220y) <ks220y@att.com>2019-01-10 12:50:06 -0500
committerSingal, Kapil (ks220y) <ks220y@att.com>2019-01-11 10:08:58 -0500
commit636bf03c2a813c889921ff9a223f23e623532e69 (patch)
tree440eff81e7fd67110ae4c64940f59e06d0914789 /ms/blueprintsprocessor/functions/resource-resolution/src/test
parent3370454b30569f434a099973e1b63dc7142928f9 (diff)
Resource Resoulution Service
Implement Input Resource Resolution Processor Service along with Resource Resolution Utilities Change-Id: Ibb4899e415f4b79cd6cd1b190b0f4969b09c3fe4 Issue-ID: CCSDK-936 Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.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/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt9
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/payload/requests/sample-resourceresolution-request.json5
2 files changed, 13 insertions, 1 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt
index 7f41ba12f..46ccb9745 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt
@@ -19,8 +19,11 @@ package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution
import org.junit.Assert
import org.junit.Test
import org.junit.runner.RunWith
+import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ExecutionServiceInput
+import org.onap.ccsdk.apps.blueprintsprocessor.core.utils.PayloadUtils
import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.processor.*
import org.onap.ccsdk.apps.controllerblueprints.core.utils.BluePrintMetadataUtils
+import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.test.context.ContextConfiguration
@@ -62,6 +65,12 @@ class ResourceResolutionServiceTest {
val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime("1234",
"./../../../../components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration")
+ 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")
}
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/payload/requests/sample-resourceresolution-request.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/payload/requests/sample-resourceresolution-request.json
index 7889a7e43..c4fe4eab5 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/payload/requests/sample-resourceresolution-request.json
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/payload/requests/sample-resourceresolution-request.json
@@ -19,9 +19,12 @@
"resource-assignment-request": {
"resource-assignment-properties": {
"request-id": "1234",
+ "service-instance-id": "siid_1234",
+ "vnf-id": "vnf_1234",
"action-name": "assign-activate",
"scope-type": "vnf-type",
- "hostname": "localhost"
+ "hostname": "localhost",
+ "vnf_name": "temp_vnf"
}
}
}