From 9cdddba38b571d9d4df5d44523c0a09a64ab5de6 Mon Sep 17 00:00:00 2001 From: Alexey Sandler Date: Sun, 22 Dec 2019 17:33:00 +0200 Subject: Extending the getSummarizedMap test with different kind of templates. Issue-ID: VID-724 Signed-off-by: Alexey Sandler Change-Id: I8b678d9c86cb4e484a34a0eb76d8cc83c0909232 Signed-off-by: Alexey Sandler --- .../AsyncInstantiationBusinessLogicTest.java | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'vid-app-common/src/test/java/org') 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 expectedMap){ ServiceInstantiation serviceInstantiation = TestUtils.readJsonResourceFileAsObject( - "/payload_jsons/templateSummarize4vnfs6vfmodules.json", ServiceInstantiation.class); + pathInResource, ServiceInstantiation.class); Map childrenMap = asyncInstantiationBL.getSummarizedChildrenMap(serviceInstantiation); - Map expectedMap = ImmutableMap.of( - "vnf", 4L, - "vfModule", 6L, - "volumeGroup", 1L, - "network", 2L - ); assertEquals(childrenMap,expectedMap); } -- cgit 1.2.3-korg