Dead Code removal 04/121704/4
authorsebdet <sebastien.determe@intl.att.com>
Fri, 4 Jun 2021 15:28:49 +0000 (17:28 +0200)
committerAndr� Schmid <andre.schmid@est.tech>
Tue, 8 Jun 2021 09:13:46 +0000 (09:13 +0000)
Removal of dead code found during Config manager analysis

Issue-ID: SDC-3616
Change-Id: I50c15dfcba7518c32af953fe481ef013aa393ca5
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/AmdocsComplexService/PathValidations.java
integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/DeploymentArtifactPage.java

index 93c15f2..a3e7bab 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * SDC
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017, 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,33 +22,22 @@ package org.onap.sdc.frontend.ci.tests.execute.AmdocsComplexService;
 
 import com.aventstack.extentreports.Status;
 import com.clearspring.analytics.util.Pair;
-import org.apache.commons.lang3.RandomStringUtils;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Random;
+import org.apache.commons.lang.RandomStringUtils;
 import org.json.JSONObject;
 import org.onap.sdc.frontend.ci.tests.datatypes.DataTestIdEnum;
-import org.onap.sdc.backend.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
 import org.onap.sdc.backend.ci.tests.datatypes.ServiceReqDetails;
-import org.onap.sdc.backend.ci.tests.datatypes.VendorSoftwareProductObject;
 import org.onap.sdc.backend.ci.tests.datatypes.http.RestResponse;
-import org.onap.sdc.backend.ci.tests.execute.devCI.ArtifactFromCsar;
-import org.onap.sdc.frontend.ci.tests.pages.DeploymentArtifactPage;
-import org.onap.sdc.frontend.ci.tests.utilities.DownloadManager;
-import org.onap.sdc.frontend.ci.tests.utilities.FileHandling;
 import org.onap.sdc.frontend.ci.tests.utilities.GeneralUIUtils;
-import org.onap.sdc.frontend.ci.tests.utilities.OnboardingUiUtils;
-import org.onap.sdc.frontend.ci.tests.execute.setup.ArtifactsCorrelationManager;
 import org.onap.sdc.frontend.ci.tests.execute.setup.ExtentTestActions;
 import org.onap.sdc.frontend.ci.tests.execute.setup.SetupCDTest;
-import org.onap.sdc.frontend.ci.tests.pages.ResourceGeneralPage;
 import org.openqa.selenium.WebElement;
 
-import java.io.File;
-import java.util.*;
-import java.util.stream.Collectors;
-
 import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.AssertJUnit.assertNotSame;
 
-
 public class PathValidations {
 
 
@@ -56,46 +45,6 @@ public class PathValidations {
     public static final int NUMBER_OF_LINES = 3;
     public static final int NUMBER_OF_LINES_TO_DELETE = 1;
 
-    public static String[] validateServiceExtendedPath(String vspName) throws Exception {
-        PathUtilities.linkVFs(vspName, NUMBER_OF_LINKS);
-        PathUtilities.openCreatePath();
-        String pathName = "name1";
-        PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
-        PathUtilities.selectFirstLineParam();
-        PathValidations.extendPath(NUMBER_OF_LINES);
-        //delete line
-        PathUtilities.deleteLines(NUMBER_OF_LINES_TO_DELETE, NUMBER_OF_LINES);
-        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
-        ExtentTestActions.log(Status.INFO, "path has been created");
-        PathValidations.checkPathFilter(pathName, true);
-        GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.PATH_MENU_BUTTON.getValue() + "']/parent::*").get(0).click();
-        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());
-        String PathListName1 = GeneralUIUtils.findByText(pathName).getText();
-        // edit path
-        String newPathName = "name2";
-        PathUtilities.editPathName(pathName, newPathName);
-
-        GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.PATH_MENU_BUTTON.getValue() + "']/parent::*").get(0).click();
-        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());
-        String PathListName2 = GeneralUIUtils.findByText(newPathName).getText();
-
-        // assert names changed
-        assertNotSame("path name expected to change after edit but did not", PathListName1, PathListName2);
-
-        // delete path
-        int paths_before_deletion = GeneralUIUtils.findElementsByXpath("//*[text()='" + newPathName + "']/parent::*//span").size();
-        GeneralUIUtils.findElementsByXpath(newPathName).get(1).click();
-        GeneralUIUtils.ultimateWait();
-        int paths_after_deletion = GeneralUIUtils.findElementsByXpath("//*[text()='" + newPathName + "']/parent::*//span").size();
-        assertNotSame("path expected to be deleted but did not", paths_after_deletion, paths_before_deletion);
-
-        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesAssignmentScreen.INPUT_DELETE_DIALOG_CLOSE.getValue());
-        SetupCDTest.getExtendTest().log(Status.INFO, "Path has been created");
-        // check that path got deleted in the path filter list
-        PathValidations.checkPathFilter(newPathName, false);
-        return new String[]{pathName, newPathName};
-    }
-
     public static String[] validateComplexExtendedPath(String[] services) throws Exception {
         PathUtilities.linkServices(services[0], services[1], NUMBER_OF_LINKS);
         PathUtilities.openCreatePath();
@@ -333,28 +282,4 @@ public class PathValidations {
         PathUtilities.openPathList();
         PathUtilities.editPathName(pathName, "newName2");
     }
-
-    public static void importAndVerifyVSP(VendorSoftwareProductObject createVendorSoftwareProduct, String filepath, String vnfFile) throws Exception {
-        DownloadManager.downloadCsarByNameFromVSPRepository(createVendorSoftwareProduct.getName(), createVendorSoftwareProduct.getVspId());
-        File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir();
-
-        OnboardingUiUtils.importVSP(createVendorSoftwareProduct);
-
-        ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
-
-        // Verify deployment artifacts
-        Map<String, Object> combinedMap = ArtifactFromCsar.combineHeatArtifacstWithFolderArtifacsToMap(latestFilefromDir.getAbsolutePath());
-
-        LinkedList<HeatMetaFirstLevelDefinition> deploymentArtifacts = ((LinkedList<HeatMetaFirstLevelDefinition>) combinedMap.get("Deployment"));
-        ArtifactsCorrelationManager.addVNFartifactDetails(vnfFile, deploymentArtifacts);
-
-        List<String> heatEnvFilesFromCSAR = deploymentArtifacts.stream().filter(e -> e.getType().equals("HEAT_ENV")).
-                map(e -> e.getFileName()).
-                collect(Collectors.toList());
-
-        OnboardingUiUtils.validateDeploymentArtifactsVersion(deploymentArtifacts, heatEnvFilesFromCSAR);
-
-        DeploymentArtifactPage.verifyArtifactsExistInTable(filepath, vnfFile);
-    }
-
 }
