summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/resource-resolution/src/test
diff options
context:
space:
mode:
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/processor/DatabaseResourceResolutionProcessorTest.kt29
1 files changed, 28 insertions, 1 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceResolutionProcessorTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceResolutionProcessorTest.kt
index 89674ea24..f73197e0b 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceResolutionProcessorTest.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceResolutionProcessorTest.kt
@@ -49,7 +49,7 @@ class DatabaseResourceResolutionProcessorTest {
lateinit var databaseResourceAssignmentProcessor: DatabaseResourceAssignmentProcessor
@Test
- fun `test database resource resolution`() {
+ fun `test database resource resolution processor db`() {
runBlocking {
val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext(
"./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration")
@@ -74,4 +74,31 @@ class DatabaseResourceResolutionProcessorTest {
println(processorName)
}
}
+
+ @Test
+ fun `test database resource resolution primary db`() {
+ runBlocking {
+ val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext(
+ "./../../../../components/model-catalog/blueprint-model/test-blueprint/capability_python")
+
+ val resourceAssignmentRuntimeService = ResourceAssignmentRuntimeService("1234", bluePrintContext)
+
+ databaseResourceAssignmentProcessor.raRuntimeService = resourceAssignmentRuntimeService
+ databaseResourceAssignmentProcessor.resourceDictionaries = ResourceAssignmentUtils
+ .resourceDefinitions(bluePrintContext.rootPath)
+
+ val resourceAssignment = ResourceAssignment().apply {
+ name = "service-instance-id"
+ dictionaryName = "service-instance-id"
+ dictionarySource = "primary-db"
+ property = PropertyDefinition().apply {
+ type = "string"
+ }
+ }
+
+ val processorName = databaseResourceAssignmentProcessor.applyNB(resourceAssignment)
+ assertNotNull(processorName, "couldn't get Database resource assignment processor name")
+ println(processorName)
+ }
+ }
} \ No newline at end of file