diff options
author | Manzon, Inna (im453s) <im453s@intl.att.com> | 2018-09-17 17:58:16 +0300 |
---|---|---|
committer | Manzon, Inna (im453s) <im453s@intl.att.com> | 2018-09-17 18:06:29 +0300 |
commit | b675cde3363762d1e716241e04733ca315fb63b4 (patch) | |
tree | 9bd79576b63859407d3aa05669499a1ebc7224b6 /src/test/java/org/onap | |
parent | 77108dc421d73732c264a5485fc9a0188d472e67 (diff) |
Resolve get_input for list change
Change-Id: I818bc10c27b543fd767cd47eca7b59ba07e27b09
Issue-ID: SDC-1769
Signed-off-by: Manzon, Inna (im453s) <im453s@intl.att.com>
Diffstat (limited to 'src/test/java/org/onap')
-rw-r--r-- | src/test/java/org/onap/sdc/impl/SdcToscaParserBasicTest.java | 2 | ||||
-rw-r--r-- | src/test/java/org/onap/sdc/impl/ToscaParserNodeTemplateTest.java | 22 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/test/java/org/onap/sdc/impl/SdcToscaParserBasicTest.java b/src/test/java/org/onap/sdc/impl/SdcToscaParserBasicTest.java index edcf3ca..d1eed3e 100644 --- a/src/test/java/org/onap/sdc/impl/SdcToscaParserBasicTest.java +++ b/src/test/java/org/onap/sdc/impl/SdcToscaParserBasicTest.java @@ -45,6 +45,7 @@ public abstract class SdcToscaParserBasicTest { static ISdcCsarHelper csarHelperVfInterfaces; static ISdcCsarHelper csarHelperServiceAnnotations; static ISdcCsarHelper csarHelperServiceAdiodAnnotations; + static ISdcCsarHelper csarHelperServiceNetworkCloud; static Map<String, HashMap<String, List<String>>> fdntCsarHelper_Data; @@ -77,6 +78,7 @@ public abstract class SdcToscaParserBasicTest { csarHelperServiceAnnotations = getCsarHelper("csars/resource-Sirovinputannotation-csar.csar"); csarHelperVfInterfaces = getCsarHelper("csars/service-CxSvc-csar.csar"); csarHelperServiceAdiodAnnotations = getCsarHelper("csars/service-AdiodVmxVpeBvService-csar.csar"); + csarHelperServiceNetworkCloud = getCsarHelper("csars/service-NetworkCloudVnfServiceMock-csar.csar"); fdntCsarHelper_Data = new HashMap<String, HashMap<String, List<String>>>(){ { diff --git a/src/test/java/org/onap/sdc/impl/ToscaParserNodeTemplateTest.java b/src/test/java/org/onap/sdc/impl/ToscaParserNodeTemplateTest.java index db7e5ae..7b268c6 100644 --- a/src/test/java/org/onap/sdc/impl/ToscaParserNodeTemplateTest.java +++ b/src/test/java/org/onap/sdc/impl/ToscaParserNodeTemplateTest.java @@ -1,6 +1,7 @@ package org.onap.sdc.impl; import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertNull; import static org.testng.Assert.assertTrue; @@ -785,6 +786,27 @@ public class ToscaParserNodeTemplateTest extends SdcToscaParserBasicTest { } @Test + public void testResolveGetInputForListOnNetworkCloud() { + final String related_network_role = "related_network_role"; + List<NodeTemplate> serviceVfList = csarHelperServiceNetworkCloud.getServiceVfList(); + assertNotNull(serviceVfList); + assertFalse(serviceVfList.isEmpty()); + List<NodeTemplate> vfcListByVf = csarHelperServiceNetworkCloud.getVfcListByVf(csarHelperServiceNetworkCloud.getNodeTemplateCustomizationUuid(serviceVfList.get(0))); + assertNotNull(vfcListByVf); + assertFalse(vfcListByVf.isEmpty()); + List<NodeTemplate> cpList = csarHelperServiceNetworkCloud.getNodeTemplateChildren(vfcListByVf.get(0)); + assertNotNull(cpList); + assertFalse(cpList.isEmpty()); + final Object propertyValue = cpList.get(0).getPropertyValue("related_networks"); + assertNotNull(propertyValue); + ArrayList<Map<String, String>> relatedNetworkList = (ArrayList)propertyValue; + assertEquals(3, relatedNetworkList.size()); + assertEquals("cor_direct_2", relatedNetworkList.get(0).get(related_network_role)); + assertEquals("sgi_direct_2", relatedNetworkList.get(1).get(related_network_role)); + assertEquals("int_imbl_2", relatedNetworkList.get(2).get(related_network_role)); + } + + @Test public void testResolveGetInputForPrimitiveTypeString() { //This test covers "default" resolving of primitive - as Object List<NodeTemplate> vfcs = resolveGetInputCsar.getVfcListByVf("b5190df2-7880-4d6f-836f-56ab17e1b85b"); |