From a1142669cd10f47d8178230500012e6421722c30 Mon Sep 17 00:00:00 2001 From: Kuldip Rai Date: Wed, 16 Mar 2022 14:26:30 +0000 Subject: 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 Change-Id: I1468c41c164f64931ce719f9908b935baae6e1a4 --- .../resource/resolution/db/ResourceResolutionDBServiceTest.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/test') 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) + } } } -- cgit 1.2.3-korg