aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/resource-resolution/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/test')
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBServiceTest.kt24
1 files changed, 24 insertions, 0 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBServiceTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBServiceTest.kt
index e667cd16f..672d4b75d 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBServiceTest.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBServiceTest.kt
@@ -18,6 +18,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.db
import io.mockk.every
import io.mockk.mockk
+import io.mockk.slot
import kotlinx.coroutines.runBlocking
import org.junit.Before
import org.junit.Test
@@ -225,6 +226,29 @@ open class ResourceResolutionDBServiceTest {
}
@Test
+ fun writeWithNullValue() {
+ val slot = slot<ResourceResolution>()
+ val resourceAssignment = ResourceAssignment()
+ resourceAssignment.status = BluePrintConstants.STATUS_SUCCESS
+ resourceAssignment.dictionarySource = "ddSource"
+ resourceAssignment.dictionaryName = "ddName"
+ resourceAssignment.version = 1
+ resourceAssignment.name = "test"
+ every {
+ resourceResolutionRepository.saveAndFlush(capture(slot))
+ } returns ResourceResolution()
+ runBlocking {
+ resourceResolutionDBService.write(
+ props, bluePrintRuntimeService, artifactPrefix, resourceAssignment
+ )
+
+ val res = slot.captured
+
+ assertEquals("", res.value)
+ }
+ }
+
+ @Test
fun deleteByBlueprintNameAndBlueprintVersionAndArtifactNameAndResolutionKeyTest() {
every {
resourceResolutionRepository.deleteByBlueprintNameAndBlueprintVersionAndArtifactNameAndResolutionKey(any(), any(), any(), any())