Add Java Capability resource assignment processor
authorMuthuramalingam, Brinda Santh <bs2796@att.com>
Tue, 8 Jan 2019 04:15:01 +0000 (23:15 -0500)
committerBrinda Santh Muthuramalingam <bs2796@att.com>
Thu, 10 Jan 2019 18:20:57 +0000 (18:20 +0000)
Change-Id: I21cea850d8fbe1c9f0a01fdc72f7147a2827ae03
Issue-ID: CCSDK-665
Signed-off-by: Muthuramalingam, Brinda Santh <bs2796@att.com>
12 files changed:
ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponent.kt
ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt
ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceSourceProperties.kt [new file with mode: 0644]
ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceAssignmentProcessor.kt [new file with mode: 0644]
ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/DataBaseResourceAssignmentProcessor.kt [moved from ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolutionprocessor/DataBaseResourceAssignmentProcessor.kt with 98% similarity]
ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/DefaultResourceAssignmentProcessor.kt [moved from ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolutionprocessor/DefaultResourceAssignmentProcessor.kt with 95% similarity]
ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/InputResourceAssignmentProcessor.kt [moved from ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolutionprocessor/InputResourceAssignmentProcessor.kt with 95% similarity]
ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt [moved from ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolutionprocessor/ResourceAssignmentProcessor.kt with 93% similarity]
ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/SimpleRestResourceAssignmentProcessor.kt [moved from ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolutionprocessor/SimpleRestResourceAssignmentProcessor.kt with 98% similarity]
ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/utils/ResourceResolutionUtils.kt [new file with mode: 0644]
ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentTest.kt
ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt

index 0becc00..53a2153 100644 (file)
@@ -21,9 +21,7 @@ import org.onap.ccsdk.apps.blueprintsprocessor.services.execution.AbstractCompon
 import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException\r
 import org.onap.ccsdk.apps.controllerblueprints.core.asJsonNode\r
 import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils\r
-import org.springframework.beans.factory.annotation.Autowired\r
 import org.springframework.beans.factory.config.ConfigurableBeanFactory\r
-import org.springframework.context.ApplicationContext\r
 import org.springframework.context.annotation.Scope\r
 import org.springframework.stereotype.Component\r
 \r
