diff options
author | Steve Siani <alphonse.steve.siani.djissitchi@ibm.com> | 2019-05-21 15:56:25 -0400 |
---|---|---|
committer | Gaurav Agrawal <gaurav.agrawal@huawei.com> | 2019-05-28 07:40:36 +0000 |
commit | 6d14307d6019369a808c2dddb0f75b12996391dc (patch) | |
tree | 1f9c236f39fdd7479ac9395f80f6e0af23a71d00 /ms/blueprintsprocessor/functions/resource-resolution/src/test | |
parent | 1f69e1c3569196305c23f085cfbc03bdba14f4e0 (diff) |
Bug fix: Enrichment fails for processor-db source
Issue-ID: CCSDK-1324
Signed-off-by: Steve Siani <alphonse.steve.siani.djissitchi@ibm.com>
Change-Id: I21705485de9a11a65c1e032fc121c89917334104
Diffstat (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/test')
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 |