Resource Resolution Service: Primary DB
[ccsdk/cds.git] / ms / blueprintsprocessor / functions / resource-resolution / src / test / kotlin / org / onap / ccsdk / apps / blueprintsprocessor / functions / resource / resolution / ResourceResolutionServiceTest.kt
index 6c68675..9a846d6 100644 (file)
@@ -19,14 +19,22 @@ 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.core.BluePrintProperties
+import org.onap.ccsdk.apps.blueprintsprocessor.core.BlueprintPropertyConfiguration
 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.db.BluePrintDBLibConfiguration
+import org.onap.ccsdk.apps.blueprintsprocessor.db.primary.service.PrimaryDBLibGenericService
 import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.processor.*
+import org.onap.ccsdk.apps.controllerblueprints.core.config.BluePrintLoadConfiguration
 import org.onap.ccsdk.apps.controllerblueprints.core.utils.BluePrintMetadataUtils
 import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils
 import org.slf4j.LoggerFactory
 import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration
+import org.springframework.context.annotation.ComponentScan
 import org.springframework.test.context.ContextConfiguration
+import org.springframework.test.context.TestPropertySource
 import org.springframework.test.context.junit4.SpringRunner
 import kotlin.test.assertNotNull
 import kotlin.test.assertTrue
@@ -40,7 +48,12 @@ import kotlin.test.assertTrue
 @ContextConfiguration(classes = [ResourceResolutionService::class,
     InputResourceAssignmentProcessor::class, DefaultResourceAssignmentProcessor::class,
     PrimaryDataResourceAssignmentProcessor::class, SimpleRestResourceAssignmentProcessor::class,
-    CapabilityResourceAssignmentProcessor::class])
+    CapabilityResourceAssignmentProcessor::class, PrimaryDBLibGenericService::class,
+    BlueprintPropertyConfiguration::class, BluePrintProperties::class,
+    BluePrintDBLibConfiguration::class, BluePrintLoadConfiguration::class])
+@TestPropertySource(locations = ["classpath:application-test.properties"])
+@ComponentScan(basePackages = ["org.onap.ccsdk.apps.blueprintsprocessor", "org.onap.ccsdk.apps.controllerblueprints"])
+@EnableAutoConfiguration
 class ResourceResolutionServiceTest {
 
     private val log = LoggerFactory.getLogger(ResourceResolutionServiceTest::class.java)
@@ -48,7 +61,6 @@ class ResourceResolutionServiceTest {
     @Autowired
     lateinit var resourceResolutionService: ResourceResolutionService
 
-
     @Test
     fun testRegisteredSource() {
         val sources = resourceResolutionService.registeredResourceSources()