handling legacy region in vfModule resume 64/92464/1 5.0.0
authorEylon Malin <eylon.malin@intl.att.com>
Thu, 1 Aug 2019 12:59:56 +0000 (15:59 +0300)
committerEylon Malin <eylon.malin@intl.att.com>
Thu, 1 Aug 2019 12:59:56 +0000 (15:59 +0300)
Issue-ID: VID-482
Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Change-Id: If0cca27729e2d7313fd1836191a35d223e276070

vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js
vid-automation/src/main/java/vid/automation/test/test/SanityMacroDeployTest.java

index 817bef6..aac0ed4 100644 (file)
@@ -293,13 +293,12 @@ var DeleteResumeService = function($log, AaiService, AsdcService, DataService,
                var cloudOwner;
 
                var lcpRegionOptionId = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
-
-               if (lcpRegionOptionId === FIELD.KEY.LCP_REGION_TEXT) {
+               var cloudOwnerAndLcpCloudRegion = getCloudOwnerAndLcpCloudRegionFromOptionId(lcpRegionOptionId);
+               if (cloudOwnerAndLcpCloudRegion.cloudRegionId === FIELD.KEY.LCP_REGION_TEXT) {
                        lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
                                parameterList);
                        cloudOwner = undefined;
                } else {
-                       var cloudOwnerAndLcpCloudRegion = getCloudOwnerAndLcpCloudRegionFromOptionId(lcpRegionOptionId);
                        lcpRegion = cloudOwnerAndLcpCloudRegion.cloudRegionId;
                        cloudOwner = cloudOwnerAndLcpCloudRegion.cloudOwner;
                }
@@ -478,7 +477,9 @@ var DeleteResumeService = function($log, AaiService, AsdcService, DataService,
                                parameterListControl
                                                .updateList([ FIELD.PARAMETER.TENANT_DISABLED ]);
                        }
-                       if (list[0].value === FIELD.KEY.LCP_REGION_TEXT) {
+
+                       var cloudOwnerAndLcpCloudRegion = getCloudOwnerAndLcpCloudRegionFromOptionId(list[0].value);
+                       if (cloudOwnerAndLcpCloudRegion.cloudRegionId === FIELD.KEY.LCP_REGION_TEXT) {
                                parameterListControl
                                                .updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_VISIBLE ]);
                        } else {
index 59c1323..df3ef94 100644 (file)
@@ -2,12 +2,12 @@ package vid.automation.test.test;
 
 import com.google.common.collect.ImmutableList;
 import org.junit.Assert;
+import org.onap.sdc.ci.tests.datatypes.UserCredentials;
+import org.onap.sdc.ci.tests.utilities.GeneralUIUtils;
 import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId;
 import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet;
 import org.onap.simulator.presetGenerator.presets.aai.PresetAAIServiceDesignAndCreationPut;
 import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateMacroPre1806Post;
-import org.onap.sdc.ci.tests.datatypes.UserCredentials;
-import org.onap.sdc.ci.tests.utilities.GeneralUIUtils;
 import org.openqa.selenium.WebElement;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
@@ -18,6 +18,7 @@ import vid.automation.test.sections.BrowseASDCPage;
 import vid.automation.test.sections.SideMenu;
 import vid.automation.test.services.SimulatorApi;
 
+import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.containsString;
 import static vid.automation.test.infra.ModelInfo.macroForBrowseSdc;
 import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND;
@@ -82,7 +83,7 @@ public class SanityMacroDeployTest extends CreateInstanceDialogBaseTest {
         browseASDCPage.clickDeployServiceButtonByServiceUUID(macroForBrowseSdc.modelVersionId);
 
         WebElement modalTitle = GeneralUIUtils.getWebElementByTestID(Constants.CREATE_MODAL_TITLE_ID, 30);
-        Assert.assertThat(modalTitle.getText().toLowerCase(), containsString("macro"));
+        assertThat(modalTitle.getText().toLowerCase(), containsString("macro"));
         GeneralUIUtils.ultimateWait();
 
         assertServiceDetails();