@@ -31,9 +29,6 @@ import org.springframework.stereotype.Component
 @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)\r
 open class ResourceResolutionComponent(private val resourceResolutionService: ResourceResolutionService) : AbstractComponentFunction() {\r
 \r
-    @Autowired\r
-    private lateinit var applicationContext: ApplicationContext\r
-\r
     override fun process(executionRequest: ExecutionServiceInput) {\r
 \r
         val artifactPrefixNamesNode = getOperationInput(ResourceResolutionConstants.INPUT_ARTIFACT_PREFIX_NAMES)\r
index 16db9c9..5a7161d 100644 (file)
@@ -17,7 +17,7 @@
 \r
 package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution\r
 \r
-import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolutionprocessor.ResourceAssignmentProcessor\r
+import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.processor.ResourceAssignmentProcessor\r
 import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants\r
 import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException\r
 import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintRuntimeService\r
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceSourceProperties.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceSourceProperties.kt
new file mode 100644 (file)
index 0000000..b141025
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution
+
+open class ResourceSourceProperties {
+
+}
+
+open class InputResourceSource : ResourceSourceProperties() {
+    lateinit var key: String
+    lateinit var keyDependencies: MutableList<String>
+}
+
+open class DefaultResourceSource : ResourceSourceProperties() {
+    lateinit var key: String
+    lateinit var keyDependencies: MutableList<String>
+}
+
+open class DatabaseResourceSource : ResourceSourceProperties() {
+    lateinit var type: String
+    lateinit var query: String
+    var inputKeyMapping: MutableList<String>? = null
+    var outputKeyMapping: MutableList<String>? = null
+    lateinit var keyDependencies: MutableList<String>
+}
+
+open class RestResourceSource : ResourceSourceProperties() {
+    lateinit var type: String
+    lateinit var urlPath: String
+    lateinit var path: String
+    lateinit var expressionType: String
+    var inputKeyMapping: MutableList<String>? = null
+    var outputKeyMapping: MutableList<String>? = null
+    lateinit var keyDependencies: MutableList<String>
+}
+
+open class CapabilityResourceSource : ResourceSourceProperties() {
+    lateinit var type: String
+    lateinit var instanceName: String
+    lateinit var path: String
+    lateinit var expressionType: String
+    var inputKeyMapping: MutableList<String>? = null
+    var outputKeyMapping: MutableList<String>? = null
+    lateinit var keyDependencies: MutableList<String>
+}
\ 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/CapabilityResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceAssignmentProcessor.kt
new file mode 100644 (file)
index 0000000..f1de8f7
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.processor
+
+import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.CapabilityResourceSource
+import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.utils.ResourceResolutionUtils
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.context.ApplicationContext
+import org.springframework.stereotype.Service
+
+@Service("resource-assignment-processor-capability")
+open class CapabilityResourceAssignmentProcessor : ResourceAssignmentProcessor() {
+
+    companion object {
+        const val CAPABILITY_TYPE_JAVA_COMPONENT = "JAVA-COMPONENT"
+        const val CAPABILITY_TYPE_JYTHON_COMPONENT = "JYTHON-COMPONENT"
+    }
+
+    @Autowired
+    private lateinit var applicationContext: ApplicationContext
+
+    override fun getName(): String {
+        return "resource-assignment-processor-capability"
+    }
+
+    override fun process(executionRequest: ResourceAssignment) {
+
+        val resourceDefinition = resourceDictionaries[executionRequest.dictionaryName]
+                ?: throw BluePrintProcessorException("couldn't get resource definition for ${executionRequest.dictionaryName}")
+
+        val resourceSource = resourceDefinition.sources[executionRequest.dictionarySource]
+                ?: throw BluePrintProcessorException("couldn't get resource definition ${executionRequest.dictionaryName} source(${executionRequest.dictionarySource})")
+
+        checkNotNull(resourceSource.properties) { "failed to get ${executionRequest.dictionarySource} properties" }
+
+        val capabilityResourceSourceProperty = ResourceResolutionUtils.transformResourceSource(resourceSource.properties!!, CapabilityResourceSource::class.java)
+
+        val instanceType = capabilityResourceSourceProperty.type
+        val instanceName = capabilityResourceSourceProperty.instanceName
+
+
+        var componentResourceAssignmentProcessor: ResourceAssignmentProcessor? = null
+
+        when (instanceType) {
+            CAPABILITY_TYPE_JAVA_COMPONENT -> {
+                // Initialize Capability Resource Assignment Processor
+                componentResourceAssignmentProcessor = applicationContext.getBean(instanceName, ResourceAssignmentProcessor::class.java)
+            }
+            CAPABILITY_TYPE_JYTHON_COMPONENT -> {
+                TODO(" No implementation")
+            }
+        }
+
+        checkNotNull(componentResourceAssignmentProcessor) { "failed to get capability resource assignment processor($instanceName)" }
+
+        // Assign Current Blueprint runtime and ResourceDictionaries
+        componentResourceAssignmentProcessor.bluePrintRuntimeService = bluePrintRuntimeService
+        componentResourceAssignmentProcessor.resourceDictionaries = resourceDictionaries
+
+        // Invoke componentResourceAssignmentProcessor
+        componentResourceAssignmentProcessor.apply(executionRequest)
+    }
+
+    override fun recover(runtimeException: RuntimeException, executionRequest: ResourceAssignment) {
+
+        TODO("To Implement")
+    }
+}
\ No newline at end of file
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolutionprocessor
+package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.processor
 
 import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment
 import org.springframework.stereotype.Service
@@ -1,40 +1,40 @@
-/*\r
- *  Copyright © 2017-2018 AT&T Intellectual Property.\r
- *  Modifications Copyright © 2018 IBM.\r
- *\r
- *  Licensed under the Apache License, Version 2.0 (the "License");\r
- *  you may not use this file except in compliance with the License.\r
- *  You may obtain a copy of the License at\r
- *\r
- *      http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-\r
-package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolutionprocessor\r
-\r
-import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment\r
-import org.springframework.stereotype.Service\r
-\r
-/**\r
- * DefaultResourceAssignmentProcessor\r
- *\r
- * @author Brinda Santh\r
- */\r
-@Service("resource-assignment-processor-default")\r
-open class DefaultResourceAssignmentProcessor : ResourceAssignmentProcessor() {\r
-\r
-    override fun getName(): String {\r
-        return "resource-assignment-processor-default"\r
-    }\r
-\r
-    override fun process(executionRequest: ResourceAssignment) {\r
-    }\r
-\r
-    override fun recover(runtimeException: RuntimeException, executionRequest: ResourceAssignment) {\r
-    }\r
+/*
+ *  Copyright © 2017-2018 AT&T Intellectual Property.
+ *  Modifications Copyright © 2018 IBM.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.processor
+
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment
+import org.springframework.stereotype.Service
+
+/**
+ * DefaultResourceAssignmentProcessor
+ *
+ * @author Brinda Santh
+ */
+@Service("resource-assignment-processor-default")
+open class DefaultResourceAssignmentProcessor : ResourceAssignmentProcessor() {
+
+    override fun getName(): String {
+        return "resource-assignment-processor-default"
+    }
+
+    override fun process(executionRequest: ResourceAssignment) {
+    }
+
+    override fun recover(runtimeException: RuntimeException, executionRequest: ResourceAssignment) {
+    }
 }
\ No newline at end of file
@@ -1,40 +1,40 @@
-/*\r
- *  Copyright © 2017-2018 AT&T Intellectual Property.\r
- *  Modifications Copyright © 2018 IBM.\r
- *\r
- *  Licensed under the Apache License, Version 2.0 (the "License");\r
- *  you may not use this file except in compliance with the License.\r
- *  You may obtain a copy of the License at\r
- *\r
- *      http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-\r
-package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolutionprocessor\r
-\r
-import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment\r
-import org.springframework.stereotype.Service\r
-\r
-/**\r
- * InputResourceAssignmentProcessor\r
- *\r
- * @author Brinda Santh\r
- */\r
-@Service("resource-assignment-processor-input")\r
-open class InputResourceAssignmentProcessor : ResourceAssignmentProcessor() {\r
-\r
-    override fun getName(): String {\r
-        return "resource-assignment-processor-input"\r
-    }\r
-\r
-    override fun process(executionRequest: ResourceAssignment) {\r
-    }\r
-\r
-    override fun recover(runtimeException: RuntimeException, executionRequest: ResourceAssignment) {\r
-    }\r
+/*
+ *  Copyright © 2017-2018 AT&T Intellectual Property.
+ *  Modifications Copyright © 2018 IBM.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.processor
+
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment
+import org.springframework.stereotype.Service
+
+/**
+ * InputResourceAssignmentProcessor
+ *
+ * @author Brinda Santh
+ */
+@Service("resource-assignment-processor-input")
+open class InputResourceAssignmentProcessor : ResourceAssignmentProcessor() {
+
+    override fun getName(): String {
+        return "resource-assignment-processor-input"
+    }
+
+    override fun process(executionRequest: ResourceAssignment) {
+    }
+
+    override fun recover(runtimeException: RuntimeException, executionRequest: ResourceAssignment) {
+    }
 }
\ No newline at end of file
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolutionprocessor
+package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.processor
 
 import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException
 import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BlueprintFunctionNode
@@ -28,9 +28,9 @@ abstract class ResourceAssignmentProcessor : BlueprintFunctionNode<ResourceAssig
 
     private val log = LoggerFactory.getLogger(ResourceAssignmentProcessor::class.java)
 
-    var bluePrintRuntimeService: BluePrintRuntimeService<*>? = null
+    lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*>
 
-    var resourceDictionaries: Map<String, ResourceDefinition> = hashMapOf()
+    lateinit var resourceDictionaries: Map<String, ResourceDefinition>
 
 
     open fun resourceDefinition(name: String): ResourceDefinition {
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolutionprocessor
+package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.processor
 
 import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment
 import org.springframework.stereotype.Service
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/utils/ResourceResolutionUtils.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/utils/ResourceResolutionUtils.kt
new file mode 100644 (file)
index 0000000..6bcd21b
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.utils
+
+import com.fasterxml.jackson.databind.JsonNode
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException
+import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils
+
+class ResourceResolutionUtils {
+    companion object {
+
+        fun <T> transformResourceSource(properties: MutableMap<String, JsonNode>, classType: Class<T>): T {
+            val content = JacksonUtils.getJson(properties)
+            return JacksonUtils.readValue(content, classType)
+                    ?: throw BluePrintProcessorException("failed to transform content($content) to type($classType)")
+        }
+    }
+}
\ No newline at end of file
index 57217d0..ef84960 100644 (file)
@@ -21,10 +21,7 @@ import org.junit.Test
 import org.junit.runner.RunWith
 import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ExecutionServiceInput
 import org.onap.ccsdk.apps.blueprintsprocessor.core.utils.PayloadUtils
-import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolutionprocessor.DataBaseResourceAssignmentProcessor
-import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolutionprocessor.DefaultResourceAssignmentProcessor
-import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolutionprocessor.InputResourceAssignmentProcessor
-import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolutionprocessor.SimpleRestResourceAssignmentProcessor
+import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.processor.*
 import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants
 import org.onap.ccsdk.apps.controllerblueprints.core.asJsonNode
 import org.onap.ccsdk.apps.controllerblueprints.core.putJsonElement
@@ -37,7 +34,8 @@ import org.springframework.test.context.junit4.SpringRunner
 @RunWith(SpringRunner::class)
 @ContextConfiguration(classes = [ResourceResolutionComponent::class, ResourceResolutionService::class,
     InputResourceAssignmentProcessor::class, DefaultResourceAssignmentProcessor::class,
-    DataBaseResourceAssignmentProcessor::class, SimpleRestResourceAssignmentProcessor::class])
+    DataBaseResourceAssignmentProcessor::class, SimpleRestResourceAssignmentProcessor::class,
+    CapabilityResourceAssignmentProcessor::class])
 class ResourceResolutionComponentTest {
 
     @Autowired
index df56007..7f41ba1 100644 (file)
@@ -19,10 +19,7 @@ package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution
 import org.junit.Assert
 import org.junit.Test
 import org.junit.runner.RunWith
-import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolutionprocessor.DataBaseResourceAssignmentProcessor
-import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolutionprocessor.DefaultResourceAssignmentProcessor
-import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolutionprocessor.InputResourceAssignmentProcessor
-import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolutionprocessor.SimpleRestResourceAssignmentProcessor
+import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.processor.*
 import org.onap.ccsdk.apps.controllerblueprints.core.utils.BluePrintMetadataUtils
 import org.slf4j.LoggerFactory
 import org.springframework.beans.factory.annotation.Autowired
@@ -39,7 +36,8 @@ import kotlin.test.assertTrue
 @RunWith(SpringRunner::class)
 @ContextConfiguration(classes = [ResourceResolutionService::class,
     InputResourceAssignmentProcessor::class, DefaultResourceAssignmentProcessor::class,
-    DataBaseResourceAssignmentProcessor::class, SimpleRestResourceAssignmentProcessor::class])
+    DataBaseResourceAssignmentProcessor::class, SimpleRestResourceAssignmentProcessor::class,
+    CapabilityResourceAssignmentProcessor::class])
 class ResourceResolutionServiceTest {
 
     private val log = LoggerFactory.getLogger(ResourceResolutionServiceTest::class.java)