diff options
author | kuldipr <kuldip.rai@amdocs.com> | 2020-12-03 13:21:59 -0500 |
---|---|---|
committer | KAPIL SINGAL <ks220y@att.com> | 2020-12-04 14:26:39 +0000 |
commit | d6c8cdf8e0edbe1af0f813a4a135ee5f354639e6 (patch) | |
tree | 7c49f1a6111283daad3fbc2746cb87650b688c18 /ms/blueprintsprocessor/functions/resource-resolution/src/test | |
parent | 4e62d2653db35c295e2697398dd3c4278ed56009 (diff) |
ResourceResolution should fail if required resource did not resolve
Issue-ID: CCSDK-3022
Signed-off-by: kuldipr <kuldip.rai@amdocs.com>
Change-Id: I6ca858988f0b11bdf3bbde07e8f4bde939342aa2
Signed-off-by: kuldipr <kuldip.rai@amdocs.com>
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/ResourceResolutionServiceTest.kt | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt index a22a73f2f..db8ca4801 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt @@ -29,11 +29,10 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInpu import org.onap.ccsdk.cds.blueprintsprocessor.core.utils.PayloadUtils import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor.MockCapabilityScriptRA import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils +import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintError import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes -import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive -import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils @@ -137,15 +136,20 @@ class ResourceResolutionServiceTest { "baseconfig", props ) - }.let { (templateMap, assignmentMap) -> + }.let { (templateMap, assignmentList) -> assertEquals("This is Sample Velocity Template", templateMap) - val expectedAssignmentMap = hashMapOf( + val expectedAssignmentList = mutableListOf( "service-instance-id" to "siid_1234", "vnf-id" to "vnf_1234", "vnf_name" to "temp_vnf" - ).asJsonType() - assertEquals(expectedAssignmentMap, assignmentMap) + ) + assertEquals(expectedAssignmentList.size, assignmentList.size) + + val areEqual = expectedAssignmentList.zip(assignmentList).all { (it1, it2) -> + it1.first == it2.name && it1.second == it2.property?.value?.asText() ?: null + } + assertEquals(true, areEqual) } } @@ -327,7 +331,9 @@ class ResourceResolutionServiceTest { """.trimIndent(), it.first ) - assertEquals("siid_1234", it.second["service-instance-id"].asText()) + val areEqual = it.second.first().name == "service-instance-id" && + "siid_1234" == it.second.first().property?.value?.asText() ?: null + assertEquals(true, areEqual) } } |