aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/resource-resolution/src/test
diff options
context:
space:
mode:
authorKuldip Rai <kuldip.rai@bell.ca>2022-03-16 14:26:30 +0000
committerkuldipr <kuldip.rai@amdocs.com>2022-05-19 11:52:25 -0400
commita1142669cd10f47d8178230500012e6421722c30 (patch)
treeb54242da6f068e2e1a940c96cb77b768df3166ab /ms/blueprintsprocessor/functions/resource-resolution/src/test
parentc3943fbc70105c4ce38d66c7cbe227ddec35d535 (diff)
Resource endpoint should support occurrences
The getOneFromResolutionKey endpoint would fail if there are multiple occurrences for a resource. Instead it should return the last occurrence. Issue-ID: CCSDK-3664 Signed-off-by: kuldipr <kuldip.rai@amdocs.com> Change-Id: I1468c41c164f64931ce719f9908b935baae6e1a4
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.kt9
1 files changed, 6 insertions, 3 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 fa59876a9..635ce0e38 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
@@ -30,6 +30,7 @@ import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBluePrintRunt
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
import org.springframework.dao.EmptyResultDataAccessException
import kotlin.test.assertEquals
+import kotlin.test.assertNotEquals
open class ResourceResolutionDBServiceTest {
@@ -158,9 +159,11 @@ open class ResourceResolutionDBServiceTest {
resourceResolutionDBService.readValue(
blueprintName, blueprintVersion, artifactPrefix, resolutionKey, "bob"
)
-
- assertEquals(rr.name, res.name)
- assertEquals(rr.value, res.value)
+ assertNotEquals(res, null, "resource resolution failed")
+ if (res != null) {
+ assertEquals(rr.name, res.name)
+ assertEquals(rr.value, res.value)
+ }
}
}