diff options
author | Dan Timoney <dtimoney@att.com> | 2019-11-01 20:23:33 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-11-01 20:23:33 +0000 |
commit | fe3cd654fa059670be9d7c7ca762c83a0960c308 (patch) | |
tree | 58d0433be7ff9a3aa9484a1f5c7d7282048647b4 /ms | |
parent | f68617405e85856cadac9266deb27323ad77c611 (diff) | |
parent | 7ef88712a8535c44e844b6a064ff7aaf7ceb9bc8 (diff) |
Merge "Provide ongoing occurrence value for scripting" into elalto
Diffstat (limited to 'ms')
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 8651e2620..7e4d8efcf 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 @@ -199,6 +199,7 @@ open class ResourceResolutionServiceImpl(private var applicationContext: Applica blueprintRuntimeService } + exposeOccurrencePropertyInResourceAssignments(resourceAssignmentRuntimeService, properties) coroutineScope { bulkSequenced.forEach { batchResourceAssignments -> @@ -353,4 +354,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() |