Add UT to ToscaParserImpl 23/94823/1
authorSara Weiss <sara.weiss@intl.att.com>
Tue, 3 Sep 2019 07:59:46 +0000 (10:59 +0300)
committerWeiss, Sara (sw793d) <sara.weiss@intl.att.com>
Tue, 3 Sep 2019 10:19:48 +0000 (13:19 +0300)
Issue-ID: VID-378
Signed-off-by: Sara Weiss <sara.weiss@intl.att.com>
Change-Id: If2cf3bd2171b7935702008f7a16fbea1b8523a35

vid-app-common/src/test/java/org/onap/vid/asdc/parser/ToscaParserImpl2Test.java

index aeb0100..10f272a 100644 (file)
@@ -127,6 +127,19 @@ public class ToscaParserImpl2Test {
         assertJsonStringEqualsIgnoreNulls(om.writeValueAsString(expectedService), om.writeValueAsString(actualService));
     }
 
+
+    @Test
+    public void testScalingPolicyOfGroup() throws AsdcCatalogException, SdcToscaParserException {
+        String vnfGroupingUuid = "4117a0b6-e234-467d-b5b9-fe2f68c8b0fc";
+        ISdcCsarHelper sdcCsarHelper = toscaParserImpl2.getSdcCsarHelper(getCsarPath(vnfGroupingUuid));
+        Map<String, Integer> policiesTargets = toscaParserImpl2.extractScalingPolicyOfGroup(sdcCsarHelper);
+
+        assertThat(policiesTargets, is(ImmutableMap.of(
+                "vdorothea_svc_vprs_proxy 0", 2,
+                "groupingservicefortest..ResourceInstanceGroup..1", 3
+        )));
+    }
+
     @Test(dataProvider = "expectedServiceModel")
     public void assertEqualBetweenObjects(String uuid, ToscaParserMockHelper mockHelper) throws Exception {
         final Path csarPath = getCsarPath(mockHelper.getUuid());