aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/test')
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilderTest.java52
-rw-r--r--bpmn/MSOCommonBPMN/src/test/resources/__files/SERVICE-SO-REQ-INPUT.json109
2 files changed, 140 insertions, 21 deletions
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilderTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilderTest.java
index adfee796f2..1350a4bcc0 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilderTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilderTest.java
@@ -91,7 +91,7 @@ public class ResourceRequestBuilderTest extends BaseTest {
+ "\t\t\"toscaNodeType\" : \"org.openecomp.resource.vf.15968a6e2fe541bfA481\",\n"
+ "\t\t\"nfFunction\" \t: null,\n"
+ "\"resourceInput\":\"{\\\"a\\\":\\\"b\\\"}\","
- + "\t\t\"nfType\" \t\t: null,\n"
+ + "\t\t\"resourceType\" \t\t: \"VNF\",\n"
+ "\t\t\"nfRole\" \t\t: null,\n"
+ "\t\t\"nfNamingCode\" \t: null,\n"
+ "\t\t\"multiStageDesign\" : \"false\",\n" + "\t\t\t\"vfModules\": [\n"
@@ -114,7 +114,7 @@ public class ResourceRequestBuilderTest extends BaseTest {
+ "\t\t\t\"modelInstanceName\" : \"f971106a-248f-4202-9d1f 0\"\n" + "\t\t\t},\n"
+ "\t\t\"toscaNodeType\" : \"org.openecomp.resource.vf.F971106a248f42029d1f\",\n"
+ "\t\t\"nfFunction\" \t: null,\n"
- + "\t\t\"nfType\" \t\t: null,\n"
+ + "\t\t\"resourceType\" \t\t: \"VNF\",\n"
+ "\t\t\"nfRole\" \t\t: null,\n"
+ "\"resourceInput\":\"{\\\"a\\\":\\\"key|default_value\\\"}\","
+ "\t\t\"nfNamingCode\" \t: null,\n"
@@ -185,7 +185,7 @@ public class ResourceRequestBuilderTest extends BaseTest {
+ "\t\t\t\"modelInstanceName\" : \"f971106a-248f-4202-9d1f 0\"\n" + "\t\t\t},\n"
+ "\t\t\"toscaNodeType\" : \"org.openecomp.resource.vf.F971106a248f42029d1f\",\n"
+ "\t\t\"nfFunction\" \t: null,\n"
- + "\t\t\"nfType\" \t\t: null,\n"
+ + "\t\t\"resourceType\" \t\t: \"VNF\",\n"
+ "\t\t\"nfRole\" \t\t: null,\n"
+ "\"resourceInput\":\"{\\\"a\\\":\\\"key|default_value\\\"}\","
+ "\t\t\"nfNamingCode\" \t: null,\n"
@@ -256,7 +256,7 @@ public class ResourceRequestBuilderTest extends BaseTest {
+ "\t\t\t\"modelInstanceName\" : \"f971106a-248f-4202-9d1f 0\"\n" + "\t\t\t},\n"
+ "\t\t\"toscaNodeType\" : \"org.openecomp.resource.vf.F971106a248f42029d1f\",\n"
+ "\t\t\"nfFunction\" \t: null,\n"
- + "\t\t\"nfType\" \t\t: null,\n"
+ + "\t\t\"resourceType\" \t\t: \"VNF\",\n"
+ "\t\t\"nfRole\" \t\t: null,\n"
+ "\"resourceInput\":\"{\\\"a\\\":\\\"value\\\"}\","
+ "\t\t\"nfNamingCode\" \t: null,\n"
@@ -397,7 +397,7 @@ public class ResourceRequestBuilderTest extends BaseTest {
+ "\t\t\"toscaNodeType\" : \"org.openecomp.resource.vf.15968a6e2fe541bfA481\",\n"
+ "\t\t\"nfFunction\" \t: null,\n"
+ "\"resourceInput\":\"{\\\"a\\\":\\\"key1|\\\"}\","
- + "\t\t\"nfType\" \t\t: null,\n"
+ + "\t\t\"resourceType\" \t\t: \"VNF\",\n"
+ "\t\t\"nfRole\" \t\t: null,\n"
+ "\t\t\"nfNamingCode\" \t: null,\n"
+ "\t\t\"multiStageDesign\" : \"false\",\n" + "\t\t\t\"vfModules\": [\n"
@@ -472,19 +472,45 @@ public class ResourceRequestBuilderTest extends BaseTest {
assertEquals("20000", stringObjectMap.get("postcode"));
assertEquals("single_gateway", stringObjectMap.get("type"));
assertEquals("vCPE", stringObjectMap.get("deviceName"));
+ assertEquals("DHCP", stringObjectMap.get("ipMode"));
+
+ // VFC request again
+ stringObjectMap = ResourceRequestBuilder.buildResouceRequest("c3954379-4efe-431c-8258-f84905b158e5",
+ "e776449e-2b10-45c5-9217-2775c88cb1f1", this.userInputMap, currentVFData);
+ assertEquals("Huawei Private Cloud", stringObjectMap.get("address"));
+ assertEquals("20000", stringObjectMap.get("postcode"));
+ assertEquals("single_gateway", stringObjectMap.get("type"));
assertEquals("20.20.20.1", stringObjectMap.get("systemip"));
assertEquals("default_ipv6", stringObjectMap.get("systemipv6"));
+ assertEquals("VNF", stringObjectMap.get("devclass"));
+ // VF level request
+ stringObjectMap = ResourceRequestBuilder.buildResouceRequest("c3954379-4efe-431c-8258-f84905b158e5",
+ "e776449e-2b10-45c5-9217-2775c88ca1c3", this.userInputMap, currentVFData);
+ assertEquals("Huawei Public Cloud", stringObjectMap.get("address"));
+ assertEquals("dsvpn_hub", stringObjectMap.get("role"));
+ assertTrue(((String) stringObjectMap.get("wanlist")).contains("["));
+ assertTrue(((String) stringObjectMap.get("devlist")).contains("["));
+
+ // VFC request
+ stringObjectMap = ResourceRequestBuilder.buildResouceRequest("c3954379-4efe-431c-8258-f84905b158e5",
+ "e776449e-2b10-45c5-9217-2775c88cb1a4", this.userInputMap, currentVFData);
+ assertEquals("Huawei Public Cloud", stringObjectMap.get("address"));
+ assertEquals("20001", stringObjectMap.get("postcode"));
+ assertEquals("multiple_gateway", stringObjectMap.get("type"));
+ assertEquals("CPE_Beijing", stringObjectMap.get("deviceName"));
+ assertEquals("Static", stringObjectMap.get("ipMode"));
// VFC request again
- /*
- * stringObjectMap = ResourceRequestBuilder.buildResouceRequest( "c3954379-4efe-431c-8258-f84905b158e5",
- * "e776449e-2b10-45c5-9217-2775c88cb1f1", this.userInputMap, currentVFData);
- * assertEquals("Huawei Public Cloud", stringObjectMap.get("address")); assertEquals("20001",
- * stringObjectMap.get("postcode")); assertEquals("multiple_gateway", stringObjectMap.get("type"));
- * assertEquals("CPE_Beijing", stringObjectMap.get("deviceName")); assertEquals("20.20.20.2",
- * stringObjectMap.get("systemip"));
- */
+ stringObjectMap = ResourceRequestBuilder.buildResouceRequest("c3954379-4efe-431c-8258-f84905b158e5",
+ "e776449e-2b10-45c5-9217-2775c88cb1f5", this.userInputMap, currentVFData);
+ assertEquals("Huawei Public Cloud", stringObjectMap.get("address"));
+ assertEquals("20001", stringObjectMap.get("postcode"));
+ assertEquals("multiple_gateway", stringObjectMap.get("type"));
+ assertEquals("20.20.20.2", stringObjectMap.get("systemip"));
+ assertEquals("default_ipv6", stringObjectMap.get("systemipv6"));
+ assertEquals("PNF", stringObjectMap.get("devclass"));
+
}
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/SERVICE-SO-REQ-INPUT.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/SERVICE-SO-REQ-INPUT.json
index 938b45e5a4..4803fca355 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/__files/SERVICE-SO-REQ-INPUT.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/SERVICE-SO-REQ-INPUT.json
@@ -25,7 +25,7 @@
"toscaNodeType": "org.openecomp.resource.vf.15968a6e2fe541bfA481",
"nfFunction": null,
"resourceInput": "{\"a\":\"b\",\"topology\":\"[sdwanvpnresource_list,INDEX,sdwanvpn_topology]|default_topo\",\"name\":\"[sdwanvpnresource_list,INDEX,sdwanvpn_name]|default_name\",\"sitelist\":\"[sdwanvpnresource_list,INDEX,sdwansitelan_list]|default_sitelist\"}",
- "nfType": null,
+ "resourceType": "VNF",
"nfRole": null,
"nfNamingCode": null,
"multiStageDesign": "false",
@@ -55,7 +55,7 @@
},
"toscaNodeType": "org.openecomp.resource.vfc.F971106a248f42029d1f",
"nfFunction": null,
- "nfType": null,
+ "resourceType": "GROUP",
"nfRole": null,
"resourceInput": "{\"a\":\"b|\",\"portswitch\":\"[sdwansitelan_list,INDEX,portSwitch]|default_portswitch\",\"ipAddress\":\"[sdwansitelan_list,INDEX,ipAddress]|default_ipAddress\",\"deviceName\":\"[sdwansitelan_list,INDEX,deviceName]|default_deviceName\"}",
"nfNamingCode": null,
@@ -86,7 +86,7 @@
},
"toscaNodeType": "org.openecomp.resource.vfc.F971106a248f42029d1f",
"nfFunction": null,
- "nfType": null,
+ "resourceType": "GROUP",
"nfRole": null,
"resourceInput": "{\"a\":\"b|\",\"portswitch\":\"[sdwansitelan_list,INDEX,portSwitch]|default_portswitch\",\"ipAddress\":\"[sdwansitelan_list,INDEX,ipAddress]|default_ipAddress\",\"deviceName\":\"[sdwansitelan_list,INDEX,deviceName]|default_deviceName\"}",
"nfNamingCode": null,
@@ -117,7 +117,7 @@
},
"toscaNodeType": "org.openecomp.resource.vf.F971106a248f42029d1f",
"nfFunction": null,
- "nfType": null,
+ "resourceType": "VNF",
"nfRole": null,
"resourceInput": "{\"address\":\"[sdwansiteresource_list,INDEX,sdwansite_address]|default_address\",\"role\":\"[sdwansiteresource_list,INDEX,sdwansite_role]|default_role\",\"wanlist\":\"[sdwansiteresource_list,INDEX,sdwansitewan_list]|default_wanlist\",\"devlist\":\"[sdwansiteresource_list,INDEX,sdwandevice_list]|default_devlist\"}",
"nfNamingCode": null,
@@ -148,9 +148,9 @@
},
"toscaNodeType": "org.openecomp.resource.vfc.F971106a248f42029d1f",
"nfFunction": null,
- "nfType": null,
+ "resourceType": "GROUP",
"nfRole": null,
- "resourceInput": "{\"address\":\"sdwansite_address|default_address\", \"postcode\":\"sdwansite_postcode|default_postcode\",\"type\":\"sdwansite_type|default_role\",\"deviceName\":\"[sdwansitewan_list,INDEX,deviceName]|default_deviceName\",\"systemip\":\"[sdwandevice_list,INDEX,systemIp]|default_systemip\", \"systemipv6\":\"[sdwandevice_list,INDEX,systemIpv6]|default_ipv6\"}",
+ "resourceInput": "{\"address\":\"sdwansite_address|default_address\", \"postcode\":\"sdwansite_postcode|default_postcode\",\"type\":\"sdwansite_type|default_role\",\"deviceName\":\"[sdwansitewan_list,INDEX,deviceName]|default_deviceName\",\"ipMode\":\"[sdwansitewan_list,INDEX,ipMode]|default_ipMode\"}",
"nfNamingCode": null,
"multiStageDesign": "false",
"vfModules": [{
@@ -179,9 +179,9 @@
},
"toscaNodeType": "org.openecomp.resource.vfc.F971106a248f42029d3f",
"nfFunction": null,
- "nfType": null,
+ "resourceType": "GROUP",
"nfRole": null,
- "resourceInput": "{\"address\":\"sdwansite_address|default_address\", \"postcode\":\"sdwansite_postcode|default_postcode\",\"type\":\"sdwansite_type|default_role\",\"deviceName\":\"[sdwansitewan_list,INDEX,deviceName]|default_deviceName\",\"systemip\":\"[sdwandevice_list,INDEX,systemIp]|default_systemip\"}",
+ "resourceInput": "{\"address\":\"sdwansite_address|default_address\", \"postcode\":\"sdwansite_postcode|default_postcode\",\"type\":\"sdwansite_type|default_role\",\"systemip\":\"[sdwandevice_list,INDEX,systemIp]|default_systemip\", \"systemipv6\":\"[sdwandevice_list,INDEX,systemIpv6]|default_ipv6\", \"devclass\":\"[sdwandevice_list,INDEX,class]|default_class\"}",
"nfNamingCode": null,
"multiStageDesign": "false",
"vfModules": [{
@@ -197,6 +197,99 @@
"initialCount": 1,
"hasVolumeGroup": true
}]
+ },
+
+ {
+ "modelInfo": {
+ "modelName": "f971106a-248f-4202-9d23",
+ "modelUuid": "4fbc08a4-35ed-4a59-9e47-79975e4add83",
+ "modelInvariantUuid": "c669799e-adf1-46ae-8c70-48b326fe89c3",
+ "modelVersion": "1.0",
+ "modelCustomizationUuid": "e776449e-2b10-45c5-9217-2775c88ca1c3",
+ "modelInstanceName": "f971106a-248f-4202-9d23 0"
+ },
+ "toscaNodeType": "org.openecomp.resource.vf.F971106a248f42029d1f",
+ "nfFunction": null,
+ "resourceType": "VNF",
+ "nfRole": null,
+ "resourceInput": "{\"address\":\"[sdwansiteresource_list,INDEX,sdwansite_address]|default_address\",\"role\":\"[sdwansiteresource_list,INDEX,sdwansite_role]|default_role\",\"wanlist\":\"[sdwansiteresource_list,INDEX,sdwansitewan_list]|default_wanlist\",\"devlist\":\"[sdwansiteresource_list,INDEX,sdwandevice_list]|default_devlist\"}",
+ "nfNamingCode": null,
+ "multiStageDesign": "false",
+ "vfModules": [{
+ "modelInfo": {
+ "modelName": "F971106a248f42029d1f..base_vpkg..module-0",
+ "modelUuid": "47d5273a-7456-4786-9035-b3911944cc35",
+ "modelInvariantUuid": "0ea3e57e-ac7a-425a-928b-b4aee8806c15",
+ "modelVersion": "1",
+ "modelCustomizationUuid": "9ed9fef6-d3f8-4433-9807-7e23393a16bc"
+ },
+ "isBase": true,
+ "vfModuleLabel": "base_vpkg",
+ "initialCount": 1,
+ "hasVolumeGroup": true
+ }]
+ },
+
+ {
+ "modelInfo": {
+ "modelName": "f971106a-248f-4202-9d34",
+ "modelUuid": "4fbc08a4-35ed-4a59-9e47-79975e4add94",
+ "modelInvariantUuid": "c669799e-adf1-46ae-8c70-48b326fe89f4",
+ "modelVersion": "1.0",
+ "modelCustomizationUuid": "e776449e-2b10-45c5-9217-2775c88cb1a4",
+ "modelInstanceName": "f971106a-248f-4202-9d34 0"
+ },
+ "toscaNodeType": "org.openecomp.resource.vfc.F971106a248f42029d1f",
+ "nfFunction": null,
+ "resourceType": "GROUP",
+ "nfRole": null,
+ "resourceInput": "{\"address\":\"sdwansite_address|default_address\", \"postcode\":\"sdwansite_postcode|default_postcode\",\"type\":\"sdwansite_type|default_role\",\"deviceName\":\"[sdwansitewan_list,INDEX,deviceName]|default_deviceName\",\"ipMode\":\"[sdwansitewan_list,INDEX,ipMode]|default_ipMode\"}",
+ "nfNamingCode": null,
+ "multiStageDesign": "false",
+ "vfModules": [{
+ "modelInfo": {
+ "modelName": "F971106a248f42029d1f..base_vpkg..module-0",
+ "modelUuid": "47d5273a-7456-4786-9035-b3911944cc35",
+ "modelInvariantUuid": "0ea3e57e-ac7a-425a-928b-b4aee8806c15",
+ "modelVersion": "1",
+ "modelCustomizationUuid": "9ed9fef6-d3f8-4433-9807-7e23393a16bc"
+ },
+ "isBase": true,
+ "vfModuleLabel": "base_vpkg",
+ "initialCount": 1,
+ "hasVolumeGroup": true
+ }]
+ },
+
+ {
+ "modelInfo": {
+ "modelName": "f971106a-248f-4202-9d55",
+ "modelUuid": "4fbc08a4-35ed-4a59-9e47-79975e4add35",
+ "modelInvariantUuid": "c669799e-adf1-46ae-8c70-48b326fe8395",
+ "modelVersion": "1.0",
+ "modelCustomizationUuid": "e776449e-2b10-45c5-9217-2775c88cb1f5",
+ "modelInstanceName": "f971106a-248f-4202-9d55 0"
+ },
+ "toscaNodeType": "org.openecomp.resource.vfc.F971106a248f42029d3f",
+ "nfFunction": null,
+ "resourceType": "GROUP",
+ "nfRole": null,
+ "resourceInput": "{\"address\":\"sdwansite_address|default_address\", \"postcode\":\"sdwansite_postcode|default_postcode\",\"type\":\"sdwansite_type|default_role\",\"systemip\":\"[sdwandevice_list,INDEX,systemIp]|default_systemip\", \"systemipv6\":\"[sdwandevice_list,INDEX,systemIpv6]|default_ipv6\", \"devclass\":\"[sdwandevice_list,INDEX,class]|default_class\"}",
+ "nfNamingCode": null,
+ "multiStageDesign": "false",
+ "vfModules": [{
+ "modelInfo": {
+ "modelName": "F971106a248f42029d1f..base_vpkg..module-0",
+ "modelUuid": "47d5273a-7456-4786-9035-b3911944cc35",
+ "modelInvariantUuid": "0ea3e57e-ac7a-425a-928b-b4aee8806c15",
+ "modelVersion": "1",
+ "modelCustomizationUuid": "9ed9fef6-d3f8-4433-9807-7e23393a16bc"
+ },
+ "isBase": true,
+ "vfModuleLabel": "base_vpkg",
+ "initialCount": 1,
+ "hasVolumeGroup": true
+ }]
}
],