summaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/test/java/org/onap
diff options
context:
space:
mode:
authorOfir Sonsino <ofir.sonsino@intl.att.com>2018-12-03 07:10:14 +0000
committerGerrit Code Review <gerrit@onap.org>2018-12-03 07:10:14 +0000
commit6247c340ea26ec82909d844b0585e6ef4949ed94 (patch)
tree17e5bba895ea1dcc3d45b6a4accfa4e88b8922f0 /vid-app-common/src/test/java/org/onap
parentfed8ee99b98977ec0d6ade8174684932b27f7794 (diff)
parentafe1a57be3724123792fb974b2ae4b8b150fa441 (diff)
Merge "Handle annotated-input which has 2 properties"
Diffstat (limited to 'vid-app-common/src/test/java/org/onap')
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/asdc/parser/ToscaParserImpl2Test.java24
1 files changed, 23 insertions, 1 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/parser/ToscaParserImpl2Test.java b/vid-app-common/src/test/java/org/onap/vid/asdc/parser/ToscaParserImpl2Test.java
index 1282a6f78..e1c5e923b 100644
--- a/vid-app-common/src/test/java/org/onap/vid/asdc/parser/ToscaParserImpl2Test.java
+++ b/vid-app-common/src/test/java/org/onap/vid/asdc/parser/ToscaParserImpl2Test.java
@@ -15,8 +15,8 @@ import org.onap.sdc.toscaparser.api.NodeTemplate;
import org.onap.vid.asdc.AsdcCatalogException;
import org.onap.vid.asdc.AsdcClient;
import org.onap.vid.asdc.local.LocalAsdcClient;
-import org.onap.vid.model.*;
import org.onap.vid.controllers.ToscaParserMockHelper;
+import org.onap.vid.model.*;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@@ -196,6 +196,28 @@ public class ToscaParserImpl2Test {
JsonAssert.assertJsonEquals(expectedConfigurations, actualConfigurations);
}
+ @Test
+ public void modelWithAnnotatedInputWithTwoProperties_vfModuleGetsTheInput() throws Exception {
+ final ToscaParserMockHelper mockHelper = new ToscaParserMockHelper("90fe6842-aa76-4b68-8329-5c86ff564407", "empty.json");
+ final ServiceModel serviceModel = toscaParserImpl2.makeServiceModel(getCsarPath(mockHelper.getUuid()), getServiceByUuid(mockHelper.getUuid()));
+
+ assertJsonStringEqualsIgnoreNulls("{ vfModules: { 201712488_adiodvpe10..201712488AdiodVpe1..ADIOD_vRE_BV..module-1: { inputs: { 201712488_adiodvpe10_availability_zone_0: { } } } } }", om.writeValueAsString(serviceModel));
+ }
+
+ @Test
+ public void modelWithNfNamingWithToValues_ecompGeneratedNamingIsExtracted() throws Exception {
+ final ToscaParserMockHelper mockHelper = new ToscaParserMockHelper("90fe6842-aa76-4b68-8329-5c86ff564407", "empty.json");
+ final ServiceModel serviceModel = toscaParserImpl2.makeServiceModel(getCsarPath(mockHelper.getUuid()), getServiceByUuid(mockHelper.getUuid()));
+
+ assertJsonStringEqualsIgnoreNulls("" +
+ "{ vnfs: " +
+ " { \"201712-488_ADIOD-vPE-1 0\": " +
+ " { properties: { " +
+ " ecomp_generated_naming: \"true\", " +
+ " nf_naming: \"{naming_policy=SDNC_Policy.Config_MS_1806SRIOV_VPE_ADIoDJson, ecomp_generated_naming=true}\" " +
+ "} } } }", om.writeValueAsString(serviceModel));
+ }
+
private void setPprobeServiceProxy(Map<String, PortMirroringConfig> expectedConfigurations){
//Port Mirroring Configuration By Policy 0 doesn't contains pProbe.
// But due to sdc design if pProbe not exists parser expects to get it from other source.