summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/resource-resolution
diff options
context:
space:
mode:
Diffstat (limited to 'ms/blueprintsprocessor/functions/resource-resolution')
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockDatabaseConfiguration.kt6
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt13
2 files changed, 11 insertions, 8 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockDatabaseConfiguration.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockDatabaseConfiguration.kt
index 774c4021a..2219f2348 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockDatabaseConfiguration.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockDatabaseConfiguration.kt
@@ -15,7 +15,7 @@
*/
package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.mock
-import io.mockk.every
+import io.mockk.coEvery
import io.mockk.mockk
import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibGenericService
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintValidatorService
@@ -38,8 +38,8 @@ open class MockBlueprintProcessorCatalogServiceImpl {
@Bean(name = ["bluePrintRuntimeValidatorService"])
open fun bluePrintRuntimeValidatorService(): BluePrintValidatorService {
val bluePrintValidatorService = mockk<BluePrintValidatorService>()
- every { bluePrintValidatorService.validateBluePrints(any<String>()) } returns true
- every { bluePrintValidatorService.validateBluePrints(any<BluePrintRuntimeService<*>>()) } returns true
+ coEvery { bluePrintValidatorService.validateBluePrints(any<String>()) } returns true
+ coEvery { bluePrintValidatorService.validateBluePrints(any<BluePrintRuntimeService<*>>()) } returns true
return bluePrintValidatorService
}
}
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt
index c564d33c6..a358f6a23 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt
@@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.node.TextNode
import io.mockk.every
import io.mockk.spyk
+import kotlinx.coroutines.runBlocking
import org.junit.Before
import org.junit.Test
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceAssignmentRuntimeService
@@ -63,9 +64,11 @@ class ResourceAssignmentUtilsTest {
@Before
fun setup() {
- val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext(
- "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
- )
+ val bluePrintContext = runBlocking {
+ BluePrintMetadataUtils.getBluePrintContext(
+ "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
+ )
+ }
resourceAssignmentRuntimeService = spyk(ResourceAssignmentRuntimeService("1234", bluePrintContext))
@@ -94,11 +97,11 @@ class ResourceAssignmentUtilsTest {
id = "ipAddress"
}
- var mapOfPropertiesIpAddress = mutableMapOf<String, PropertyDefinition>()
+ val mapOfPropertiesIpAddress = mutableMapOf<String, PropertyDefinition>()
mapOfPropertiesIpAddress["port"] = propertiesDefinition1
mapOfPropertiesIpAddress["ip"] = propertiesDefinition2
- var mapOfPropertiesHost = mutableMapOf<String, PropertyDefinition>()
+ val mapOfPropertiesHost = mutableMapOf<String, PropertyDefinition>()
mapOfPropertiesHost["name"] = propertiesDefinition3
mapOfPropertiesHost["ipAddress"] = propertiesDefinition4