diff options
Diffstat (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/test')
-rw-r--r-- | ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentTest.kt | 6 | ||||
-rw-r--r-- | ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt | 9 | ||||
-rw-r--r-- | ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessorTest.kt (renamed from ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceAssignmentProcessorTest.kt) | 20 | ||||
-rw-r--r-- | ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/capability/jython-resource-definitions.json | 4 |
4 files changed, 20 insertions, 19 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentTest.kt index fbecb55c3..c3b101840 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentTest.kt @@ -42,9 +42,9 @@ import org.springframework.test.context.junit4.SpringRunner @RunWith(SpringRunner::class) @ContextConfiguration(classes = [ResourceResolutionServiceImpl::class, - InputResourceAssignmentProcessor::class, DefaultResourceAssignmentProcessor::class, - PrimaryDataResourceAssignmentProcessor::class, SimpleRestResourceAssignmentProcessor::class, - CapabilityResourceAssignmentProcessor::class, PrimaryDBLibGenericService::class, + InputResourceResolutionProcessor::class, DefaultResourceResolutionProcessor::class, + PrimaryDataResourceResolutionProcessor::class, RestResourceResolutionProcessor::class, + CapabilityResourceResolutionProcessor::class, PrimaryDBLibGenericService::class, BlueprintPropertyConfiguration::class, BluePrintProperties::class, BluePrintDBLibConfiguration::class, BluePrintLoadConfiguration::class]) @TestPropertySource(locations = ["classpath:application-test.properties"]) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt index d0d3a13fe..6d2d3f2df 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt @@ -47,9 +47,9 @@ import kotlin.test.assertTrue */ @RunWith(SpringRunner::class) @ContextConfiguration(classes = [ResourceResolutionServiceImpl::class, - InputResourceAssignmentProcessor::class, DefaultResourceAssignmentProcessor::class, - PrimaryDataResourceAssignmentProcessor::class, SimpleRestResourceAssignmentProcessor::class, - CapabilityResourceAssignmentProcessor::class, PrimaryDBLibGenericService::class, + InputResourceResolutionProcessor::class, DefaultResourceResolutionProcessor::class, + PrimaryDataResourceResolutionProcessor::class, RestResourceResolutionProcessor::class, + CapabilityResourceResolutionProcessor::class, PrimaryDBLibGenericService::class, BlueprintPropertyConfiguration::class, BluePrintProperties::class, BluePrintDBLibConfiguration::class, BluePrintLoadConfiguration::class]) @TestPropertySource(locations = ["classpath:application-test.properties"]) @@ -66,7 +66,8 @@ class ResourceResolutionServiceTest { fun testRegisteredSource() { val sources = resourceResolutionService.registeredResourceSources() assertNotNull(sources, "failed to get registered sources") - assertTrue(sources.containsAll(arrayListOf("input", "default", "primary-db", "primary-config-data")), "failed to get registered sources") + assertTrue(sources.containsAll(arrayListOf("source-input", "source-default", "source-primary-db", + "source-rest")), "failed to get registered sources") } @Test diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceAssignmentProcessorTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessorTest.kt index 0dbd0f6e3..f779054e9 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceAssignmentProcessorTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessorTest.kt @@ -20,9 +20,9 @@ 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.scripts.BlueprintJythonService import org.onap.ccsdk.apps.blueprintsprocessor.services.execution.scripts.PythonExecutorProperty -import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.ResourceAssignmentRuntimeService import org.onap.ccsdk.apps.controllerblueprints.core.data.PropertyDefinition import org.onap.ccsdk.apps.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils @@ -36,15 +36,15 @@ import org.springframework.test.context.junit4.SpringRunner import kotlin.test.assertNotNull @RunWith(SpringRunner::class) -@ContextConfiguration(classes = [CapabilityResourceAssignmentProcessor::class, BluePrintScriptsServiceImpl::class, +@ContextConfiguration(classes = [CapabilityResourceResolutionProcessor::class, BluePrintScriptsServiceImpl::class, BlueprintJythonService::class, PythonExecutorProperty::class, MockCapabilityService::class]) @TestPropertySource(properties = ["blueprints.processor.functions.python.executor.modulePaths=./../../../../components/scripts/python/ccsdk_blueprints", "blueprints.processor.functions.python.executor.executionPath=./../../../../components/scripts/python/ccsdk_blueprints"]) -class CapabilityResourceAssignmentProcessorTest { +class CapabilityResourceResolutionProcessorTest { @Autowired - lateinit var capabilityResourceAssignmentProcessor: CapabilityResourceAssignmentProcessor + lateinit var capabilityResourceResolutionProcessor: CapabilityResourceResolutionProcessor @Test fun `test kotlin capability`() { @@ -54,15 +54,15 @@ class CapabilityResourceAssignmentProcessorTest { val resourceAssignmentRuntimeService = ResourceAssignmentRuntimeService("1234", bluePrintContext) - capabilityResourceAssignmentProcessor.raRuntimeService = resourceAssignmentRuntimeService - capabilityResourceAssignmentProcessor.resourceDictionaries = hashMapOf() + capabilityResourceResolutionProcessor.raRuntimeService = resourceAssignmentRuntimeService + capabilityResourceResolutionProcessor.resourceDictionaries = hashMapOf() val scriptPropertyInstances: MutableMap<String, Any> = mutableMapOf() scriptPropertyInstances["mock-service1"] = MockCapabilityService() scriptPropertyInstances["mock-service2"] = MockCapabilityService() - val resourceAssignmentProcessor = capabilityResourceAssignmentProcessor + val resourceAssignmentProcessor = capabilityResourceResolutionProcessor .getKotlinResourceAssignmentProcessorInstance( "ResourceAssignmentProcessor_cba\$ScriptResourceAssignmentProcessor", scriptPropertyInstances) @@ -90,14 +90,14 @@ class CapabilityResourceAssignmentProcessorTest { val resourceAssignmentRuntimeService = ResourceAssignmentRuntimeService("1234", bluePrintContext) - capabilityResourceAssignmentProcessor.raRuntimeService = resourceAssignmentRuntimeService + capabilityResourceResolutionProcessor.raRuntimeService = resourceAssignmentRuntimeService val resourceDefinition = JacksonUtils .readValueFromClassPathFile("mapping/capability/jython-resource-definitions.json", ResourceDefinition::class.java)!! val resourceDefinitions: MutableMap<String, ResourceDefinition> = mutableMapOf() resourceDefinitions[resourceDefinition.name] = resourceDefinition - capabilityResourceAssignmentProcessor.resourceDictionaries = resourceDefinitions + capabilityResourceResolutionProcessor.resourceDictionaries = resourceDefinitions val resourceAssignment = ResourceAssignment().apply { name = "service-instance-id" @@ -108,7 +108,7 @@ class CapabilityResourceAssignmentProcessorTest { } } - val processorName = capabilityResourceAssignmentProcessor.apply(resourceAssignment) + val processorName = capabilityResourceResolutionProcessor.apply(resourceAssignment) assertNotNull(processorName, "couldn't get Jython script resource assignment processor name") } 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 d3780e0a0..fe89291c1 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 @@ -10,8 +10,8 @@ "capability": { "type": "source-capability", "properties": { - "type": "JYTHON-COMPONENT", - "instance-name": "SampleRAProcessor", + "script-type": "jython", + "script-class-reference": "SampleRAProcessor", "instance-dependencies": [] } } |