aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2019-10-31 13:22:57 +0000
committerGerrit Code Review <gerrit@onap.org>2019-10-31 13:22:57 +0000
commit22d9fd4365d9b1c0198cffb76aea994eedb34fbb (patch)
treeee6afcaac767c866264295756b1b42d30d4dd1cb /ms/blueprintsprocessor/functions
parentdeeaa0a6df8f266c10130833f06dec0ca9773b78 (diff)
parentd39772eaeb2c6e6665c4a6d41f6af84f63151184 (diff)
Merge "Provide ongoing occurrence value for scripting"
Diffstat (limited to 'ms/blueprintsprocessor/functions')
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt6
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt1
2 files changed, 7 insertions, 0 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt
index ca623aa3b..28e7d395a 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt
@@ -198,6 +198,7 @@ open class ResourceResolutionServiceImpl(private var applicationContext: Applica
blueprintRuntimeService
}
+ exposeOccurrencePropertyInResourceAssignments(resourceAssignmentRuntimeService, properties)
coroutineScope {
bulkSequenced.forEach { batchResourceAssignments ->
@@ -352,4 +353,9 @@ open class ResourceResolutionServiceImpl(private var applicationContext: Applica
&& resourceResolution.dictionaryVersion == resourceAssignment.version)
}
+ private fun exposeOccurrencePropertyInResourceAssignments(raRuntimeService: ResourceAssignmentRuntimeService,
+ properties: Map<String, Any>) {
+ raRuntimeService.putResolutionStore(ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_OCCURRENCE,
+ properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_OCCURRENCE].asJsonPrimitive())
+ }
}
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 775c501c2..5a5336ae3 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
@@ -261,6 +261,7 @@ class ResourceResolutionServiceTest {
every { raRuntimeService.getBluePrintError() } returns BluePrintError()
every { raRuntimeService.setBluePrintError(any())} returns Unit
every { raRuntimeService.getInputValue("device-id") } returns "123456".asJsonPrimitive()
+ every { raRuntimeService.putResolutionStore(any(), any()) } returns Unit
val applicationContext = mockk<ApplicationContext>()
every { applicationContext.getBean("rr-processor-source-capability") } returns MockCapabilityScriptRA()