index 9a8e5ec..999391f 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================\r
  * SDC\r
  * ================================================================================\r
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
+ * Copyright (C) 2017, 2021 AT&T Intellectual Property. All rights reserved.\r
  * ================================================================================\r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
@@ -33,8 +33,6 @@ import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
 import org.openqa.selenium.By;\r
 import org.openqa.selenium.WebElement;\r
 import org.testng.collections.Lists;\r
-\r
-import java.util.ArrayList;\r
 import java.util.List;\r
 import java.util.stream.Collectors;\r
 \r
@@ -69,10 +67,6 @@ public class DeploymentArtifactPage extends GeneralPageElements {
         addNewArtifact(ArtifactGroupTypeEnum.DEPLOYMENT);\r
     }\r
 \r
-    public static void clickAddAnotherArtifact() {\r
-        GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.ADD_ANOTHER_ARTIFACT.getValue()).click();\r
-    }\r
-\r
     public static void clickEditArtifact(String artifactLabel) {\r
         GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.EDIT_ARTIFACT.getValue() + artifactLabel).click();\r
     }\r
@@ -90,12 +84,6 @@ public class DeploymentArtifactPage extends GeneralPageElements {
         GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.DELETE_ARTIFACT.getValue() + artifactLabel).click();\r
     }\r
 \r
-    public static WebElement clickDownloadArtifact(String artifactLabel) {\r
-        WebElement downloadButton = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT.getValue() + artifactLabel);\r
-\r
-        return downloadButton;\r
-    }\r
-\r
     public static void clickDownloadEnvArtifact(String envFileNameToDownload) {\r
         ExtentTestActions.log(Status.INFO, String.format("Downloading the updated  %s artifact for validate parameters with the response after the update...", envFileNameToDownload));\r
         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT_ENV.getValue() + envFileNameToDownload);\r
@@ -112,10 +100,6 @@ public class DeploymentArtifactPage extends GeneralPageElements {
         GeneralUIUtils.ultimateWait();\r
     }\r
 \r
-    public static WebElement getAddOtherArtifactButton() {\r
-        return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.ADD_ANOTHER_ARTIFACT.getValue());\r
-    }\r
-\r
     public static void clickOK() {\r
         SetupCDTest.getExtendTest().log(Status.INFO, "Artifact Page, Clicking OK");\r
         GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.OK.getValue()).click();\r
@@ -259,17 +243,6 @@ public class DeploymentArtifactPage extends GeneralPageElements {
         return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.TYPE.getValue() + artifactName).getText();\r
     }\r
 \r
-    public static List<String> getHeatParametersInUI(String dataTestId) {\r
-        List<WebElement> elements;\r
-        List<String> Names = new ArrayList<>();\r
-        elements = GeneralUIUtils.getWebElementsListByContainTestID(dataTestId);\r
-        for (WebElement webElement : elements) {\r
-            String attributevalue = webElement.getAttribute("data-tests-id");\r
-            Names.add(attributevalue.replace("heatParameterName_", ""));\r
-        }\r
-        return Names;\r
-    }\r
-\r
     public static void searchBoxEnv(String parameterName) {\r
         GeneralUIUtils.getWebElementByContainsClassName("w-sdc-env-search-input").sendKeys(parameterName);\r
     }\r