summaryrefslogtreecommitdiffstats
path: root/restapi-call-node/provider/src/test
diff options
context:
space:
mode:
authorAgarwal, Ruchira (ra1926) <ra1926@att.com>2019-08-28 01:48:21 +0000
committerKevin Smokowski <kevin.smokowski@att.com>2019-08-28 15:32:41 +0000
commit43c9e83b3cc9b3dfaf55f08fc25813a77a4f2784 (patch)
tree8b89486a375c55f2874e760b99fae17a32a4a170 /restapi-call-node/provider/src/test
parentf396b85b5815ea0cdfeed96f999ed360e2a9ee9d (diff)
sync restapi-call-node with ecomp
sync onap rest-api-call-node with ecomp Issue-ID: CCSDK-1659 Signed-off-by: Agarwal, Ruchira (ra1926) <ra1926@att.com> Change-Id: I08b0b8332b68a22710cd412997f3763de4b5b8d3
Diffstat (limited to 'restapi-call-node/provider/src/test')
-rw-r--r--restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java59
-rw-r--r--restapi-call-node/provider/src/test/resources/test-template.json1
2 files changed, 60 insertions, 0 deletions
diff --git a/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java b/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java
index 9812f2a1..ac6d3b78 100644
--- a/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java
+++ b/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java
@@ -152,6 +152,65 @@ public class TestXmlJsonUtil {
log.info(ss);
}
+ public void testRemoveEmptyStructJson1() {
+ String xmlin = "{\n" +
+ " \"policyName\" : \"default-domain.ECOM_Tenant_DND.ECOM_Tenant_DND_mtn6_HngwOamNetVto." +
+ "HNGWOAMNETVTO.OAM_landing-network-role_policy_05\",\n" +
+ " \"policyConfigType\": \"MicroService\",\n" +
+ " \"ecompName\": \"SDNC\",\n" +
+ " \"configBody\": \"{\\\"service\\\": \\\"NetworkPolicy\\\"," +
+ "\\\"location\\\": \\\"Search\\\",\\\"uuid\\\": \\\"Search\\\"," +
+ "\\\"policyName\\\": \\\"default-domain.ECOM_Tenant_DND.ECOM_Tenant_DND_mtn6_HngwOamNetVto." +
+ "HNGWOAMNETVTO.OAM_landing-network-role_policy_05\\\"," +
+ "\\\"description\\\": \\\"default-domain.ECOM_Tenant_DND.ECOM_Tenant_DND_mtn6_HngwOamNetVto." +
+ "HNGWOAMNETVTO.OAM_landing-network-role_policy_05\\\",\\\"configName\\\": \\\"Search\\\"," +
+ "\\\"templateVersion\\\": \\\"1607\\\",\\\"version\\\": \\\"1.3.0.1\\\"," +
+ "\\\"priority\\\": \\\"2\\\",\\\"policyScope\\\": \\\"SDNC\\\",\\\"riskType\\\": \\\"low\\\"," +
+ "\\\"riskLevel\\\": \\\"2\\\",\\\"guard\\\": \\\"True\\\",\\\"content\\\":{ " +
+ "\\\"network-policy\\\": { \\\"display_name\\\": \\\"default-domain.ECOM_Tenant_DND." +
+ "ECOM_Tenant_DND_mtn6_HngwOamNetVto.HNGWOAMNETVTO.OAM_landing-network-role_policy_05\\\", " +
+ "\\\"fq_name\\\": [ \\\"default-domain\\\", " +
+ "\\\"ECOM_Tenant_DND\\\", \\\"default-domain." +
+ "ECOM_Tenant_DND.ECOM_Tenant_DND_mtn6_HngwOamNetVto." +
+ "HNGWOAMNETVTO.OAM_landing-network-role_policy_05\\\" ], " +
+ "\\\"id_perms\\\": { \\\"user_visible\\\": true }, " +
+ "\\\"parent_type\\\": \\\"project\\\", \\\"network_policy_entries\\\": { " +
+ "\\\"policy_rule\\\": [ { " +
+ "\\\"action_list\\\": { \\\"apply_service\\\": [ " +
+ "\\\"testfqdn\\\" ], " +
+ "\\\"gateway_name\\\": null, \\\"qos_action\\\": null, " +
+ "\\\"log\\\": false , \\\"mirror_to\\\": null, " +
+ "\\\"simple_action\\\": null }, " +
+ "\\\"ethertype\\\": null, \\\"application\\\": [], " +
+ "\\\"direction\\\": \\\"<>\\\", \\\"dst_addresses\\\": [ " +
+ "{ \\\"network_policy\\\": null, " +
+ "\\\"security_group\\\": null, " +
+ "\\\"subnet\\\": null, \\\"virtual_network\\\": " +
+ "\\\"default-domain:ECOM_Tenant_DND:ECOM_Tenant_DND_int_HngwOamNetVto." +
+ "HNGWOAMNETVTO.OAM_net_10\\\" } ], " +
+ "\\\"dst_ports\\\": [ { " +
+ "\\\"end_port\\\": -1, \\\"start_port\\\": -1 " +
+ "} ], \\\"protocol\\\": \\\"any\\\", " +
+ "\\\"src_addresses\\\": [ { " +
+ "\\\"network_policy\\\": null, " +
+ "\\\"security_group\\\": null, " +
+ "\\\"subnet\\\": null, \\\"virtual_network\\\": " +
+ "\\\"default-domain:ECOM_Tenant_DND:ECOM_Tenant_DND_int_HngwOamNetVto." +
+ "HNGWOAMNETVTO.OAM_net_9\\\" } ], " +
+ "\\\"src_ports\\\": [ { " +
+ "\\\"end_port\\\": -1, " +
+ "\\\"start_port\\\": -1 } ] } " +
+ "] } }}}\"\n" +
+ "}";
+
+ String xmloutexpected = xmlin;
+
+ String xmlout = XmlJsonUtil.removeEmptyStructJson(null, xmlin);
+ log.info(xmlout);
+
+ Assert.assertEquals(xmloutexpected, xmlout);
+ }
+
@Test
public void testRemoveEmptyStructXml() {
String xmlin = "" +
diff --git a/restapi-call-node/provider/src/test/resources/test-template.json b/restapi-call-node/provider/src/test/resources/test-template.json
index 4adc6637..faefef31 100644
--- a/restapi-call-node/provider/src/test/resources/test-template.json
+++ b/restapi-call-node/provider/src/test/resources/test-template.json
@@ -51,6 +51,7 @@
"run-id": ${tmp.sdn-circuit-req-row[${1}].run-id},
"hostname": ${tmp.sdn-circuit-req-row[${1}].hostname},
"algo-request-reason": ${tmp.sdn-circuit-req-row[${1}].algo-request-reason}
+ "test-empty-value": ${tmp.sdn-circuit-req-row[${1}].test-empty-value}
},
}
]