summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/resource-resolution/src
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh <brindasanth@in.ibm.com>2019-03-11 16:34:55 -0400
committerMuthuramalingam, Brinda Santh <brindasanth@in.ibm.com>2019-03-13 15:09:10 -0400
commit2a4848031776982dbefbde5b27442fd20c01d344 (patch)
tree7cfd9ed6617427c96892cfbd9f2fd3127bd7cee5 /ms/blueprintsprocessor/functions/resource-resolution/src
parent5dfc1bc16546a146b911ff1f19dd549da27926e0 (diff)
Improve RA capability processor.
Change-Id: I44a8157c9e2a27b49aa8af00a857ebc7b3e845c3 Issue-ID: CCSDK-1137 Signed-off-by: Muthuramalingam, Brinda Santh <brindasanth@in.ibm.com>
Diffstat (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src')
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt86
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessor.kt135
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt2
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessorTest.kt10
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/capability/jython-resource-definitions.json2
5 files changed, 81 insertions, 154 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt
index c12823442..335aea1ef 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt
@@ -59,14 +59,14 @@ interface ResourceResolutionService {
@Service(ResourceResolutionConstants.SERVICE_RESOURCE_RESOLUTION)
open class ResourceResolutionServiceImpl(private var applicationContext: ApplicationContext,
private var resolutionResultService: ResourceResolutionResultService) :
- ResourceResolutionService {
+ ResourceResolutionService {
private val log = LoggerFactory.getLogger(ResourceResolutionService::class.java)
override fun registeredResourceSources(): List<String> {
return applicationContext.getBeanNamesForType(ResourceAssignmentProcessor::class.java)
- .filter { it.startsWith(ResourceResolutionConstants.PREFIX_RESOURCE_RESOLUTION_PROCESSOR) }
- .map { it.substringAfter(ResourceResolutionConstants.PREFIX_RESOURCE_RESOLUTION_PROCESSOR) }
+ .filter { it.startsWith(ResourceResolutionConstants.PREFIX_RESOURCE_RESOLUTION_PROCESSOR) }
+ .map { it.substringAfter(ResourceResolutionConstants.PREFIX_RESOURCE_RESOLUTION_PROCESSOR) }
}
override fun resolveResources(bluePrintRuntimeService: BluePrintRuntimeService<*>, nodeTemplateName: String,
@@ -92,7 +92,7 @@ open class ResourceResolutionServiceImpl(private var applicationContext: Applica
val result = resolveResources(bluePrintRuntimeService, nodeTemplateName, artifactMapping, artifactTemplate)
if (properties.containsKey(ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_STORE_RESULT)
- && properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_STORE_RESULT] as Boolean) {
+ && properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_STORE_RESULT] as Boolean) {
resolutionResultService.write(properties, result, bluePrintRuntimeService, artifactPrefix)
}
@@ -113,32 +113,32 @@ open class ResourceResolutionServiceImpl(private var applicationContext: Applica
val identifierName = artifactTemplate ?: "no-template"
val resourceAssignmentContent =
- bluePrintRuntimeService.resolveNodeTemplateArtifact(nodeTemplateName, artifactMapping)
+ bluePrintRuntimeService.resolveNodeTemplateArtifact(nodeTemplateName, artifactMapping)
val resourceAssignments: MutableList<ResourceAssignment> =
- JacksonUtils.getListFromJson(resourceAssignmentContent, ResourceAssignment::class.java)
- as? MutableList<ResourceAssignment>
- ?: throw BluePrintProcessorException("couldn't get Dictionary Definitions")
+ JacksonUtils.getListFromJson(resourceAssignmentContent, ResourceAssignment::class.java)
+ as? MutableList<ResourceAssignment>
+ ?: throw BluePrintProcessorException("couldn't get Dictionary Definitions")
// Get the Resource Dictionary Name
val dictionaryFile = bluePrintRuntimeService.bluePrintContext().rootPath.plus(File.separator)
- .plus(BluePrintConstants.TOSCA_DEFINITIONS_DIR).plus(File.separator)
- .plus(ResourceResolutionConstants.FILE_NAME_RESOURCE_DEFINITION_TYPES)
+ .plus(BluePrintConstants.TOSCA_DEFINITIONS_DIR).plus(File.separator)
+ .plus(ResourceResolutionConstants.FILE_NAME_RESOURCE_DEFINITION_TYPES)
val resourceDictionaries: MutableMap<String, ResourceDefinition> =
- JacksonUtils.getMapFromFile(dictionaryFile, ResourceDefinition::class.java)
- ?: throw BluePrintProcessorException("couldn't get Dictionary Definitions")
+ JacksonUtils.getMapFromFile(dictionaryFile, ResourceDefinition::class.java)
+ ?: throw BluePrintProcessorException("couldn't get Dictionary Definitions")
// Resolve resources
resolveResourceAssignments(bluePrintRuntimeService, resourceDictionaries, resourceAssignments, identifierName)
val resolvedParamJsonContent =
- ResourceAssignmentUtils.generateResourceDataForAssignments(resourceAssignments.toList())
+ ResourceAssignmentUtils.generateResourceDataForAssignments(resourceAssignments.toList())
// Check Template is there
if (artifactTemplate != null) {
val templateContent =
- bluePrintRuntimeService.resolveNodeTemplateArtifact(nodeTemplateName, artifactTemplate)
+ bluePrintRuntimeService.resolveNodeTemplateArtifact(nodeTemplateName, artifactTemplate)
resolvedContent = BluePrintTemplateService.generateContent(templateContent, resolvedParamJsonContent)
} else {
resolvedContent = resolvedParamJsonContent
@@ -159,35 +159,33 @@ open class ResourceResolutionServiceImpl(private var applicationContext: Applica
val bulkSequenced = BulkResourceSequencingUtils.process(resourceAssignments)
val resourceAssignmentRuntimeService =
- ResourceAssignmentUtils.transformToRARuntimeService(blueprintRuntimeService, identifierName)
+ ResourceAssignmentUtils.transformToRARuntimeService(blueprintRuntimeService, identifierName)
bulkSequenced.map { batchResourceAssignments ->
batchResourceAssignments.filter { it.name != "*" && it.name != "start" }
- .forEach { resourceAssignment ->
- val dictionaryName = resourceAssignment.dictionaryName
- val dictionarySource = resourceAssignment.dictionarySource
- /**
- * Get the Processor name
- */
- val processorName = processorName(dictionaryName!!, dictionarySource!!,
- resourceDictionaries)
-
- val resourceAssignmentProcessor =
- applicationContext.getBean(processorName) as? ResourceAssignmentProcessor
- ?: throw BluePrintProcessorException("failed to get resource processor for name($processorName) " +
- "for resource assignment(${resourceAssignment.name})")
- try {
- // Set BluePrint Runtime Service
- resourceAssignmentProcessor.raRuntimeService = resourceAssignmentRuntimeService
- // Set Resource Dictionaries
- resourceAssignmentProcessor.resourceDictionaries = resourceDictionaries
- // Invoke Apply Method
- resourceAssignmentProcessor.apply(resourceAssignment)
- } catch (e: RuntimeException) {
- resourceAssignmentProcessor.recover(e, resourceAssignment)
- throw BluePrintProcessorException(e)
+ .forEach { resourceAssignment ->
+ val dictionaryName = resourceAssignment.dictionaryName
+ val dictionarySource = resourceAssignment.dictionarySource
+ /**
+ * Get the Processor name
+ */
+ val processorName = processorName(dictionaryName!!, dictionarySource!!, resourceDictionaries)
+
+ val resourceAssignmentProcessor =
+ applicationContext.getBean(processorName) as? ResourceAssignmentProcessor
+ ?: throw BluePrintProcessorException("failed to get resource processor for name($processorName) " +
+ "for resource assignment(${resourceAssignment.name})")
+ try {
+ // Set BluePrint Runtime Service
+ resourceAssignmentProcessor.raRuntimeService = resourceAssignmentRuntimeService
+ // Set Resource Dictionaries
+ resourceAssignmentProcessor.resourceDictionaries = resourceDictionaries
+ // Invoke Apply Method
+ resourceAssignmentProcessor.apply(resourceAssignment)
+ } catch (e: RuntimeException) {
+ throw BluePrintProcessorException(e)
+ }
}
- }
}
}
@@ -208,18 +206,18 @@ open class ResourceResolutionServiceImpl(private var applicationContext: Applica
}
else -> {
val resourceDefinition = resourceDictionaries[dictionaryName]
- ?: throw BluePrintProcessorException("couldn't get resource dictionary definition for $dictionaryName")
+ ?: throw BluePrintProcessorException("couldn't get resource dictionary definition for $dictionaryName")
val resourceSource = resourceDefinition.sources[dictionarySource]
- ?: throw BluePrintProcessorException("couldn't get resource definition $dictionaryName source($dictionarySource)")
+ ?: throw BluePrintProcessorException("couldn't get resource definition $dictionaryName source($dictionarySource)")
processorName = ResourceResolutionConstants.PREFIX_RESOURCE_RESOLUTION_PROCESSOR
- .plus(resourceSource.type)
+ .plus(resourceSource.type)
}
}
checkNotEmptyOrThrow(processorName,
- "couldn't get processor name for resource dictionary definition($dictionaryName) source" +
- "($dictionarySource)")
+ "couldn't get processor name for resource dictionary definition($dictionaryName) source" +
+ "($dictionarySource)")
return processorName
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessor.kt
index c2dbd7312..6469e78da 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessor.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessor.kt
@@ -20,10 +20,8 @@ package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.pr
import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.CapabilityResourceSource
import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants.PREFIX_RESOURCE_RESOLUTION_PROCESSOR
-import org.onap.ccsdk.apps.blueprintsprocessor.services.execution.scripts.BlueprintJythonService
-import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.apps.blueprintsprocessor.services.execution.ComponentFunctionScriptingService
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException
-import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintScriptsService
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment
import org.slf4j.LoggerFactory
@@ -31,14 +29,16 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory
import org.springframework.context.ApplicationContext
import org.springframework.context.annotation.Scope
import org.springframework.stereotype.Service
-import java.io.File
@Service("${PREFIX_RESOURCE_RESOLUTION_PROCESSOR}source-capability")
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
-open class CapabilityResourceResolutionProcessor(private var applicationContext: ApplicationContext,
- private val bluePrintScriptsService: BluePrintScriptsService,
- private val bluePrintJythonService: BlueprintJythonService) :
- ResourceAssignmentProcessor() {
+open class CapabilityResourceResolutionProcessor(private val applicationContext: ApplicationContext,
+ private var componentFunctionScriptingService: ComponentFunctionScriptingService)
+ : ResourceAssignmentProcessor() {
+
+ private val log = LoggerFactory.getLogger(CapabilityResourceResolutionProcessor::class.java)
+
+ var componentResourceAssignmentProcessor: ResourceAssignmentProcessor? = null
override fun getName(): String {
return "${PREFIX_RESOURCE_RESOLUTION_PROCESSOR}source-capability"
@@ -62,118 +62,43 @@ open class CapabilityResourceResolutionProcessor(private var applicationContext:
val scriptType = capabilityResourceSourceProperty.scriptType
val scriptClassReference = capabilityResourceSourceProperty.scriptClassReference
+ val instanceDependencies = capabilityResourceSourceProperty.instanceDependencies ?: listOf()
- var componentResourceAssignmentProcessor: ResourceAssignmentProcessor? = null
-
- when (scriptType) {
- BluePrintConstants.SCRIPT_KOTLIN -> {
- componentResourceAssignmentProcessor = getKotlinResourceAssignmentProcessorInstance(scriptClassReference,
- capabilityResourceSourceProperty.instanceDependencies)
- }
- BluePrintConstants.SCRIPT_INTERNAL -> {
- // Initialize Capability Resource Assignment Processor
- componentResourceAssignmentProcessor = applicationContext.getBean(scriptClassReference, ResourceAssignmentProcessor::class.java)
- }
- BluePrintConstants.SCRIPT_JYTHON -> {
- val content = getJythonContent(scriptClassReference)
- componentResourceAssignmentProcessor = getJythonResourceAssignmentProcessorInstance(scriptClassReference,
- content, capabilityResourceSourceProperty.instanceDependencies)
- }
- }
+ componentResourceAssignmentProcessor = scriptInstance(scriptType, scriptClassReference, instanceDependencies)
- checkNotNull(componentResourceAssignmentProcessor) { "failed to get capability resource assignment processor($scriptClassReference)" }
+ checkNotNull(componentResourceAssignmentProcessor) {
+ "failed to get capability resource assignment processor($scriptClassReference)"
+ }
// Assign Current Blueprint runtime and ResourceDictionaries
- componentResourceAssignmentProcessor.raRuntimeService = raRuntimeService
- componentResourceAssignmentProcessor.resourceDictionaries = resourceDictionaries
+ componentResourceAssignmentProcessor!!.raRuntimeService = raRuntimeService
+ componentResourceAssignmentProcessor!!.resourceDictionaries = resourceDictionaries
// Invoke componentResourceAssignmentProcessor
- componentResourceAssignmentProcessor.apply(resourceAssignment)
+ componentResourceAssignmentProcessor!!.apply(resourceAssignment)
}
override fun recover(runtimeException: RuntimeException, resourceAssignment: ResourceAssignment) {
-
- TODO("To Implement")
- }
-
- private fun getKotlinResourceAssignmentProcessorInstance(scriptClassName: String,
- instanceNames: List<String>? = null): ResourceAssignmentProcessor {
- var scriptPropertyInstances: MutableMap<String, Any>? = null
-
- if (instanceNames != null && instanceNames.isNotEmpty()) {
- scriptPropertyInstances = hashMapOf()
- instanceNames.forEach {
- scriptPropertyInstances[it] = applicationContext.getBean(it)
- ?: throw BluePrintProcessorException("couldn't get the dependency instance($it)")
- }
- }
-
- return getKotlinResourceAssignmentProcessorInstance(scriptClassName, scriptPropertyInstances)
-
- }
-
- fun getKotlinResourceAssignmentProcessorInstance(scriptClassName: String,
- scriptPropertyInstances: MutableMap<String, Any>? = null):
- ResourceAssignmentProcessor {
-
- val resourceAssignmentProcessor = bluePrintScriptsService
- .scriptInstance<ResourceAssignmentProcessor>(raRuntimeService.bluePrintContext(),
- scriptClassName, false)
-
- // Add additional Instance
- if (scriptPropertyInstances != null) {
- resourceAssignmentProcessor.scriptPropertyInstances = scriptPropertyInstances
+ log.info("Recovering for : ${resourceAssignment.name} : ${runtimeException.toString()}")
+ if (componentResourceAssignmentProcessor != null) {
+ componentResourceAssignmentProcessor!!.recover(runtimeException, resourceAssignment)
}
-
- return resourceAssignmentProcessor
- }
-
- private fun getJythonContent(instanceName: String): String {
- val absolutePath = raRuntimeService.bluePrintContext().rootPath
- .plus(File.separator)
- .plus(BluePrintConstants.TOSCA_SCRIPTS_JYTHON_DIR)
- .plus(File.separator)
- .plus("$instanceName.py")
-
- return JacksonUtils.getContent(absolutePath)
-
}
- /**
- * getJythonResourceAssignmentProcessorInstance Purpose: prepare the jython
- * executor component as a resource assignment processor
- *
- * @param pythonClassName String
- * @param content String
- * @param dependencyInstances List<String>
- * @return resourceAssignmentProcessor ResourceAssignmentProcessor
- */
- private fun getJythonResourceAssignmentProcessorInstance(pythonClassName: String, content: String,
- dependencyInstances: List<String>?):
- ResourceAssignmentProcessor {
- val jythonContextInstance: MutableMap<String, Any> = hashMapOf()
- jythonContextInstance["log"] = LoggerFactory.getLogger(pythonClassName)
- jythonContextInstance["raRuntimeService"] = raRuntimeService
- dependencyInstances?.forEach { instanceName ->
- jythonContextInstance[instanceName] = applicationContext.getBean(instanceName)
- }
-
- return getJythonResourceAssignmentProcessorInstance(pythonClassName, content, jythonContextInstance)
- }
+ fun scriptInstance(scriptType: String, scriptClassReference: String, instanceDependencies: List<String>)
+ : ResourceAssignmentProcessor {
- fun getJythonResourceAssignmentProcessorInstance(pythonClassName: String, content: String,
- dependencyInstances: MutableMap<String, Any>):
- ResourceAssignmentProcessor {
+ log.info("creating resource resolution of script type($scriptType), reference name($scriptClassReference) and" +
+ "instanceDependencies($instanceDependencies)")
- val resourceAssignmentProcessor = bluePrintJythonService
- .jythonInstance<ResourceAssignmentProcessor>(raRuntimeService.bluePrintContext(), pythonClassName,
- content, dependencyInstances)
+ val scriptComponent = componentFunctionScriptingService
+ .scriptInstance<ResourceAssignmentProcessor>(raRuntimeService.bluePrintContext(), scriptType,
+ scriptClassReference)
- // Add additional Instance
- if (dependencyInstances != null) {
- resourceAssignmentProcessor.scriptPropertyInstances = dependencyInstances
+ instanceDependencies.forEach { instanceDependency ->
+ scriptPropertyInstances[instanceDependency] = applicationContext
+ .getBean(instanceDependency)
}
-
- return resourceAssignmentProcessor
+ return scriptComponent
}
} \ No newline at end of file
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt
index 64cc1d2d0..8e9606c4e 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt
@@ -37,7 +37,7 @@ abstract class ResourceAssignmentProcessor : BlueprintFunctionNode<ResourceAssig
lateinit var raRuntimeService: ResourceAssignmentRuntimeService
lateinit var resourceDictionaries: MutableMap<String, ResourceDefinition>
- var scriptPropertyInstances: Map<String, Any> = hashMapOf()
+ var scriptPropertyInstances: MutableMap<String, Any> = hashMapOf()
/**
* This will be called from the scripts to serve instance from runtime to scripts.
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessorTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessorTest.kt
index f779054e9..6da3fd71e 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessorTest.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessorTest.kt
@@ -21,6 +21,7 @@ package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.pr
import org.junit.Test
import org.junit.runner.RunWith
import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.ResourceAssignmentRuntimeService
+import org.onap.ccsdk.apps.blueprintsprocessor.services.execution.ComponentFunctionScriptingService
import org.onap.ccsdk.apps.blueprintsprocessor.services.execution.scripts.BlueprintJythonService
import org.onap.ccsdk.apps.blueprintsprocessor.services.execution.scripts.PythonExecutorProperty
import org.onap.ccsdk.apps.controllerblueprints.core.data.PropertyDefinition
@@ -36,7 +37,8 @@ import org.springframework.test.context.junit4.SpringRunner
import kotlin.test.assertNotNull
@RunWith(SpringRunner::class)
-@ContextConfiguration(classes = [CapabilityResourceResolutionProcessor::class, BluePrintScriptsServiceImpl::class,
+@ContextConfiguration(classes = [CapabilityResourceResolutionProcessor::class, ComponentFunctionScriptingService::class,
+ BluePrintScriptsServiceImpl::class,
BlueprintJythonService::class, PythonExecutorProperty::class, MockCapabilityService::class])
@TestPropertySource(properties =
["blueprints.processor.functions.python.executor.modulePaths=./../../../../components/scripts/python/ccsdk_blueprints",
@@ -62,9 +64,11 @@ class CapabilityResourceResolutionProcessorTest {
scriptPropertyInstances["mock-service1"] = MockCapabilityService()
scriptPropertyInstances["mock-service2"] = MockCapabilityService()
+ val instanceDependencies: List<String> = listOf()
+
val resourceAssignmentProcessor = capabilityResourceResolutionProcessor
- .getKotlinResourceAssignmentProcessorInstance(
- "ResourceAssignmentProcessor_cba\$ScriptResourceAssignmentProcessor", scriptPropertyInstances)
+ .scriptInstance("kotlin",
+ "ResourceAssignmentProcessor_cba\$ScriptResourceAssignmentProcessor", instanceDependencies)
assertNotNull(resourceAssignmentProcessor, "couldn't get kotlin script resource assignment processor")
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/capability/jython-resource-definitions.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/capability/jython-resource-definitions.json
index fe89291c1..b565eec81 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/capability/jython-resource-definitions.json
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/capability/jython-resource-definitions.json
@@ -11,7 +11,7 @@
"type": "source-capability",
"properties": {
"script-type": "jython",
- "script-class-reference": "SampleRAProcessor",
+ "script-class-reference": "Scripts/python/SampleRAProcessor.py",
"instance-dependencies": []
}
}