diff options
Diffstat (limited to 'vid-app-common/src/test')
2 files changed, 88 insertions, 0 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 d1124f3a8..4b4aa4deb 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,6 +491,17 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT return prepareServiceInstantiation(PROJECT_NAME, isUserProvidedNaming, bulkSize); } + @Test + public void getSummarizedMap(){ + ServiceInstantiation serviceInstantiation = TestUtils.readJsonResourceFileAsObject( + "/payload_jsons/templateSummarize4vnfs6vfmodules.json", ServiceInstantiation.class); + Map<String, Long> childrenMap = asyncInstantiationBL.getSummarizedChildrenMap(serviceInstantiation); + HashMap<String, Long> expectedMap = new HashMap<>(); + expectedMap.put("vnf", Long.valueOf(4)); + expectedMap.put("vfModule", Long.valueOf(6)); + assertEquals(childrenMap,expectedMap); + + } @Test diff --git a/vid-app-common/src/test/resources/payload_jsons/templateSummarize4vnfs6vfmodules.json b/vid-app-common/src/test/resources/payload_jsons/templateSummarize4vnfs6vfmodules.json new file mode 100644 index 000000000..b00448296 --- /dev/null +++ b/vid-app-common/src/test/resources/payload_jsons/templateSummarize4vnfs6vfmodules.json @@ -0,0 +1,77 @@ +{ + "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" + } + } + } + } + }, + "2017-488_PASQUALE-vPE 0": { + "modelInfo": { + "modelType": "vnf" + } + }, + "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" + } + } + } + }, + "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" + } + } + } + }, + "modelInfo": { + "modelType": "vnf" + } + } + } +} |