From 1bd6e1e2f978abbab4b924288a72ff6b2657d1e4 Mon Sep 17 00:00:00 2001 From: kuldipr Date: Tue, 16 Mar 2021 15:27:00 -0400 Subject: Fixed sdc-controller ingestion logic for cds values sdc controller was not picking the cds values because logic expected the values in the 'metadata' block however the cds values exist in the 'input' block. Logic is modified to look for values at the correct location. Issue-ID: SO-3591 Signed-off-by: kuldipr Change-Id: I59778fde00025e22446446df560b5f85bfda7469 Signed-off-by: kuldipr --- .../installer/heat/ToscaResourceInstallerTest.java | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'asdc-controller/src/test/java') diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java index e4882119ab..bf327f5bb1 100644 --- a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java +++ b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java @@ -36,6 +36,7 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Optional; @@ -571,6 +572,36 @@ public class ToscaResourceInstallerTest extends BaseTest { doReturn(namingPolicy).when(metadata).getValue("namingPolicy"); doReturn(ecompGeneratedNaming).when(metadata).getValue("ecompGeneratedNaming"); + ISdcCsarHelper iSdcCsarHelper = mock(ISdcCsarHelper.class); + List serviceInputs = new ArrayList(); + + LinkedHashMap value = new LinkedHashMap(); + value.put("controller_actor", "SO-REF-DATA"); + value.put("type", "string"); + Input input = new Input("controller_actor", value, null); + serviceInputs.add(0, input); + + value = new LinkedHashMap(); + value.put("cds_model_version", "v1.4.0"); + value.put("type", "string"); + input = new Input("cds_model_version", value, null); + serviceInputs.add(1, input); + + value = new LinkedHashMap(); + value.put("cds_model_name", "Blueprint140"); + value.put("type", "string"); + input = new Input("cds_model_name", value, null); + serviceInputs.add(2, input); + + value = new LinkedHashMap(); + value.put("skip_post_instantiation_configuration", "false"); + value.put("type", "boolean"); + input = new Input("skip_post_instantiation_configuration", value, null); + serviceInputs.add(3, input); + + doReturn(iSdcCsarHelper).when(toscaResourceStructure).getSdcCsarHelper(); + doReturn(serviceInputs).when(iSdcCsarHelper).getServiceInputs(); + Service service = toscaInstaller.createService(toscaResourceStructure, resourceStructure); assertNotNull(service); -- cgit 1.2.3-korg