aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/test
diff options
context:
space:
mode:
authorAlexey Sandler <alexey.sandler@intl.att.com>2019-12-22 17:33:00 +0200
committerAlexey Sandler <alexey.sandler@intl.att.com>2019-12-23 08:59:49 +0200
commit9cdddba38b571d9d4df5d44523c0a09a64ab5de6 (patch)
tree41bcf09144e287e98cacb5e80aed1ff997e36784 /vid-app-common/src/test
parent08b74c3652af3e0c8264e5971763f2d2845413b8 (diff)
Extending the getSummarizedMap test with different kind of templates.
Issue-ID: VID-724 Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com> Change-Id: I8b678d9c86cb4e484a34a0eb76d8cc83c0909232 Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
Diffstat (limited to 'vid-app-common/src/test')
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java22
-rw-r--r--vid-app-common/src/test/resources/payload_jsons/templateSummarize3Networks.json27
-rw-r--r--vid-app-common/src/test/resources/payload_jsons/templateSummarize3Vnfs8Vfmodule2VolumeGroups.json89
3 files changed, 129 insertions, 9 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java b/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java
index 93208aa1b..0cfe8059a 100644
--- a/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java
@@ -491,17 +491,21 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
return prepareServiceInstantiation(PROJECT_NAME, isUserProvidedNaming, bulkSize);
}
- @Test
- public void getSummarizedMap(){
+ @DataProvider
+ public static Object[][] dataProviderSummarizedMap() {
+ return new Object[][]{
+ {"/payload_jsons/templateSummarize4vnfs6vfmodules.json", ImmutableMap.of("vnf", 4L, "vfModule", 6L, "volumeGroup", 1L, "network", 2L)},
+ {"/payload_jsons/templateSummarize3Vnfs8Vfmodule2VolumeGroups.json", ImmutableMap.of("vnf", 3L, "vfModule", 8L, "volumeGroup", 2L)},
+ {"/payload_jsons/templateSummarize3Networks.json", ImmutableMap.of("network", 3L)},
+
+ };
+ }
+
+ @Test(dataProvider = "dataProviderSummarizedMap")
+ public void getSummarizedMap(String pathInResource, Map<String, Long> expectedMap){
ServiceInstantiation serviceInstantiation = TestUtils.readJsonResourceFileAsObject(
- "/payload_jsons/templateSummarize4vnfs6vfmodules.json", ServiceInstantiation.class);
+ pathInResource, ServiceInstantiation.class);
Map<String, Long> childrenMap = asyncInstantiationBL.getSummarizedChildrenMap(serviceInstantiation);
- Map<String, Long> expectedMap = ImmutableMap.of(
- "vnf", 4L,
- "vfModule", 6L,
- "volumeGroup", 1L,
- "network", 2L
- );
assertEquals(childrenMap,expectedMap);
}
diff --git a/vid-app-common/src/test/resources/payload_jsons/templateSummarize3Networks.json b/vid-app-common/src/test/resources/payload_jsons/templateSummarize3Networks.json
new file mode 100644
index 000000000..6d83a5c5e
--- /dev/null
+++ b/vid-app-common/src/test/resources/payload_jsons/templateSummarize3Networks.json
@@ -0,0 +1,27 @@
+{
+ "action": "Create",
+ "instanceName": "vProbe_NC_Service_DG_new_SI",
+ "modelInfo": {
+ "modelType": "service"
+ },
+ "networks": {
+ "Network-1": {
+ "instanceName": "myBestNetwork",
+ "modelInfo": {
+ "modelType": "network"
+ }
+ },
+ "Network-2": {
+ "instanceName": "myBestNetwork2",
+ "modelInfo": {
+ "modelType": "network"
+ }
+ },
+ "Network-3": {
+ "instanceName": "myBestNetwork3",
+ "modelInfo": {
+ "modelType": "network"
+ }
+ }
+ }
+}
diff --git a/vid-app-common/src/test/resources/payload_jsons/templateSummarize3Vnfs8Vfmodule2VolumeGroups.json b/vid-app-common/src/test/resources/payload_jsons/templateSummarize3Vnfs8Vfmodule2VolumeGroups.json
new file mode 100644
index 000000000..815c7b861
--- /dev/null
+++ b/vid-app-common/src/test/resources/payload_jsons/templateSummarize3Vnfs8Vfmodule2VolumeGroups.json
@@ -0,0 +1,89 @@
+{
+ "action": "Create",
+ "instanceName": "vProbe_NC_Service_DG_new_SI",
+ "modelInfo": {
+ "modelType": "service"
+ },
+ "vnfs": {
+ "vProbe_NC_VNF 0": {
+ "modelInfo": {
+ "modelType": "vnf"
+ },
+ "vfModules": {
+ "vprobe_nc_vnf0..VprobeNcVnf..FE_base_module..module-0": {
+ "vprobe_nc_vnf0..VprobeNcVnf..FE_base_module..module-0ahubg": {
+ "modelInfo": {
+ "modelType": "vfModule"
+ }
+ }
+ },
+ "vprobe_nc_vnf0..VprobeNcVnf..FE_Add_On_Module_vlbagent_eph..module-1": {
+ "vprobe_nc_vnf0..VprobeNcVnf..FE_Add_On_Module_vlbagent_eph..module-1yprvi": {
+ "modelInfo": {
+ "modelType": "vfModule"
+ },
+ "volumeGroupName": "my_first_volume_group"
+ }
+ }
+ }
+ },
+ "2017-488_PASQUALE-vPE 0:0001": {
+ "vfModules": {
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0": {
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0uvfot": {
+ "modelInfo": {
+ "modelType": "vfModule"
+ }
+ }
+ },
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1": {
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1fshmc": {
+ "modelInfo": {
+ "modelType": "vfModule"
+ },
+ "volumeGroupName": "my_second_volume_group"
+
+ }
+ }
+ },
+ "modelInfo": {
+ "modelType": "vnf"
+ }
+ },
+ "2017-488_PASQUALE-vPE 0:0002": {
+ "vfModules": {
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0": {
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0uvfot": {
+ "modelInfo": {
+ "modelType": "vfModule"
+ }
+ }
+ },
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1": {
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1fshmc": {
+ "modelInfo": {
+ "modelType": "vfModule"
+ }
+ }
+ },
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-2": {
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1fshmc": {
+ "modelInfo": {
+ "modelType": "vfModule"
+ }
+ }
+ },
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-3": {
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1fshmc": {
+ "modelInfo": {
+ "modelType": "vfModule"
+ }
+ }
+ }
+ },
+ "modelInfo": {
+ "modelType": "vnf"
+ }
+ }
+ }
+}