diff options
author | Ittay Stern <ittay.stern@att.com> | 2019-07-08 15:46:44 +0300 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2019-07-08 18:50:38 +0300 |
commit | f4dff328c0386c8901b5841943b11f0c13b3169f (patch) | |
tree | 4e64c3ee540410b2593c1ebecd0dddd3a4780592 /vid-automation/src/main/java | |
parent | f792671ae247a931f34d902e9276202b5016ef9a (diff) |
Merge from ecomp 718fd196 - Integration Tests
Issue-ID: VID-378
Change-Id: Icc0bdb9ef37b1d429d47c2070f76d1ee63ad7489
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-automation/src/main/java')
107 files changed, 3940 insertions, 909 deletions
diff --git a/vid-automation/src/main/java/org/onap/sdc/ci/tests/api/BaseRestUtils.java b/vid-automation/src/main/java/org/onap/sdc/ci/tests/api/BaseRestUtils.java index f85225f36..987e09e61 100644 --- a/vid-automation/src/main/java/org/onap/sdc/ci/tests/api/BaseRestUtils.java +++ b/vid-automation/src/main/java/org/onap/sdc/ci/tests/api/BaseRestUtils.java @@ -26,6 +26,7 @@ import java.io.InputStreamReader; import java.util.HashMap; import java.util.List; import java.util.Map; + import org.apache.commons.codec.binary.Base64; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; diff --git a/vid-automation/src/main/java/org/onap/sdc/ci/tests/datatypes/http/HttpRequest.java b/vid-automation/src/main/java/org/onap/sdc/ci/tests/datatypes/http/HttpRequest.java index 4f831b187..bc62e6673 100644 --- a/vid-automation/src/main/java/org/onap/sdc/ci/tests/datatypes/http/HttpRequest.java +++ b/vid-automation/src/main/java/org/onap/sdc/ci/tests/datatypes/http/HttpRequest.java @@ -53,7 +53,6 @@ import org.apache.http.entity.mime.content.StringBody; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; -import org.onap.sdc.ci.tests.datatypes.http.RestResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/vid-automation/src/main/java/org/onap/sdc/ci/tests/execute/setup/DriverFactory.java b/vid-automation/src/main/java/org/onap/sdc/ci/tests/execute/setup/DriverFactory.java index e8c386bb2..b7f6dfa9e 100644 --- a/vid-automation/src/main/java/org/onap/sdc/ci/tests/execute/setup/DriverFactory.java +++ b/vid-automation/src/main/java/org/onap/sdc/ci/tests/execute/setup/DriverFactory.java @@ -22,7 +22,6 @@ package org.onap.sdc.ci.tests.execute.setup; import java.io.File; -import java.io.FileNotFoundException; import java.io.FilenameFilter; import java.io.IOException; import java.util.ArrayList; diff --git a/vid-automation/src/main/java/org/onap/sdc/ci/tests/execute/setup/WebDriverThread.java b/vid-automation/src/main/java/org/onap/sdc/ci/tests/execute/setup/WebDriverThread.java index 501faa8de..95443bf0b 100644 --- a/vid-automation/src/main/java/org/onap/sdc/ci/tests/execute/setup/WebDriverThread.java +++ b/vid-automation/src/main/java/org/onap/sdc/ci/tests/execute/setup/WebDriverThread.java @@ -93,11 +93,7 @@ public class WebDriverThread { cap.setCapability("browserName","firefox"); cap.setCapability(FirefoxDriver.PROFILE, initFirefoxProfile()); cap.setCapability(MARIONETTE_CAPABILITY, true); - - firefoxProfile.setPreference("network.proxy.type", 2); - firefoxProfile.setPreference("network.proxy.autoconfig_url", "http://emea.onap.org:8001/"); - firefoxProfile.setPreference("network.proxy.no_proxies_on", "localhost"); - + webdriver = new FirefoxDriver(cap); } } else { diff --git a/vid-automation/src/main/java/org/onap/sdc/ci/tests/execute/setup/WindowTestManager.java b/vid-automation/src/main/java/org/onap/sdc/ci/tests/execute/setup/WindowTestManager.java index 727876f27..cb6adc295 100644 --- a/vid-automation/src/main/java/org/onap/sdc/ci/tests/execute/setup/WindowTestManager.java +++ b/vid-automation/src/main/java/org/onap/sdc/ci/tests/execute/setup/WindowTestManager.java @@ -22,8 +22,6 @@ package org.onap.sdc.ci.tests.execute.setup; import java.util.HashMap; -import com.aventstack.extentreports.ExtentTest; - public class WindowTestManager { private static HashMap<Long, WindowTest> windowMap = new HashMap<Long, WindowTest>(); diff --git a/vid-automation/src/main/java/org/onap/sdc/ci/tests/utilities/CanvasElement.java b/vid-automation/src/main/java/org/onap/sdc/ci/tests/utilities/CanvasElement.java index eb93a619e..2ff28dabd 100644 --- a/vid-automation/src/main/java/org/onap/sdc/ci/tests/utilities/CanvasElement.java +++ b/vid-automation/src/main/java/org/onap/sdc/ci/tests/utilities/CanvasElement.java @@ -21,7 +21,6 @@ package org.onap.sdc.ci.tests.utilities; import org.apache.commons.lang3.tuple.ImmutablePair; -import org.onap.sdc.ci.tests.datatypes.DataTestIdEnum.LeftPanelCanvasItems; import org.openqa.selenium.WebElement; public final class CanvasElement { diff --git a/vid-automation/src/main/java/org/onap/sdc/ci/tests/utilities/FileHandling.java b/vid-automation/src/main/java/org/onap/sdc/ci/tests/utilities/FileHandling.java index d5d5540a9..029555a91 100644 --- a/vid-automation/src/main/java/org/onap/sdc/ci/tests/utilities/FileHandling.java +++ b/vid-automation/src/main/java/org/onap/sdc/ci/tests/utilities/FileHandling.java @@ -45,7 +45,6 @@ import java.util.zip.ZipFile; import java.util.zip.ZipInputStream; import org.apache.commons.io.FileUtils; -import org.onap.sdc.ci.tests.datatypes.UserCredentials; import org.onap.sdc.ci.tests.execute.setup.ExtentTestActions; import org.onap.sdc.ci.tests.execute.setup.SetupCDTest; import org.yaml.snakeyaml.Yaml; diff --git a/vid-automation/src/main/java/org/onap/sdc/ci/tests/utilities/GeneralUIUtils.java b/vid-automation/src/main/java/org/onap/sdc/ci/tests/utilities/GeneralUIUtils.java index 8885e1c3f..b10636bf1 100644 --- a/vid-automation/src/main/java/org/onap/sdc/ci/tests/utilities/GeneralUIUtils.java +++ b/vid-automation/src/main/java/org/onap/sdc/ci/tests/utilities/GeneralUIUtils.java @@ -20,6 +20,7 @@ package org.onap.sdc.ci.tests.utilities; +//import com.automation.common.report_portal_integration.annotations.Step; import com.aventstack.extentreports.Status; import org.apache.commons.io.FileUtils; import org.junit.Assert; @@ -600,12 +601,14 @@ public final class GeneralUIUtils { wait.until(ExpectedConditions.textToBePresentInElementValue(element, text)); } + //@Step public static void waitForAngular(){ WebDriverWait wait = newWait(90); wait.until(AdditionalConditions.pageLoadWait()); wait.until(AdditionalConditions.angularHasFinishedProcessing()); } + //@Step public static void waitForAngular2(){ WebDriverWait wait = newWait(90); wait.until(AdditionalConditions.pageLoadWait()); @@ -645,6 +648,7 @@ public final class GeneralUIUtils { waitForElementVisibilityByTestId(dataTestId)); } + //@Step public static void ultimateWait(){ logger.info("ultimateWait: starting"); long startTime = System.nanoTime(); diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BaseMSOPreset.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BaseMSOPreset.java index 4f4779d8e..8ad111849 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BaseMSOPreset.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BaseMSOPreset.java @@ -1,8 +1,9 @@ package org.onap.simulator.presetGenerator.presets.BasePresets; -import java.util.Map; import vid.automation.test.infra.Features; +import java.util.Map; + /** * Created by itzikliderman on 27/12/2017. */ @@ -33,6 +34,13 @@ public abstract class BaseMSOPreset extends BasePreset { "\"cloudOwner\": \""+cloudOwner+"\"," : ""; } + protected String addPlatformIfNeeded(String platform) { + return platform != "" ? + " \"platform\": {" + + " \"platformName\": \""+platform+"\"," + + "}," : ""; + } + @Override protected String getRootPath() { return "/mso"; diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BasePreset.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BasePreset.java index 662677e83..aded77ccf 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BasePreset.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BasePreset.java @@ -1,10 +1,11 @@ package org.onap.simulator.presetGenerator.presets.BasePresets; +import org.onap.simulator.presetGenerator.presets.model.RegistrationRequest; +import org.springframework.http.HttpMethod; + import java.util.HashMap; import java.util.List; import java.util.Map; -import org.onap.simulator.presetGenerator.presets.model.RegistrationRequest; -import org.springframework.http.HttpMethod; /** * Created by itzikliderman on 13/12/2017. diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/AAIBaseGetL3NetworksByCloudRegionPreset.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/AAIBaseGetL3NetworksByCloudRegionPreset.java new file mode 100644 index 000000000..e20c09ba1 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/AAIBaseGetL3NetworksByCloudRegionPreset.java @@ -0,0 +1,76 @@ +package org.onap.simulator.presetGenerator.presets.aai; + +import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + +import java.util.*; + +public class AAIBaseGetL3NetworksByCloudRegionPreset extends BaseAAIPreset { + + public static final String DEFAULT_TENANT_ID = "b530fc990b6d4334bd45518bebca6a51"; + public static final String DEFAULT_TENANT_NAME = "ecomp_ispt"; + public static final String DEFAULT_CLOUD_REGION_ID = PresetAAIGetCloudOwnersByCloudRegionId.AUK51A; + private static final String DEFAULT_CLOUD_OWNER = PresetAAIGetCloudOwnersByCloudRegionId.ATT_NC; + protected String tenantId; + protected String tenantName; + protected String cloudRegionId; + protected String cloudOwner; + protected String networkRole; + + public AAIBaseGetL3NetworksByCloudRegionPreset(String tenentId, String tenantName, String cloudRegionId, String cloudOwner, String networkRole) { + this.tenantId = tenentId; + this.tenantName = tenantName; + this.cloudRegionId = cloudRegionId; + this.cloudOwner = cloudOwner; + this.networkRole = networkRole; + } + + public AAIBaseGetL3NetworksByCloudRegionPreset() { + this.tenantId = DEFAULT_TENANT_ID; + this.tenantName = DEFAULT_TENANT_NAME; + this.cloudRegionId = DEFAULT_CLOUD_REGION_ID; + this.cloudOwner = DEFAULT_CLOUD_OWNER; + } + + public String getTenantName() { + return tenantName; + } + + public String getTenantId() { + return tenantId; + } + + public String getCloudRegionId() { + return cloudRegionId; + } + + public String getCloudOwner() { + return cloudOwner; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.PUT; + } + + @Override + public String getReqPath() { + return getRootPath() + "/query"; + } + + @Override + public Map<String, List> getQueryParams() { + return ImmutableMap.of( + "format", Collections.singletonList("resource") + ); + } + + @Override + public Object getRequestBody() { + return ImmutableMap.of( + "start", "/cloud-infrastructure/cloud-regions/cloud-region/" + cloudOwner + "/" + cloudRegionId, + "query", "query/l3-networks-by-cloud-region?tenantId=" + tenantId + (networkRole == null ? "" : "&networkRole=" + networkRole) + ); + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/Placement.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/Placement.java new file mode 100644 index 000000000..b665fc30f --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/Placement.java @@ -0,0 +1,14 @@ +package org.onap.simulator.presetGenerator.presets.aai; + +public class Placement { + public final String cloudOwner; + public final String lcpRegionId; + public final String tenantId; + + public Placement(String cloudOwner, String lcpRegionId, String tenantId) { + this.cloudOwner = cloudOwner; + this.lcpRegionId = lcpRegionId; + this.tenantId = tenantId; + } +} + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAICloudRegionAndSourceFromConfigurationPut.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAICloudRegionAndSourceFromConfigurationPut.java index 66562ed63..c43843179 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAICloudRegionAndSourceFromConfigurationPut.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAICloudRegionAndSourceFromConfigurationPut.java @@ -2,11 +2,12 @@ package org.onap.simulator.presetGenerator.presets.aai; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + import java.util.Collections; import java.util.List; import java.util.Map; -import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; -import org.springframework.http.HttpMethod; public class PresetAAICloudRegionAndSourceFromConfigurationPut extends BaseAAIPreset { diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetCloudOwnersByCloudRegionId.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetCloudOwnersByCloudRegionId.java index be075b481..22c0cfef5 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetCloudOwnersByCloudRegionId.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetCloudOwnersByCloudRegionId.java @@ -1,15 +1,16 @@ package org.onap.simulator.presetGenerator.presets.aai; -import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; -import static org.apache.commons.lang3.RandomStringUtils.randomNumeric; - import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + import java.util.Collections; import java.util.List; import java.util.Map; import java.util.UUID; -import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; -import org.springframework.http.HttpMethod; + +import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; +import static org.apache.commons.lang3.RandomStringUtils.randomNumeric; public class PresetAAIGetCloudOwnersByCloudRegionId extends BaseAAIPreset { public static final String SOME_LEGACY_REGION = "some legacy region"; @@ -23,9 +24,10 @@ public class PresetAAIGetCloudOwnersByCloudRegionId extends BaseAAIPreset { public static final String olson3 = "olson3"; public static final String olson5B = "olson5b"; public static final String ATT_SABABA = "att-sababa"; - public static final String AAIAIC_25 = "JANET25"; + public static final String AAIAIC_25 = "AAIAIC25"; public static final String ONE = "One"; public static final String hvf6 = "hvf6"; + public static final String AUK51A = "auk51a"; private final String cloudRegionId; private final String cloudOwner; @@ -61,7 +63,10 @@ public class PresetAAIGetCloudOwnersByCloudRegionId extends BaseAAIPreset { public static final PresetAAIGetCloudOwnersByCloudRegionId PRESET_LCP_REGION_TEXT_TO_ATT_AIC = new PresetAAIGetCloudOwnersByCloudRegionId(LCP_REGION_TEXT, ATT_AIC); - private PresetAAIGetCloudOwnersByCloudRegionId(String cloudRegionId, String cloudOwnerResult) { + public static final PresetAAIGetCloudOwnersByCloudRegionId PRESET_AUK51A_TO_ATT_NC = + new PresetAAIGetCloudOwnersByCloudRegionId(AUK51A, ATT_NC); + + public PresetAAIGetCloudOwnersByCloudRegionId(String cloudRegionId, String cloudOwnerResult) { this.cloudRegionId = cloudRegionId; this.cloudOwner = cloudOwnerResult; } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetCloudRegionFromVnf.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetCloudRegionFromVnf.java index 976228bf0..06b853578 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetCloudRegionFromVnf.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetCloudRegionFromVnf.java @@ -2,11 +2,12 @@ package org.onap.simulator.presetGenerator.presets.aai; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + import java.util.Collections; import java.util.List; import java.util.Map; -import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; -import org.springframework.http.HttpMethod; public class PresetAAIGetCloudRegionFromVnf extends BaseAAIPreset { diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetL3NetworksByCloudRegion.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetL3NetworksByCloudRegion.java new file mode 100644 index 000000000..6b47fe004 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetL3NetworksByCloudRegion.java @@ -0,0 +1,267 @@ +package org.onap.simulator.presetGenerator.presets.aai; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.util.*; +import java.util.stream.Collectors; + +public class PresetAAIGetL3NetworksByCloudRegion extends AAIBaseGetL3NetworksByCloudRegionPreset { + + private static final int NUMBER_OF_VALID_NETWORKS = 3; + private static final String NETWORK_NAME_TEMPLATE = "AUK51a_oam_calea_net_"; + private static final String NETWORK_TYPE_TEMPLATE = "SR-IOV-PROVIDER2-"; + private static final String NETWORK_PHYSICAL_NAME_TEMPLATE = "sriovnet"; + private static final String NETWORK_MODEL_ID = "77010093-df36-4dcb-8428-c3d02bf3f88d"; + private static final String ACTIVE = "Active"; + private static final String SERVICE_INSTANCE_NAME_TEMPLATE = "AUK51a_oam_calea_net_service_"; + private static final String NETWORK_ROLE_TEMPLATE = "oam_calea_net_"; + private List<Network> networks = new ArrayList<>(); + + + private void initNetworks() { + // Valid networks + for (int i=0; i <= NUMBER_OF_VALID_NETWORKS; i++) { + networks.add(new Network( + NETWORK_NAME_TEMPLATE + i, + UUID.randomUUID().toString(), + NETWORK_TYPE_TEMPLATE + i, + networkRole == null? NETWORK_ROLE_TEMPLATE + i : networkRole, + ACTIVE, + NETWORK_PHYSICAL_NAME_TEMPLATE + i, + NETWORK_MODEL_ID, + SERVICE_INSTANCE_NAME_TEMPLATE + i, + UUID.randomUUID().toString(), + tenantName, + cloudRegionId, + true + )); + } + // Not Active + int i = NUMBER_OF_VALID_NETWORKS + 1; + networks.add(new Network( + NETWORK_NAME_TEMPLATE + i, + UUID.randomUUID().toString(), + NETWORK_TYPE_TEMPLATE + i, + networkRole == null? NETWORK_ROLE_TEMPLATE + i : networkRole, + "Assigned", + NETWORK_PHYSICAL_NAME_TEMPLATE + i, + NETWORK_MODEL_ID, + SERVICE_INSTANCE_NAME_TEMPLATE + i, + UUID.randomUUID().toString(), + tenantName, + cloudRegionId, + true + )); + // Empty name + i++; + networks.add(new Network( + "", + UUID.randomUUID().toString(), + NETWORK_TYPE_TEMPLATE + i, + networkRole == null? NETWORK_ROLE_TEMPLATE + i : networkRole, + ACTIVE, + NETWORK_PHYSICAL_NAME_TEMPLATE + i, + NETWORK_MODEL_ID, + SERVICE_INSTANCE_NAME_TEMPLATE + i, + UUID.randomUUID().toString(), + tenantName, + cloudRegionId, + true + )); + // No name + i++; + networks.add(new Network( + null, + UUID.randomUUID().toString(), + NETWORK_TYPE_TEMPLATE + i, + networkRole == null? NETWORK_ROLE_TEMPLATE + i : networkRole, + ACTIVE, + NETWORK_PHYSICAL_NAME_TEMPLATE + i, + NETWORK_MODEL_ID, + SERVICE_INSTANCE_NAME_TEMPLATE + i, + UUID.randomUUID().toString(), + tenantName, + cloudRegionId, + true + )); + // Not related to VPN binding + i++; + networks.add(new Network( + NETWORK_NAME_TEMPLATE + i, + UUID.randomUUID().toString(), + NETWORK_TYPE_TEMPLATE + i, + networkRole == null? NETWORK_ROLE_TEMPLATE + i : networkRole, + ACTIVE, + NETWORK_PHYSICAL_NAME_TEMPLATE + i, + NETWORK_MODEL_ID, + SERVICE_INSTANCE_NAME_TEMPLATE + i, + UUID.randomUUID().toString(), + tenantName, + cloudRegionId, + false + )); + } + + public PresetAAIGetL3NetworksByCloudRegion(String tenentId, String tenantId, String cloudRegionId, String cloudOwner, String networkRole) { + super(tenantId, tenantId, cloudRegionId, cloudOwner, networkRole); + initNetworks(); + } + + public PresetAAIGetL3NetworksByCloudRegion() { + super(); + initNetworks(); + } + + public PresetAAIGetL3NetworksByCloudRegion(String networkRole) { + super(); + this.networkRole = networkRole; + initNetworks(); + } + + public String getActiveNetworksWithNameAndRelatedToVpnBindingAsJsonString() throws JsonProcessingException { + ObjectMapper mapper = new ObjectMapper(); + return mapper.writeValueAsString(networks.stream().filter(network -> network.networkName != null && !network.networkName.isEmpty() && network.orchStatus.equals(ACTIVE) && network.isBoundToVpn).collect(Collectors.toList())); + } + + @Override + public Object getResponseBody() { + StringJoiner stringJoiner = new StringJoiner(",", "[", "]"); + for (Network network : networks) { + stringJoiner.add(network.toString()); + } + return "{\"results\": " + stringJoiner.toString() + "}"; + } + + private class Network { + @JsonProperty("instanceName") + public String networkName; + @JsonProperty("instanceId") + public String networkId; + @JsonProperty("instanceType") + public String networkType; + public String role; + public String orchStatus; + public String physicalName; + @JsonProperty("uuid") + public String modelUUID; + public String serviceName; + public String serviceUUID; + public String tenantName; + @JsonProperty("lcpCloudRegionId") + public String region; + private boolean isBoundToVpn; + + + public Network(String networkName, String networkId, String networkType, String role, String orchStatus, String physicalName, + String modelUUID, String serviceName, String serviceUUID, String tenantName, String region, boolean isBoundToVpn) { + this.networkName = networkName; + this.networkId = networkId; + this.networkType = networkType; + this.role = role; + this.orchStatus = orchStatus; + this.physicalName = physicalName; + this.modelUUID = modelUUID; + this.serviceName = serviceName; + this.serviceUUID = serviceUUID; + this.tenantName = tenantName; + this.region = region; + this.isBoundToVpn = isBoundToVpn; + } + + @Override + public String toString (){ + return "{\"l3-network\": " + + "{\n" + + " \"network-id\": \"" + networkId + "\",\n" + + (networkName == null ? "" : " \"network-name\": \"" + networkName + "\",\n") + + " \"network-type\": \"" + networkType + "\",\n" + + " \"network-role\": \"" + role + "\",\n" + + " \"network-technology\": \"STANDARD-SR-IOV\",\n" + + " \"is-bound-to-vpn\": " + isBoundToVpn + ",\n" + + " \"resource-version\": \"1540925016770\",\n" + + " \"orchestration-status\": \"" + orchStatus + "\",\n" + + " \"model-invariant-id\": \"b9a9b549-0ee4-49fc-b4f2-5edc6701da68\",\n" + + " \"model-version-id\": \"" + modelUUID + "\",\n" + + " \"model-customization-id\": \"e5f33853-f84c-4cdd-99f2-93846957aa18\",\n" + + " \"physical-network-name\": \"" + physicalName + "\",\n" + + " \"is-provider-network\": true,\n" + + " \"is-shared-network\": true,\n" + + " \"is-external-network\": false,\n" + + " \"selflink\": \"restconf/config/GENERIC-RESOURCE-API:services/service/" + serviceUUID + "/service-data/networks/network/" + networkId + "/network-data/network-topology/\",\n" + + " \"relationship-list\": {\n" + + " \"relationship\": [{\n" + + " \"related-to\": \"service-instance\",\n" + + " \"relationship-label\": \"org.onap.relationships.inventory.ComposedOf\",\n" + + " \"related-link\": \"/aai/v14/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/Emanuel/service-instances/service-instance/" + serviceUUID + "\",\n" + + " \"relationship-data\": [{\n" + + " \"relationship-key\": \"customer.global-customer-id\",\n" + + " \"relationship-value\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"\n" + + " }, {\n" + + " \"relationship-key\": \"service-subscription.service-type\",\n" + + " \"relationship-value\": \"Emanuel\"\n" + + " }, {\n" + + " \"relationship-key\": \"service-instance.service-instance-id\",\n" + + " \"relationship-value\": \"" + serviceUUID + "\"\n" + + " }],\n" + + " \"related-to-property\": [{\n" + + " \"property-key\": \"service-instance.service-instance-name\",\n" + + " \"property-value\": \"" + serviceName + "\"\n" + + " }]\n" + + " }, {\n" + + " \"related-to\": \"tenant\",\n" + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\",\n" + + " \"related-link\": \"/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/" + cloudOwner + "/" + cloudRegionId + "/tenants/tenant/" + tenantId + "\",\n" + + " \"relationship-data\": [{\n" + + " \"relationship-key\": \"cloud-region.cloud-owner\",\n" + + " \"relationship-value\": \"" + cloudOwner + "\"\n" + + " }, {\n" + + " \"relationship-key\": \"cloud-region.cloud-region-id\",\n" + + " \"relationship-value\": \"" + region + "\"\n" + + " }, {\n" + + " \"relationship-key\": \"tenant.tenant-id\",\n" + + " \"relationship-value\": \"" + tenantId + "\"\n" + + " }],\n" + + " \"related-to-property\": [{\n" + + " \"property-key\": \"tenant.tenant-name\",\n" + + " \"property-value\": \"" + tenantName +"\"\n" + + " }]\n" + + " }, {\n" + + " \"related-to\": \"cloud-region\",\n" + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\",\n" + + " \"related-link\": \"/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/" + cloudOwner + "/" + cloudRegionId + "\",\n" + + " \"relationship-data\": [{\n" + + " \"relationship-key\": \"cloud-region.cloud-owner\",\n" + + " \"relationship-value\": \"" + cloudOwner + "\"\n" + + " }, {\n" + + " \"relationship-key\": \"cloud-region.cloud-region-id\",\n" + + " \"relationship-value\": \"" + region + "\"\n" + + " }],\n" + + " \"related-to-property\": [{\n" + + " \"property-key\": \"cloud-region.owner-defined-type\",\n" + + " \"property-value\": \"lcp\"\n" + + " }]\n" + + " }, {\n" + + " \"related-to\":\"" + (isBoundToVpn ? "vpn-binding" : "something-else") + "\",\n" + + " \"relationship-label\":\"org.onap.relationships.inventory.Uses\",\n" + + " \"related-link\":\"/aai/v14/network/vpn-bindings/vpn-binding/3e7834fb-a8e0-4243-a837-5352ccab4602\",\n" + + " \"relationship-data\":[{\n" + + " \"relationship-key\":\"vpn-binding.vpn-id\",\n" + + " \"relationship-value\":\"3e7834fb-a8e0-4243-a837-5352ccab4602\"\n" + + " }],\n" + + " \"related-to-property\": [{\n" + + " \"property-key\":\"vpn-binding.vpn-name\",\n" + + " \"property-value\":\"LPPVPN\"\n" + + " }, {\n" + + " \"property-key\":\"vpn-binding.vpn-type\",\n" + + " \"property-value\":\"CUSTOMER\"\n" + + " }]\n" + + " }]\n" + + " }\n" + + " }\n" + + " }"; + } + } + +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetL3NetworksByCloudRegionSpecificState.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetL3NetworksByCloudRegionSpecificState.java new file mode 100644 index 000000000..01a4fb9b4 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetL3NetworksByCloudRegionSpecificState.java @@ -0,0 +1,776 @@ +package org.onap.simulator.presetGenerator.presets.aai; + +public class PresetAAIGetL3NetworksByCloudRegionSpecificState extends AAIBaseGetL3NetworksByCloudRegionPreset { + private int stateNum = 1; + + public PresetAAIGetL3NetworksByCloudRegionSpecificState(int stateNum) { + super(); + this.stateNum = stateNum; + } + + public PresetAAIGetL3NetworksByCloudRegionSpecificState(String cloudOwner, String cloudRegionId, String tenantId) { + super(tenantId, null, cloudRegionId, cloudOwner, null); + } + + @Override + public Object getResponseBody() { + if (stateNum == 1) { + return STATE_1; + } else + return STATE_2; + } + + private static final String STATE_1 = "{ " + + " \"results\": [{ " + + " \"l3-network\": { " + + " \"network-id\": \"3b3308d4-0cd3-43e4-9a7b-d1925c861131\", " + + " \"network-name\": \"AUK51a_oam_calea_net_0\", " + + " \"network-type\": \"SR-IOV-PROVIDER2-0\", " + + " \"network-role\": \"oam_calea_net_0\", " + + " \"network-technology\": \"STANDARD-SR-IOV\", " + + " \"is-bound-to-vpn\": true, " + + " \"resource-version\": \"1540925016770\", " + + " \"orchestration-status\": \"Active\", " + + " \"model-invariant-id\": \"b9a9b549-0ee4-49fc-b4f2-5edc6701da68\", " + + " \"model-version-id\": \"77010093-df36-4dcb-8428-c3d02bf3f88d\", " + + " \"model-customization-id\": \"e5f33853-f84c-4cdd-99f2-93846957aa18\", " + + " \"physical-network-name\": \"sriovnet0\", " + + " \"is-provider-network\": true, " + + " \"is-shared-network\": true, " + + " \"is-external-network\": false, " + + " \"selflink\": \"restconf/config/GENERIC-RESOURCE-API:services/service/ddd91e3d-7cd1-4010-958d-94c729937d2d/service-data/networks/network/dbd80094-df1a-4831-8699-a96949dbca5c/network-data/network-topology/\", " + + " \"relationship-list\": { " + + " \"relationship\": [{ " + + " \"related-to\": \"service-instance\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.ComposedOf\", " + + " \"related-link\": \"/aai/v14/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/Emanuel/service-instances/service-instance/ddd91e3d-7cd1-4010-958d-94c729937d2d\", " + + " \"relationship-data\": [{ " + + " \"relationship-key\": \"customer.global-customer-id\", " + + " \"relationship-value\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\" " + + " }, { " + + " \"relationship-key\": \"service-subscription.service-type\", " + + " \"relationship-value\": \"Emanuel\" " + + " }, { " + + " \"relationship-key\": \"service-instance.service-instance-id\", " + + " \"relationship-value\": \"1c98917b-8255-43c6-98f1-7a2942e75ce1\" " + + " } " + + " ], " + + " \"related-to-property\": [{ " + + " \"property-key\": \"service-instance.service-instance-name\", " + + " \"property-value\": \"AUK51a_oam_calea_net_service_0\" " + + " } " + + " ] " + + " }, { " + + " \"related-to\": \"tenant\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\", " + + " \"related-link\": \"/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/att-nc/auk51a/tenants/tenant/b530fc990b6d4334bd45518bebca6a51\", " + + " \"relationship-data\": [{ " + + " \"relationship-key\": \"cloud-region.cloud-owner\", " + + " \"relationship-value\": \"att-nc\" " + + " }, { " + + " \"relationship-key\": \"cloud-region.cloud-region-id\", " + + " \"relationship-value\": \"auk51a\" " + + " }, { " + + " \"relationship-key\": \"tenant.tenant-id\", " + + " \"relationship-value\": \"b530fc990b6d4334bd45518bebca6a51\" " + + " } " + + " ], " + + " \"related-to-property\": [{ " + + " \"property-key\": \"tenant.tenant-name\", " + + " \"property-value\": \"ecomp_ispt\" " + + " } " + + " ] " + + " }, { " + + " \"related-to\": \"cloud-region\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\", " + + " \"related-link\": \"/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/att-nc/auk51a\", " + + " \"relationship-data\": [{ " + + " \"relationship-key\": \"cloud-region.cloud-owner\", " + + " \"relationship-value\": \"att-nc\" " + + " }, { " + + " \"relationship-key\": \"cloud-region.cloud-region-id\", " + + " \"relationship-value\": \"auk51a\" " + + " } " + + " ], " + + " \"related-to-property\": [{ " + + " \"property-key\": \"cloud-region.owner-defined-type\", " + + " \"property-value\": \"lcp\" " + + " } " + + " ] " + + " }, { " + + " \"related-to\": \"vpn-binding\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\", " + + " \"related-link\": \"/aai/v14/network/vpn-bindings/vpn-binding/3e7834fb-a8e0-4243-a837-5352ccab4602\", " + + " \"relationship-data\": [{ " + + " \"relationship-key\": \"vpn-binding.vpn-id\", " + + " \"relationship-value\": \"3e7834fb-a8e0-4243-a837-5352ccab4602\" " + + " } " + + " ], " + + " \"related-to-property\": [{ " + + " \"property-key\": \"vpn-binding.vpn-name\", " + + " \"property-value\": \"LPPVPN\" " + + " }, { " + + " \"property-key\": \"vpn-binding.vpn-type\", " + + " \"property-value\": \"CUSTOMER\" " + + " } " + + " ] " + + " } " + + " ] " + + " } " + + " } " + + " }, { " + + " \"l3-network\": { " + + " \"network-id\": \"b45cdb14-7a80-4ebd-b979-b1d7c7620851\", " + + " \"network-name\": \"AUK51a_oam_calea_net_1\", " + + " \"network-type\": \"SR-IOV-PROVIDER2-1\", " + + " \"network-role\": \"oam_calea_net_1\", " + + " \"network-technology\": \"STANDARD-SR-IOV\", " + + " \"is-bound-to-vpn\": true, " + + " \"resource-version\": \"1540925016770\", " + + " \"orchestration-status\": \"Active\", " + + " \"model-invariant-id\": \"3b3308d4-0cd3-43e4-9a7b-d1925c861135\", " + + " \"model-version-id\": \"77010093-df36-4dcb-8428-c3d02bf3f88d\", " + + " \"model-customization-id\": \"3b45cdb14-7a80-4ebd-b979-b1d7c7620851\", " + + " \"physical-network-name\": \"sriovnet1\", " + + " \"is-provider-network\": true, " + + " \"is-shared-network\": true, " + + " \"is-external-network\": false, " + + " \"selflink\": \"restconf/config/GENERIC-RESOURCE-API:services/service/ee1b756e-3c9c-4ee0-974b-6218f377b20d/service-data/networks/network/fa1d9589-478d-41ea-96e6-39714ddc6aa5/network-data/network-topology/\", " + + " \"relationship-list\": { " + + " \"relationship\": [{ " + + " \"related-to\": \"service-instance\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.ComposedOf\", " + + " \"related-link\": \"/aai/v14/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/Emanuel/service-instances/service-instance/ee1b756e-3c9c-4ee0-974b-6218f377b20d\", " + + " \"relationship-data\": [{ " + + " \"relationship-key\": \"customer.global-customer-id\", " + + " \"relationship-value\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\" " + + " }, { " + + " \"relationship-key\": \"service-subscription.service-type\", " + + " \"relationship-value\": \"Emanuel\" " + + " }, { " + + " \"relationship-key\": \"service-instance.service-instance-id\", " + + " \"relationship-value\": \"fc21e453-7ff4-438e-bc69-df1f9474b00a\" " + + " } " + + " ], " + + " \"related-to-property\": [{ " + + " \"property-key\": \"service-instance.service-instance-name\", " + + " \"property-value\": \"AUK51a_oam_calea_net_service_1\" " + + " } " + + " ] " + + " }, { " + + " \"related-to\": \"tenant\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\", " + + " \"related-link\": \"/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/att-nc/auk51a/tenants/tenant/b530fc990b6d4334bd45518bebca6a51\", " + + " \"relationship-data\": [{ " + + " \"relationship-key\": \"cloud-region.cloud-owner\", " + + " \"relationship-value\": \"att-nc\" " + + " }, { " + + " \"relationship-key\": \"cloud-region.cloud-region-id\", " + + " \"relationship-value\": \"auk51a\" " + + " }, { " + + " \"relationship-key\": \"tenant.tenant-id\", " + + " \"relationship-value\": \"b530fc990b6d4334bd45518bebca6a51\" " + + " } " + + " ], " + + " \"related-to-property\": [{ " + + " \"property-key\": \"tenant.tenant-name\", " + + " \"property-value\": \"ecomp_ispt\" " + + " } " + + " ] " + + " }, { " + + " \"related-to\": \"cloud-region\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\", " + + " \"related-link\": \"/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/att-nc/auk51a\", " + + " \"relationship-data\": [{ " + + " \"relationship-key\": \"cloud-region.cloud-owner\", " + + " \"relationship-value\": \"att-nc\" " + + " }, { " + + " \"relationship-key\": \"cloud-region.cloud-region-id\", " + + " \"relationship-value\": \"auk51a\" " + + " } " + + " ], " + + " \"related-to-property\": [{ " + + " \"property-key\": \"cloud-region.owner-defined-type\", " + + " \"property-value\": \"lcp\" " + + " } " + + " ] " + + " }, { " + + " \"related-to\": \"vpn-binding\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\", " + + " \"related-link\": \"/aai/v14/network/vpn-bindings/vpn-binding/3e7834fb-a8e0-4243-a837-5352ccab4602\", " + + " \"relationship-data\": [{ " + + " \"relationship-key\": \"vpn-binding.vpn-id\", " + + " \"relationship-value\": \"3e7834fb-a8e0-4243-a837-5352ccab4602\" " + + " } " + + " ], " + + " \"related-to-property\": [{ " + + " \"property-key\": \"vpn-binding.vpn-name\", " + + " \"property-value\": \"LPPVPN\" " + + " }, { " + + " \"property-key\": \"vpn-binding.vpn-type\", " + + " \"property-value\": \"CUSTOMER\" " + + " } " + + " ] " + + " } " + + " ] " + + " } " + + " } " + + " }, { " + + " \"l3-network\": { " + + " \"network-id\": \"10a74149-c9d7-4918-bbcf-d5fb9b1799ce\", " + + " \"network-name\": \"AUK51a_oam_calea_net_2\", " + + " \"network-type\": \"SR-IOV-PROVIDER2-2\", " + + " \"network-role\": \"oam_calea_net_2\", " + + " \"network-technology\": \"STANDARD-SR-IOV\", " + + " \"is-bound-to-vpn\": true, " + + " \"resource-version\": \"1540925016770\", " + + " \"orchestration-status\": \"Active\", " + + " \"model-invariant-id\": \"3b3308d4-0cd3-43e4-9a7b-d1925c861135\", " + + " \"model-version-id\": \"77010093-df36-4dcb-8428-c3d02bf3f88d\", " + + " \"model-customization-id\": \"10a74149-c9d7-4918-bbcf-d5fb9b1799ce\", " + + " \"physical-network-name\": \"sriovnet2\", " + + " \"is-provider-network\": true, " + + " \"is-shared-network\": true, " + + " \"is-external-network\": false, " + + " \"selflink\": \"restconf/config/GENERIC-RESOURCE-API:services/service/315ccdb4-5a11-499f-95dc-25ae4be37dad/service-data/networks/network/2d4f97f5-702a-4707-b9e5-aa9d3e35deeb/network-data/network-topology/\", " + + " \"relationship-list\": { " + + " \"relationship\": [{ " + + " \"related-to\": \"service-instance\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.ComposedOf\", " + + " \"related-link\": \"/aai/v14/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/Emanuel/service-instances/service-instance/315ccdb4-5a11-499f-95dc-25ae4be37dad\", " + + " \"relationship-data\": [{ " + + " \"relationship-key\": \"customer.global-customer-id\", " + + " \"relationship-value\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\" " + + " }, { " + + " \"relationship-key\": \"service-subscription.service-type\", " + + " \"relationship-value\": \"Emanuel\" " + + " }, { " + + " \"relationship-key\": \"service-instance.service-instance-id\", " + + " \"relationship-value\": \"b28d8a84-7d93-4b56-b525-c239c1e780a4\" " + + " } " + + " ], " + + " \"related-to-property\": [{ " + + " \"property-key\": \"service-instance.service-instance-name\", " + + " \"property-value\": \"AUK51a_oam_calea_net_service_2\" " + + " } " + + " ] " + + " }, { " + + " \"related-to\": \"tenant\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\", " + + " \"related-link\": \"/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/att-nc/auk51a/tenants/tenant/b530fc990b6d4334bd45518bebca6a51\", " + + " \"relationship-data\": [{ " + + " \"relationship-key\": \"cloud-region.cloud-owner\", " + + " \"relationship-value\": \"att-nc\" " + + " }, { " + + " \"relationship-key\": \"cloud-region.cloud-region-id\", " + + " \"relationship-value\": \"auk51a\" " + + " }, { " + + " \"relationship-key\": \"tenant.tenant-id\", " + + " \"relationship-value\": \"b530fc990b6d4334bd45518bebca6a51\" " + + " } " + + " ], " + + " \"related-to-property\": [{ " + + " \"property-key\": \"tenant.tenant-name\", " + + " \"property-value\": \"ecomp_ispt\" " + + " } " + + " ] " + + " }, { " + + " \"related-to\": \"cloud-region\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\", " + + " \"related-link\": \"/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/att-nc/auk51a\", " + + " \"relationship-data\": [{ " + + " \"relationship-key\": \"cloud-region.cloud-owner\", " + + " \"relationship-value\": \"att-nc\" " + + " }, { " + + " \"relationship-key\": \"cloud-region.cloud-region-id\", " + + " \"relationship-value\": \"auk51a\" " + + " } " + + " ], " + + " \"related-to-property\": [{ " + + " \"property-key\": \"cloud-region.owner-defined-type\", " + + " \"property-value\": \"lcp\" " + + " } " + + " ] " + + " }, { " + + " \"related-to\": \"vpn-binding\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\", " + + " \"related-link\": \"/aai/v14/network/vpn-bindings/vpn-binding/3e7834fb-a8e0-4243-a837-5352ccab4602\", " + + " \"relationship-data\": [{ " + + " \"relationship-key\": \"vpn-binding.vpn-id\", " + + " \"relationship-value\": \"3e7834fb-a8e0-4243-a837-5352ccab4602\" " + + " } " + + " ], " + + " \"related-to-property\": [{ " + + " \"property-key\": \"vpn-binding.vpn-name\", " + + " \"property-value\": \"LPPVPN\" " + + " }, { " + + " \"property-key\": \"vpn-binding.vpn-type\", " + + " \"property-value\": \"CUSTOMER\" " + + " } " + + " ] " + + " } " + + " ] " + + " } " + + " } " + + " }, { " + + " \"l3-network\": { " + + " \"network-id\": \"95380967-0f1c-41e9-a47f-9baa3f90860c\", " + + " \"network-name\": \"AUK51a_oam_calea_net_3\", " + + " \"network-type\": \"SR-IOV-PROVIDER2-3\", " + + " \"network-role\": \"oam_calea_net_3\", " + + " \"network-technology\": \"STANDARD-SR-IOV\", " + + " \"is-bound-to-vpn\": true, " + + " \"resource-version\": \"1540925016770\", " + + " \"orchestration-status\": \"Active\", " + + " \"model-invariant-id\": \"3b3308d4-0cd3-43e4-9a7b-d1925c861135\", " + + " \"model-version-id\": \"77010093-df36-4dcb-8428-c3d02bf3f88d\", " + + " \"model-customization-id\": \"95380967-0f1c-41e9-a47f-9baa3f90860c\", " + + " \"physical-network-name\": \"sriovnet3\", " + + " \"is-provider-network\": true, " + + " \"is-shared-network\": true, " + + " \"is-external-network\": false, " + + " \"selflink\": \"restconf/config/GENERIC-RESOURCE-API:services/service/c44ad6cc-639a-4c6b-a327-583afd656a0d/service-data/networks/network/cf18fbb3-ddcb-4774-bd30-e0e895c0e35e/network-data/network-topology/\", " + + " \"relationship-list\": { " + + " \"relationship\": [{ " + + " \"related-to\": \"service-instance\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.ComposedOf\", " + + " \"related-link\": \"/aai/v14/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/Emanuel/service-instances/service-instance/c44ad6cc-639a-4c6b-a327-583afd656a0d\", " + + " \"relationship-data\": [{ " + + " \"relationship-key\": \"customer.global-customer-id\", " + + " \"relationship-value\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\" " + + " }, { " + + " \"relationship-key\": \"service-subscription.service-type\", " + + " \"relationship-value\": \"Emanuel\" " + + " }, { " + + " \"relationship-key\": \"service-instance.service-instance-id\", " + + " \"relationship-value\": \"f09bbb55-8942-4621-892f-4690a8e5570a\" " + + " } " + + " ], " + + " \"related-to-property\": [{ " + + " \"property-key\": \"service-instance.service-instance-name\", " + + " \"property-value\": \"AUK51a_oam_calea_net_service_3\" " + + " } " + + " ] " + + " }, { " + + " \"related-to\": \"tenant\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\", " + + " \"related-link\": \"/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/att-nc/auk51a/tenants/tenant/b530fc990b6d4334bd45518bebca6a51\", " + + " \"relationship-data\": [{ " + + " \"relationship-key\": \"cloud-region.cloud-owner\", " + + " \"relationship-value\": \"att-nc\" " + + " }, { " + + " \"relationship-key\": \"cloud-region.cloud-region-id\", " + + " \"relationship-value\": \"auk51a\" " + + " }, { " + + " \"relationship-key\": \"tenant.tenant-id\", " + + " \"relationship-value\": \"b530fc990b6d4334bd45518bebca6a51\" " + + " } " + + " ], " + + " \"related-to-property\": [{ " + + " \"property-key\": \"tenant.tenant-name\", " + + " \"property-value\": \"ecomp_ispt\" " + + " } " + + " ] " + + " }, { " + + " \"related-to\": \"cloud-region\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\", " + + " \"related-link\": \"/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/att-nc/auk51a\", " + + " \"relationship-data\": [{ " + + " \"relationship-key\": \"cloud-region.cloud-owner\", " + + " \"relationship-value\": \"att-nc\" " + + " }, { " + + " \"relationship-key\": \"cloud-region.cloud-region-id\", " + + " \"relationship-value\": \"auk51a\" " + + " } " + + " ], " + + " \"related-to-property\": [{ " + + " \"property-key\": \"cloud-region.owner-defined-type\", " + + " \"property-value\": \"lcp\" " + + " } " + + " ] " + + " }, { " + + " \"related-to\": \"vpn-binding\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\", " + + " \"related-link\": \"/aai/v14/network/vpn-bindings/vpn-binding/3e7834fb-a8e0-4243-a837-5352ccab4602\", " + + " \"relationship-data\": [{ " + + " \"relationship-key\": \"vpn-binding.vpn-id\", " + + " \"relationship-value\": \"3e7834fb-a8e0-4243-a837-5352ccab4602\" " + + " } " + + " ], " + + " \"related-to-property\": [{ " + + " \"property-key\": \"vpn-binding.vpn-name\", " + + " \"property-value\": \"LPPVPN\" " + + " }, { " + + " \"property-key\": \"vpn-binding.vpn-type\", " + + " \"property-value\": \"CUSTOMER\" " + + " } " + + " ] " + + " } " + + " ] " + + " } " + + " } " + + " }, { " + + " \"l3-network\": { " + + " \"network-id\": \"3b3308d4-0cd3-43e4-9a7b-d1925c861135\", " + + " \"network-name\": \"AUK51a_oam_calea_net_0\", " + + " \"network-type\": \"SR-IOV-PROVIDER2-0\", " + + " \"network-technology\": \"STANDARD-SR-IOV\", " + + " \"is-bound-to-vpn\": true, " + + " \"resource-version\": \"1540925016770\", " + + " \"orchestration-status\": \"Active\", " + + " \"model-invariant-id\": \"3b3308d4-0cd3-43e4-9a7b-d1925c861135\", " + + " \"model-version-id\": \"77010093-df36-4dcb-8428-c3d02bf3f88d\", " + + " \"model-customization-id\": \"95380967-0f1c-41e9-a47f-9baa3f90860c\", " + + " \"physical-network-name\": \"sriovnet0\", " + + " \"is-provider-network\": true, " + + " \"is-shared-network\": true, " + + " \"is-external-network\": false, " + + " \"selflink\": \"restconf/config/GENERIC-RESOURCE-API:services/service/74141179-b5b9-4383-aab4-45f5b9f70127/service-data/networks/network/62cecd1b-f4bf-4e16-add9-2b6f5181e595/network-data/network-topology/\", " + + " \"relationship-list\": { " + + " \"relationship\": [{ " + + " \"related-to\": \"service-instance\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.ComposedOf\", " + + " \"related-link\": \"/aai/v14/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/Emanuel/service-instances/service-instance/74141179-b5b9-4383-aab4-45f5b9f70127\", " + + " \"relationship-data\": [{ " + + " \"relationship-key\": \"customer.global-customer-id\", " + + " \"relationship-value\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\" " + + " }, { " + + " \"relationship-key\": \"service-subscription.service-type\", " + + " \"relationship-value\": \"Emanuel\" " + + " }, { " + + " \"relationship-key\": \"service-instance.service-instance-id\", " + + " \"relationship-value\": \"1c98917b-8255-43c6-98f1-7a2942e75ce1\" " + + " } " + + " ], " + + " \"related-to-property\": [{ " + + " \"property-key\": \"service-instance.service-instance-name\", " + + " \"property-value\": \"AUK51a_oam_calea_net_service_0\" " + + " } " + + " ] " + + " }, { " + + " \"related-to\": \"tenant\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\", " + + " \"related-link\": \"/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/att-nc/auk51a/tenants/tenant/b530fc990b6d4334bd45518bebca6a51\", " + + " \"relationship-data\": [{ " + + " \"relationship-key\": \"cloud-region.cloud-owner\", " + + " \"relationship-value\": \"att-nc\" " + + " }, { " + + " \"relationship-key\": \"cloud-region.cloud-region-id\", " + + " \"relationship-value\": \"auk51a\" " + + " }, { " + + " \"relationship-key\": \"tenant.tenant-id\", " + + " \"relationship-value\": \"b530fc990b6d4334bd45518bebca6a51\" " + + " } " + + " ], " + + " \"related-to-property\": [{ " + + " \"property-key\": \"tenant.tenant-name\", " + + " \"property-value\": \"ecomp_ispt\" " + + " } " + + " ] " + + " }, { " + + " \"related-to\": \"cloud-region\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\", " + + " \"related-link\": \"/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/att-nc/auk51a\", " + + " \"relationship-data\": [{ " + + " \"relationship-key\": \"cloud-region.cloud-owner\", " + + " \"relationship-value\": \"att-nc\" " + + " }, { " + + " \"relationship-key\": \"cloud-region.cloud-region-id\", " + + " \"relationship-value\": \"auk51a\" " + + " } " + + " ], " + + " \"related-to-property\": [{ " + + " \"property-key\": \"cloud-region.owner-defined-type\", " + + " \"property-value\": \"lcp\" " + + " } " + + " ] " + + " }, { " + + " \"related-to\": \"vpn-binding\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\", " + + " \"related-link\": \"/aai/v14/network/vpn-bindings/vpn-binding/3e7834fb-a8e0-4243-a837-5352ccab4602\", " + + " \"relationship-data\": [{ " + + " \"relationship-key\": \"vpn-binding.vpn-id\", " + + " \"relationship-value\": \"3e7834fb-a8e0-4243-a837-5352ccab4602\" " + + " } " + + " ], " + + " \"related-to-property\": [{ " + + " \"property-key\": \"vpn-binding.vpn-name\", " + + " \"property-value\": \"LPPVPN\" " + + " }, { " + + " \"property-key\": \"vpn-binding.vpn-type\", " + + " \"property-value\": \"CUSTOMER\" " + + " } " + + " ] " + + " } " + + " ] " + + " } " + + " } " + + " } " + + " ] " + + "}"; + + private static final String STATE_2 = "{\"results\": [" + + " {\"l3-network\": {" + + " \"network-id\": \"CC-l3network_1\"," + + " \"is-bound-to-vpn\": false," + + " \"resource-version\": \"1556206041065\"," + + " \"is-provider-network\": false," + + " \"is-shared-network\": false," + + " \"is-external-network\": false," + + " \"relationship-list\": {\"relationship\": [ {" + + " \"related-to\": \"tenant\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v17/cloud-infrastructure/cloud-regions/cloud-region/cloud-owner-CC-ANAI-528/cloud-region-id-CC-ANAI-528/tenants/tenant/tenant-id-CC-ANAI-528T1\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"cloud-region.cloud-owner\"," + + " \"relationship-value\": \"cloud-owner-CC-ANAI-528\"" + + " }," + + " {" + + " \"relationship-key\": \"cloud-region.cloud-region-id\"," + + " \"relationship-value\": \"cloud-region-id-CC-ANAI-528\"" + + " }," + + " {" + + " \"relationship-key\": \"tenant.tenant-id\"," + + " \"relationship-value\": \"tenant-id-CC-ANAI-528T1\"" + + " }" + + " ]," + + " \"related-to-property\": [ {" + + " \"property-key\": \"tenant.tenant-name\"," + + " \"property-value\": \"tenant-name-CC-ANAI-528T1\"" + + " }]" + + " }]}" + + " }}," + + " {\"l3-network\": {" + + " \"network-id\": \"CC-l3network_3\"," + + " \"network-name\": \"DLLSTXRNDS3\"," + + " \"network-role\": \"Backup\"," + + " \"is-bound-to-vpn\": true," + + " \"resource-version\": \"1556139217403\"," + + " \"is-provider-network\": false," + + " \"is-shared-network\": false," + + " \"is-external-network\": false," + + " \"relationship-list\": {\"relationship\": [" + + " {" + + " \"related-to\": \"tenant\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v17/cloud-infrastructure/cloud-regions/cloud-region/cloud-owner-CC-ANAI-528/cloud-region-id-CC-ANAI-528/tenants/tenant/tenant-id-CC-ANAI-528T1\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"cloud-region.cloud-owner\"," + + " \"relationship-value\": \"cloud-owner-CC-ANAI-528\"" + + " }," + + " {" + + " \"relationship-key\": \"cloud-region.cloud-region-id\"," + + " \"relationship-value\": \"cloud-region-id-CC-ANAI-528\"" + + " }," + + " {" + + " \"relationship-key\": \"tenant.tenant-id\"," + + " \"relationship-value\": \"tenant-id-CC-ANAI-528T1\"" + + " }" + + " ]," + + " \"related-to-property\": [ {" + + " \"property-key\": \"tenant.tenant-name\"," + + " \"property-value\": \"tenant-name-CC-ANAI-528T1\"" + + " }]" + + " }," + + " {" + + " \"related-to\": \"tenant\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v17/cloud-infrastructure/cloud-regions/cloud-region/cloud-owner-CC-ANAI-528/cloud-region-id-CC-ANAI-528/tenants/tenant/tenant-id-CC-ANAI-528-T2\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"cloud-region.cloud-owner\"," + + " \"relationship-value\": \"cloud-owner-CC-ANAI-528\"" + + " }," + + " {" + + " \"relationship-key\": \"cloud-region.cloud-region-id\"," + + " \"relationship-value\": \"cloud-region-id-CC-ANAI-528\"" + + " }," + + " {" + + " \"relationship-key\": \"tenant.tenant-id\"," + + " \"relationship-value\": \"tenant-id-CC-ANAI-528-T2\"" + + " }" + + " ]," + + " \"related-to-property\": [ {" + + " \"property-key\": \"tenant.tenant-name\"," + + " \"property-value\": \"tenant-name-CC-ANAI-528T2\"" + + " }]" + + " }," + + " {" + + " \"related-to\": \"tenant\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v17/cloud-infrastructure/cloud-regions/cloud-region/cloud-owner-CC-ANAI-528/cloud-region-id-CC-ANAI-528/tenants/tenant/tenant-id-CC-ANAI-528T3\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"cloud-region.cloud-owner\"," + + " \"relationship-value\": \"cloud-owner-CC-ANAI-528\"" + + " }," + + " {" + + " \"relationship-key\": \"cloud-region.cloud-region-id\"," + + " \"relationship-value\": \"cloud-region-id-CC-ANAI-528\"" + + " }," + + " {" + + " \"relationship-key\": \"tenant.tenant-id\"," + + " \"relationship-value\": \"tenant-id-CC-ANAI-528T3\"" + + " }" + + " ]," + + " \"related-to-property\": [ {" + + " \"property-key\": \"tenant.tenant-name\"," + + " \"property-value\": \"tenant-name-CC-ANAI-528T3\"" + + " }]" + + " }" + + " ]}" + + " }}," + + " {\"l3-network\": {" + + " \"network-id\": \"l3network2-550-as988q\"," + + " \"network-name\": \"CHICGIL01VDBE01_SubIntNtwk043\"," + + " \"network-type\": \"K6VD\"," + + " \"network-role\": \"X92XE0j\"," + + " \"network-technology\": \"ZYbPEnCjX6Oqd\"," + + " \"neutron-network-id\": \"fpFvDje\"," + + " \"is-bound-to-vpn\": false," + + " \"service-id\": \"NJnzYaRlz0Test\"," + + " \"network-role-instance\": 162," + + " \"resource-version\": \"1556823012443\"," + + " \"orchestration-status\": \"active\"," + + " \"heat-stack-id\": \"0GmDeg\"," + + " \"mso-catalog-key\": \"la5ylhZ5g0D\"," + + " \"contrail-network-fqdn\": \"EaeexDk47\"," + + " \"model-customization-id\": \"wgmn6PrJ5\"," + + " \"widget-model-id\": \"e0yNr\"," + + " \"widget-model-version\": \"yKpry3J0VVLn\"," + + " \"physical-network-name\": \"wq6OKbZMTY\"," + + " \"is-provider-network\": false," + + " \"is-shared-network\": false," + + " \"is-external-network\": false," + + " \"selflink\": \"9xtMu4EPuTi\"," + + " \"operational-status\": \"W8aj\"," + + " \"is-trunked\": true," + + " \"relationship-list\": {\"relationship\": [" + + " {" + + " \"related-to\": \"tenant\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v17/cloud-infrastructure/cloud-regions/cloud-region/cloud-owner-CC-ANAI-528/cloud-region-id-CC-ANAI-528/tenants/tenant/tenant-id-CC-ANAI-528T1\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"cloud-region.cloud-owner\"," + + " \"relationship-value\": \"cloud-owner-CC-ANAI-528\"" + + " }," + + " {" + + " \"relationship-key\": \"cloud-region.cloud-region-id\"," + + " \"relationship-value\": \"cloud-region-id-CC-ANAI-528\"" + + " }," + + " {" + + " \"relationship-key\": \"tenant.tenant-id\"," + + " \"relationship-value\": \"tenant-id-CC-ANAI-528T1\"" + + " }" + + " ]," + + " \"related-to-property\": [ {" + + " \"property-key\": \"tenant.tenant-name\"," + + " \"property-value\": \"tenant-name-CC-ANAI-528T1\"" + + " }]" + + " }," + + " {" + + " \"related-to\": \"configuration\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.PartOf\"," + + " \"related-link\": \"/aai/v17/network/configurations/configuration/configuration2-550-as988q\"," + + " \"relationship-data\": [ {" + + " \"relationship-key\": \"configuration.configuration-id\"," + + " \"relationship-value\": \"configuration2-550-as988q\"" + + " }]" + + " }," + + " {" + + " \"related-to\": \"configuration\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.PartOf\"," + + " \"related-link\": \"/aai/v17/network/configurations/configuration/configuration1-550-as988q\"," + + " \"relationship-data\": [ {" + + " \"relationship-key\": \"configuration.configuration-id\"," + + " \"relationship-value\": \"configuration1-550-as988q\"" + + " }]" + + " }," + + " {" + + " \"related-to\": \"vpn-binding\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v17/network/vpn-bindings/vpn-binding/VPNbinding3-550-as988q\"," + + " \"relationship-data\": [ {" + + " \"relationship-key\": \"vpn-binding.vpn-id\"," + + " \"relationship-value\": \"VPNbinding3-550-as988q\"" + + " }]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"vpn-binding.vpn-name\"," + + " \"property-value\": \"SZ2A5L_VPNTest\"" + + " }," + + " {" + + " \"property-key\": \"vpn-binding.vpn-type\"," + + " \"property-value\": \"1903e94v\"" + + " }" + + " ]" + + " }" + + " ]}" + + " }}," + + " {\"l3-network\": {" + + " \"network-id\": \"CC-l3network_2\"," + + " \"network-name\": \"DLLSTXRNDS2\"," + + " \"network-role\": \"Primary\"," + + " \"is-bound-to-vpn\": true," + + " \"resource-version\": \"1556136783141\"," + + " \"is-provider-network\": true," + + " \"is-shared-network\": true," + + " \"is-external-network\": true," + + " \"relationship-list\": {\"relationship\": [" + + " {" + + " \"related-to\": \"tenant\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v17/cloud-infrastructure/cloud-regions/cloud-region/cloud-owner-CC-ANAI-528/cloud-region-id-CC-ANAI-528/tenants/tenant/tenant-id-CC-ANAI-528T1\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"cloud-region.cloud-owner\"," + + " \"relationship-value\": \"cloud-owner-CC-ANAI-528\"" + + " }," + + " {" + + " \"relationship-key\": \"cloud-region.cloud-region-id\"," + + " \"relationship-value\": \"cloud-region-id-CC-ANAI-528\"" + + " }," + + " {" + + " \"relationship-key\": \"tenant.tenant-id\"," + + " \"relationship-value\": \"tenant-id-CC-ANAI-528T1\"" + + " }" + + " ]," + + " \"related-to-property\": [ {" + + " \"property-key\": \"tenant.tenant-name\"," + + " \"property-value\": \"tenant-name-CC-ANAI-528T1\"" + + " }]" + + " }," + + " {" + + " \"related-to\": \"tenant\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v17/cloud-infrastructure/cloud-regions/cloud-region/cloud-owner-CC-ANAI-528/cloud-region-id-CC-ANAI-528/tenants/tenant/tenant-id-CC-ANAI-528-T2\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"cloud-region.cloud-owner\"," + + " \"relationship-value\": \"cloud-owner-CC-ANAI-528\"" + + " }," + + " {" + + " \"relationship-key\": \"cloud-region.cloud-region-id\"," + + " \"relationship-value\": \"cloud-region-id-CC-ANAI-528\"" + + " }," + + " {" + + " \"relationship-key\": \"tenant.tenant-id\"," + + " \"relationship-value\": \"tenant-id-CC-ANAI-528-T2\"" + + " }" + + " ]," + + " \"related-to-property\": [ {" + + " \"property-key\": \"tenant.tenant-name\"," + + " \"property-value\": \"tenant-name-CC-ANAI-528T2\"" + + " }]" + + " }" + + " ]}" + + " }}" + + "]}"; + + + + +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetL3NetworksByCloudRegionWithError.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetL3NetworksByCloudRegionWithError.java new file mode 100644 index 000000000..1d74b0f39 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetL3NetworksByCloudRegionWithError.java @@ -0,0 +1,23 @@ +package org.onap.simulator.presetGenerator.presets.aai; + +public class PresetAAIGetL3NetworksByCloudRegionWithError extends AAIBaseGetL3NetworksByCloudRegionPreset { + private int errorCode; + private String errorText; + + + public PresetAAIGetL3NetworksByCloudRegionWithError(int errorCode, String errorText) { + super(); + this.errorCode = errorCode; + this.errorText = errorText; + } + + @Override + public int getResponseCode() { + return errorCode; + } + + @Override + public Object getResponseBody() { + return "{\"status\":\"Error\", \"text\":\"" + errorText + "\"}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetModelsByOwningEntity.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetModelsByOwningEntity.java index 41c35b8a5..ae921fd79 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetModelsByOwningEntity.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetModelsByOwningEntity.java @@ -1,11 +1,12 @@ package org.onap.simulator.presetGenerator.presets.aai; import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + import java.util.Collections; import java.util.List; import java.util.Map; -import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; -import org.springframework.http.HttpMethod; public class PresetAAIGetModelsByOwningEntity extends BaseAAIPreset { String oeName; diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetModelsByProject.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetModelsByProject.java index cb80fd6ce..4da5c0567 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetModelsByProject.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetModelsByProject.java @@ -1,12 +1,13 @@ package org.onap.simulator.presetGenerator.presets.aai; import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + import java.util.Collections; import java.util.List; import java.util.Map; import java.util.UUID; -import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; -import org.springframework.http.HttpMethod; public class PresetAAIGetModelsByProject extends BaseAAIPreset { private String projectName; diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetails.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetails.java index b99f58bda..3758d3f3b 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetails.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetails.java @@ -2,11 +2,12 @@ package org.onap.simulator.presetGenerator.presets.aai; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + import java.util.Collections; import java.util.List; import java.util.Map; -import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; -import org.springframework.http.HttpMethod; public class PresetAAIGetNetworkCollectionDetails extends BaseAAIPreset { diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetailsInvalidRequest.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetailsInvalidRequest.java index 0d447c2c2..31cd6fdd0 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetailsInvalidRequest.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetailsInvalidRequest.java @@ -2,11 +2,12 @@ package org.onap.simulator.presetGenerator.presets.aai; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + import java.util.Collections; import java.util.List; import java.util.Map; -import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; -import org.springframework.http.HttpMethod; public class PresetAAIGetNetworkCollectionDetailsInvalidRequest extends BaseAAIPreset { diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetailsRequiredMissing.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetailsRequiredMissing.java index 23b35d204..b3f34bb3e 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetailsRequiredMissing.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetailsRequiredMissing.java @@ -2,11 +2,12 @@ package org.onap.simulator.presetGenerator.presets.aai; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + import java.util.Collections; import java.util.List; import java.util.Map; -import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; -import org.springframework.http.HttpMethod; public class PresetAAIGetNetworkCollectionDetailsRequiredMissing extends BaseAAIPreset { diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetPNFByRegionErrorPut.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetPNFByRegionErrorPut.java index 0676217a1..8bc0fe63a 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetPNFByRegionErrorPut.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetPNFByRegionErrorPut.java @@ -11,8 +11,8 @@ public class PresetAAIGetPNFByRegionErrorPut extends BaseAAIPreset { @Override public Object getResponseBody() { return "{" + - " \"start\": \"/business/customers/customer/e433710f-9217-458d-a79d-1c7aff376d89/service-subscriptions/service-subscription/VIRTUAL%20USP/service-instances?model-version-id=8a84e59b-45fe-4851-8ff1-34225a0b32c3&model-invariant-id=83b458fd-5dd3-419b-a9e3-7335814a0911\"," + - " \"query\": \"query/pnf-fromModel-byRegion?cloudRegionId=JANET25&equipVendor=Cisco&equipModel=Nexus%203048-TP\"" + + " \"start\": \"/business/customers/customer/e433710f-9217-458d-a79d-1c7aff376d89/service-subscriptions/service-subscription/TYLER%20SILVIA/service-instances?model-version-id=8a84e59b-45fe-4851-8ff1-34225a0b32c3&model-invariant-id=83b458fd-5dd3-419b-a9e3-7335814a0911\"," + + " \"query\": \"query/pnf-fromModel-byRegion?cloudRegionId=AAIAIC25&equipVendor=Cisco&equipModel=Nexus%203048-TP\"" + " }"; } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetPortMirroringSourcePorts.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetPortMirroringSourcePorts.java index fdb387d71..9fad964d8 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetPortMirroringSourcePorts.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetPortMirroringSourcePorts.java @@ -1,11 +1,12 @@ package org.onap.simulator.presetGenerator.presets.aai; import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + import java.util.Collections; import java.util.List; import java.util.Map; -import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; -import org.springframework.http.HttpMethod; public class PresetAAIGetPortMirroringSourcePorts extends BaseAAIPreset { public PresetAAIGetPortMirroringSourcePorts(String configurationId, String interfaceId, String interfaceName, boolean isPortMirrored) { diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetRelatedInstanceGroupsByVnfId.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetRelatedInstanceGroupsByVnfId.java index da1a120b4..c75155273 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetRelatedInstanceGroupsByVnfId.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetRelatedInstanceGroupsByVnfId.java @@ -1,11 +1,12 @@ package org.onap.simulator.presetGenerator.presets.aai; import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + import java.util.Collections; import java.util.List; import java.util.Map; -import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; -import org.springframework.http.HttpMethod; public class PresetAAIGetRelatedInstanceGroupsByVnfId extends BaseAAIPreset { diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetServicesGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetServicesGet.java index 615879e18..2d59cd633 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetServicesGet.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetServicesGet.java @@ -10,17 +10,17 @@ public class PresetAAIGetServicesGet extends PresetAAIBaseGetServicesGet { private String responseBody = "{\"service\":[" + " {" + " \"service-id\":\"ebc3bc3d-62fd-4a3f-a037-f619df4ff034\"," + - " \"service-description\":\"DHV\"," + + " \"service-description\":\"ERICA\"," + " \"resource-version\":\"1494001985150\"" + " }," + " {" + " \"service-id\":\"17cc1042-527b-11e6-beb8-9e71128cae77\"," + - " \"service-description\":\"FLEXREACH\"," + + " \"service-description\":\"IGNACIO\"," + " \"resource-version\":\"1494001922171\"" + " }," + " {" + " \"service-id\":\"36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e\"," + - " \"service-description\":\"Netbond\"," + + " \"service-description\":\"Christie\"," + " \"resource-version\":\"1494001855144\"" + " }," + " {" + @@ -50,7 +50,7 @@ public class PresetAAIGetServicesGet extends PresetAAIBaseGetServicesGet { " }," + " {" + " \"service-id\":\"db171b8f-115c-4992-a2e3-ee04cae357e0\"," + - " \"service-description\":\"FIRSTNET\"," + + " \"service-description\":\"LINDSEY\"," + " \"resource-version\":\"1490910095155\"" + " }," + " {" + @@ -85,12 +85,12 @@ public class PresetAAIGetServicesGet extends PresetAAIBaseGetServicesGet { " }," + " {" + " \"service-id\":\"0ee8c1bc-7cbd-4b0a-a1ac-e9999255abc1\"," + - " \"service-description\":\"WAN Bonding\"," + + " \"service-description\":\"CARA Griffin\"," + " \"resource-version\":\"1498053422512\"" + " }," + " {" + " \"service-id\":\"c7611ebe-c324-48f1-8085-94aef0c6ef3d\"," + - " \"service-description\":\"HOSTED COMMUNICATIONS\"," + + " \"service-description\":\"DARREN MCGEE\"," + " \"resource-version\":\"1494001913639\"" + " }," + " {" + @@ -105,7 +105,7 @@ public class PresetAAIGetServicesGet extends PresetAAIBaseGetServicesGet { " }," + " {" + " \"service-id\":\"d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4\"," + - " \"service-description\":\"uCPE-VMS\"," + + " \"service-description\":\"JOSEFINA\"," + " \"resource-version\":\"1494001941772\"" + " }," + " {" + @@ -115,7 +115,7 @@ public class PresetAAIGetServicesGet extends PresetAAIBaseGetServicesGet { " }," + " {" + " \"service-id\":\"12a96a9d-4b4c-4349-a950-fe1159602621\"," + - " \"service-description\":\"HOSTED COMMUNICATIONS\"," + + " \"service-description\":\"DARREN MCGEE\"," + " \"resource-version\":\"1494001817126\"" + " }" + " ]}"; diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGet.java index db41b9518..c14c1c7df 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGet.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGet.java @@ -1,13 +1,14 @@ package org.onap.simulator.presetGenerator.presets.aai; -import static vid.automation.test.utils.ReadFile.loadResourceAsString; - import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + import java.util.Collections; import java.util.List; import java.util.Map; -import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; -import org.springframework.http.HttpMethod; + +import static vid.automation.test.utils.ReadFile.loadResourceAsString; public class PresetAAIGetSubDetailsGet extends BaseAAIPreset { private String subscriberId; diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGetSpecificService.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGetSpecificService.java index 615c196a9..291f0b722 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGetSpecificService.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGetSpecificService.java @@ -1,15 +1,16 @@ package org.onap.simulator.presetGenerator.presets.aai; -import static vid.automation.test.infra.ModelInfo.serviceFabricSriovService; - import com.google.common.collect.ImmutableMap; -import java.util.Collections; -import java.util.List; -import java.util.Map; import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; import org.springframework.http.HttpMethod; import vid.automation.test.infra.ModelInfo; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import static vid.automation.test.infra.ModelInfo.serviceFabricSriovService; + public class PresetAAIGetSubDetailsGetSpecificService extends BaseAAIPreset { private String subscriberId; private String subscriberName = "Emanuel"; @@ -60,13 +61,13 @@ public class PresetAAIGetSubDetailsGetSpecificService extends BaseAAIPreset { " \"service-subscriptions\":{" + " \"service-subscription\":[" + " {" + - " \"service-type\":\"vFlowLogic\"," + + " \"service-type\":\"vRichardson\"," + " \"resource-version\":\"1501700976809\"," + " \"service-instances\":{" + " \"service-instance\":[" + " {" + " \"service-instance-id\":\"414db2d4-18d0-415e-aac2-f255b586cfb5\"," + - " \"service-instance-name\":\"vFlowLogic-vflf_080117\"," + + " \"service-instance-name\":\"vRichardson-vflf_080117\"," + " \"persona-model-id\":null," + " \"persona-model-version\":null," + " \"resource-version\":\"1502391806301\"," + @@ -76,7 +77,7 @@ public class PresetAAIGetSubDetailsGetSpecificService extends BaseAAIPreset { " }," + " {" + " \"service-instance-id\":\"769be44e-981a-4da8-af3b-ca5fa76b7fb1\"," + - " \"service-instance-name\":\"vFlowLogic-vflp_080117\"," + + " \"service-instance-name\":\"vRichardson-vflp_080117\"," + " \"persona-model-id\":null," + " \"persona-model-version\":null," + " \"resource-version\":\"1501712783617\"," + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsWithoutInstancesGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsWithoutInstancesGet.java index f6ce3e86d..95a7c87d7 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsWithoutInstancesGet.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsWithoutInstancesGet.java @@ -1,11 +1,12 @@ package org.onap.simulator.presetGenerator.presets.aai; import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + import java.util.Collections; import java.util.List; import java.util.Map; -import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; -import org.springframework.http.HttpMethod; public class PresetAAIGetSubDetailsWithoutInstancesGet extends BaseAAIPreset { private String subscriberId; @@ -52,7 +53,7 @@ public class PresetAAIGetSubDetailsWithoutInstancesGet extends BaseAAIPreset { " \"service-subscriptions\":{" + " \"service-subscription\":[" + " {" + - " \"service-type\":\"vFlowLogic\"," + + " \"service-type\":\"vRichardson\"," + " \"resource-version\":\"1501700976809\"," + " \"is-permitted\":false" + " }," + @@ -67,7 +68,7 @@ public class PresetAAIGetSubDetailsWithoutInstancesGet extends BaseAAIPreset { " \"is-permitted\":false" + " }," + " {" + - " \"service-type\":\"vBNG\"," + + " \"service-type\":\"vJamie\"," + " \"resource-version\":\"1498068165053\"," + " \"is-permitted\":false" + " }," + @@ -82,7 +83,7 @@ public class PresetAAIGetSubDetailsWithoutInstancesGet extends BaseAAIPreset { " \"is-permitted\":true" + " }," + " {" + - " \"service-type\":\"vSEGW\"," + + " \"service-type\":\"vPorfirio\"," + " \"resource-version\":\"1494254851983\"," + " \"is-permitted\":false" + " }," + @@ -97,7 +98,7 @@ public class PresetAAIGetSubDetailsWithoutInstancesGet extends BaseAAIPreset { " \"is-permitted\":false" + " }," + " {" + - " \"service-type\":\"vMME\"," + + " \"service-type\":\"vFLORENCE\"," + " \"resource-version\":\"1497729820723\"," + " \"is-permitted\":false" + " }," + @@ -132,17 +133,17 @@ public class PresetAAIGetSubDetailsWithoutInstancesGet extends BaseAAIPreset { " \"is-permitted\":false" + " }," + " {" + - " \"service-type\":\"FIRSTNET\"," + + " \"service-type\":\"LINDSEY\"," + " \"resource-version\":\"1509387060781\"," + " \"is-permitted\":false" + " }," + " {" + - " \"service-type\":\"ACTIVE_CHARGE\"," + + " \"service-type\":\"JOHANNA_SANTOS\"," + " \"resource-version\":\"1494255101364\"," + " \"is-permitted\":false" + " }," + " {" + - " \"service-type\":\"vHSS\"," + + " \"service-type\":\"vCarroll\"," + " \"resource-version\":\"1494254877333\"," + " \"is-permitted\":false" + " }" + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsWithoutInstancesGetSpecificService.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsWithoutInstancesGetSpecificService.java index 62a587001..44941ade8 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsWithoutInstancesGetSpecificService.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsWithoutInstancesGetSpecificService.java @@ -1,11 +1,12 @@ package org.onap.simulator.presetGenerator.presets.aai; import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + import java.util.Collections; import java.util.List; import java.util.Map; -import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; -import org.springframework.http.HttpMethod; public class PresetAAIGetSubDetailsWithoutInstancesGetSpecificService extends BaseAAIPreset { private String subscriberId; @@ -49,7 +50,7 @@ public class PresetAAIGetSubDetailsWithoutInstancesGetSpecificService extends Ba " \"service-subscriptions\":{" + " \"service-subscription\":[" + " {" + - " \"service-type\":\"vFlowLogic\"," + + " \"service-type\":\"vRichardson\"," + " \"resource-version\":\"1501700976809\"," + " \"is-permitted\":false" + " }," + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubscribersGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubscribersGet.java index 0517fd788..c6a5f3063 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubscribersGet.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubscribersGet.java @@ -3,13 +3,14 @@ package org.onap.simulator.presetGenerator.presets.aai; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.onap.simulator.presetGenerator.presets.model.Subscriber; +import org.springframework.http.HttpMethod; + import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Map; -import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; -import org.onap.simulator.presetGenerator.presets.model.Subscriber; -import org.springframework.http.HttpMethod; public class PresetAAIGetSubscribersGet extends BaseAAIPreset { diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetTenants.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetTenants.java index 638cc3911..0808eaba6 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetTenants.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetTenants.java @@ -1,10 +1,10 @@ package org.onap.simulator.presetGenerator.presets.aai; -import static vid.automation.test.utils.ReadFile.loadResourceAsString; - import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; import org.springframework.http.HttpMethod; +import static vid.automation.test.utils.ReadFile.loadResourceAsString; + public class PresetAAIGetTenants extends BaseAAIPreset { private final String subscriberId; private final String serviceType; diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetVpnsByType.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetVpnsByType.java new file mode 100644 index 000000000..70700f366 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetVpnsByType.java @@ -0,0 +1,370 @@ +package org.onap.simulator.presetGenerator.presets.aai; + +import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public class PresetAAIGetVpnsByType extends BaseAAIPreset { + + private String vpnType; + + public PresetAAIGetVpnsByType() { + this.vpnType = "SERVICE-INFRASTRUCTURE"; + } + + public PresetAAIGetVpnsByType(String vpnType) { + this.vpnType = vpnType; + } + + @Override + public Map<String, List> getQueryParams() { + return ImmutableMap.of("vpn-type", Collections.singletonList(vpnType)); + } + + @Override + public Object getResponseBody() { + return "{" + + " \"vpn-binding\": [" + + " {" + + " \"vpn-id\": \"120d39fb-3627-473d-913c-d228dd0f8e5b\"," + + " \"vpn-name\": \"LPPVPN\"," + + " \"vpn-platform\": \"AVPN\"," + + " \"vpn-type\": \"" + vpnType + "\"," + + " \"vpn-region\": \"USA,EMEA\"," + + " \"customer-vpn-id\": \"VPN1260\"," + + " \"resource-version\": \"1551904539767\"," + + " \"route-targets\" : [" + + " {" + + " \"global-route-target\":\"mock-global-1\"," + + " \"route-target-role\" : \"mock-role-x\"" + + " }," + + " {" + + " \"global-route-target\":\"mock-global-2\"," + + " \"route-target-role\" : \"mock-role-y\"" + + " }" + + " ],"+ + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"configuration\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v14/network/configurations/configuration/f1e81ceb-ce90-4d54-b181-e1ce8552250e\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"configuration.configuration-id\"," + + " \"relationship-value\": \"f1e81ceb-ce90-4d54-b181-e1ce8552250e\"" + + " }" + + " ]" + + " }," + + " {" + + " \"related-to\": \"customer\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v14/business/customers/customer/e433710f-9217-458d-a79d-1c7aff376d89\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"customer.global-customer-id\"," + + " \"relationship-value\": \"e433710f-9217-458d-a79d-1c7aff376d89\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"customer.subscriber-name\"," + + " \"property-value\": \"SILVIA ROBBINS\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }," + + " {" + + " \"vpn-id\": \"c70391f3-a6e3-4874-9834-cbe12d7bf8b6\"," + + " \"vpn-name\": \"LPPVPN\"," + + " \"vpn-platform\": \"AVPN\"," + + " \"vpn-type\": \"" + vpnType + "\"," + + " \"vpn-region\": \"USA,EMEA\"," + + " \"customer-vpn-id\": \"VPN1274\"," + + " \"resource-version\": \"1552507588857\"," + + " \"model-customization-id\" : \"cc3bff3f-cd4d-49bb-aac3-77e8e1168297\"," + + " \"model-invariant-id\" : \"e73127d5-c2de-43b2-bc02-602fa5c9aa29\"," + + " \"model-version-id\" : \"94209bf1-67fa-4741-96fe-a2b3f86f84b2\"," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"customer\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v14/business/customers/customer/e433710f-9217-458d-a79d-1c7aff376d89\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"customer.global-customer-id\"," + + " \"relationship-value\": \"e433710f-9217-458d-a79d-1c7aff376d89\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"customer.subscriber-name\"," + + " \"property-value\": \"SILVIA ROBBINS\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }," + + " {" + + " \"vpn-id\": \"4776516b-7da2-446c-9ba7-47ca8c30c571\"," + + " \"vpn-name\": \"LPPVPN\"," + + " \"vpn-platform\": \"AVPN\"," + + " \"vpn-type\": \"" + vpnType + "\"," + + " \"vpn-region\": \"USA,EMEA\"," + + " \"customer-vpn-id\": \"VPN1275\"," + + " \"resource-version\": \"1552591517864\"," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"customer\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v14/business/customers/customer/e433710f-9217-458d-a79d-1c7aff376d89\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"customer.global-customer-id\"," + + " \"relationship-value\": \"e433710f-9217-458d-a79d-1c7aff376d89\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"customer.subscriber-name\"," + + " \"property-value\": \"SILVIA ROBBINS\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }," + + " {" + + " \"vpn-id\": \"46fcb25a-e7ba-4d96-99ba-3bb6eae6aba7\"," + + " \"vpn-name\": \"LPPVPN\"," + + " \"vpn-platform\": \"AVPN\"," + + " \"vpn-type\": \"" + vpnType + "\"," + + " \"vpn-region\": \"USA,EMEA\"," + + " \"customer-vpn-id\": \"VPN1271\"," + + " \"resource-version\": \"1552331549256\"," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"customer\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v14/business/customers/customer/e433710f-9217-458d-a79d-1c7aff376d89\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"customer.global-customer-id\"," + + " \"relationship-value\": \"e433710f-9217-458d-a79d-1c7aff376d89\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"customer.subscriber-name\"," + + " \"property-value\": \"SILVIA ROBBINS\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }," + + " {" + + " \"vpn-id\": \"ffefbe38-3087-418a-87ae-f6582a15be78\"," + + " \"vpn-name\": \"LPPVPN\"," + + " \"vpn-platform\": \"AVPN\"," + + " \"vpn-type\": \"" + vpnType + "\"," + + " \"vpn-region\": \"USA,EMEA\"," + + " \"customer-vpn-id\": \"VPN1272\"," + + " \"resource-version\": \"1552469097776\"," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"customer\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v14/business/customers/customer/e433710f-9217-458d-a79d-1c7aff376d89\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"customer.global-customer-id\"," + + " \"relationship-value\": \"e433710f-9217-458d-a79d-1c7aff376d89\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"customer.subscriber-name\"," + + " \"property-value\": \"SILVIA ROBBINS\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }," + + " {" + + " \"vpn-id\": \"961d05be-ee41-40a2-8653-f603fc495175\"," + + " \"vpn-name\": \"LPPVPN\"," + + " \"vpn-platform\": \"AVPN\"," + + " \"vpn-type\": \"" + vpnType + "\"," + + " \"vpn-region\": \"USA,EMEA\"," + + " \"customer-vpn-id\": \"VPN1273\"," + + " \"resource-version\": \"1552481667950\"," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"customer\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v14/business/customers/customer/e433710f-9217-458d-a79d-1c7aff376d89\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"customer.global-customer-id\"," + + " \"relationship-value\": \"e433710f-9217-458d-a79d-1c7aff376d89\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"customer.subscriber-name\"," + + " \"property-value\": \"SILVIA ROBBINS\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }," + + " {" + + " \"vpn-id\": \"14bcfc2f-bbee-4fd9-89a5-42eb5dbb08d5\"," + + " \"vpn-name\": \"LPPVPN\"," + + " \"vpn-platform\": \"AVPN\"," + + " \"vpn-type\": \"" + vpnType + "\"," + + " \"vpn-region\": \"USA,EMEA\"," + + " \"customer-vpn-id\": \"913443\"," + + " \"resource-version\": \"1553182405707\"," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"customer\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v14/business/customers/customer/e433710f-9217-458d-a79d-1c7aff376d89\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"customer.global-customer-id\"," + + " \"relationship-value\": \"e433710f-9217-458d-a79d-1c7aff376d89\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"customer.subscriber-name\"," + + " \"property-value\": \"SILVIA ROBBINS\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }," + + " {" + + " \"vpn-id\": \"89d4c968-158c-4722-a22c-c5c2ccc17fd5\"," + + " \"vpn-name\": \"LPPVPN\"," + + " \"vpn-platform\": \"AVPN\"," + + " \"vpn-type\": \"" + vpnType + "\"," + + " \"vpn-region\": \"USA,EMEA\"," + + " \"customer-vpn-id\": \"VPN1276\"," + + " \"resource-version\": \"1553018006071\"," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"customer\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v14/business/customers/customer/e433710f-9217-458d-a79d-1c7aff376d89\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"customer.global-customer-id\"," + + " \"relationship-value\": \"e433710f-9217-458d-a79d-1c7aff376d89\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"customer.subscriber-name\"," + + " \"property-value\": \"SILVIA ROBBINS\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }," + + " {" + + " \"vpn-id\": \"3e7834fb-a8e0-4243-a837-5352ccab4602\"," + + " \"vpn-name\": \"LPPVPN\"," + + " \"vpn-platform\": \"AVPN\"," + + " \"vpn-type\": \"" + vpnType + "\"," + + " \"vpn-region\": \"USA,EMEA\"," + + " \"customer-vpn-id\": \"VPN1259\"," + + " \"resource-version\": \"1551967976427\"," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"customer\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v14/business/customers/customer/e433710f-9217-458d-a79d-1c7aff376d89\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"customer.global-customer-id\"," + + " \"relationship-value\": \"e433710f-9217-458d-a79d-1c7aff376d89\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"customer.subscriber-name\"," + + " \"property-value\": \"SILVIA ROBBINS\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }," + + " {" + + " \"vpn-id\": \"844a1ea7-556a-4e49-8aa3-171f1db4ea02\"," + + " \"vpn-name\": \"LPPVPN\"," + + " \"vpn-platform\": \"AVPN\"," + + " \"vpn-type\": \"" + vpnType + "\"," + + " \"vpn-region\": \"USA,EMEA\"," + + " \"customer-vpn-id\": \"VPN1277\"," + + " \"resource-version\": \"1553086769917\"," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"l3-network\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v15/network/l3-networks/l3-network/ac5224b1-71cc-4237-a401-c00b2fd65a78\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"l3-network.network-id\"," + + " \"relationship-value\": \"ac5224b1-71cc-4237-a401-c00b2fd65a78\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"l3-network.network-name\"," + + " \"property-value\": \"APP-C-24595-T-IST-04B_int_SUB-INTERFACE_net_051\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + "}"; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return getRootPath() + "/network/vpn-bindings"; + } + +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIModelsByInvariantIdGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIModelsByInvariantIdGet.java index 429d17647..d5a9bafb6 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIModelsByInvariantIdGet.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIModelsByInvariantIdGet.java @@ -118,6 +118,34 @@ public class PresetAAIModelsByInvariantIdGet extends BaseAAIPreset { " }" + " }," + " {" + + " \"model-version-id\": \"f028b2e2-7080-4b13-91b2-94944d4c42d8\"," + + " \"model-name\": \"Service with VRF\"," + + " \"model-version\": \"5.0\"," + + " \"model-description\": \"vEPDG\"," + + " \"resource-version\": \"1507472057702\"" + + " }," + + " {" + + " \"model-version-id\": \"9cac02be-2489-4374-888d-2863b4511a59\"," + + " \"model-name\": \"VRF Entry Configuration\"," + + " \"model-version\": \"5.0\"," + + " \"model-description\": \"vEPDG\"," + + " \"resource-version\": \"1507472057702\"" + + " }," + + " {" + + " \"model-version-id\": \"network-instance-model-version-id\"," + + " \"model-name\": \"Network Entry\"," + + " \"model-version\": \"6.0\"," + + " \"model-description\": \"vEPDG\"," + + " \"resource-version\": \"1507472057702\"" + + " }," + + " {" + + " \"model-version-id\": \"vpn-model-version-id\"," + + " \"model-name\": \"vf_vEPDG\"," + + " \"model-version\": \"6.0\"," + + " \"model-description\": \"vEPDG\"," + + " \"resource-version\": \"1507472057702\"" + + " }," + + " {" + " \"model-version-id\": \"eb5f56bf-5855-4e61-bd00-3e19a953bf02\"," + " \"model-name\": \"vf_vEPDG\"," + " \"model-version\": \"1.0\"," + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIModelsByInvariantIdGetForServiceWithCR.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIModelsByInvariantIdGetForServiceWithCR.java new file mode 100644 index 000000000..b2e7b18aa --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIModelsByInvariantIdGetForServiceWithCR.java @@ -0,0 +1,908 @@ +package org.onap.simulator.presetGenerator.presets.aai; + +import com.google.common.collect.ImmutableList; + +public class PresetAAIModelsByInvariantIdGetForServiceWithCR extends PresetAAIModelsByInvariantIdGet { + public PresetAAIModelsByInvariantIdGetForServiceWithCR(ImmutableList<String> modelInvariantIds) { + super(modelInvariantIds); + } + + @Override + public Object getResponseBody() { + return "{" + + " \"model\": [{" + + " \"model-invariant-id\": \"f6342be5-d66b-4d03-a1aa-c82c3094c4ea\"," + + " \"model-type\": \"service\"," + + " \"resource-version\": \"1534274421300\"," + + " \"model-vers\": {" + + " \"model-ver\": [{" + + " \"model-version-id\": \"a92f899d-a3ec-465b-baed-1663b0a5aee1\"," + + " \"model-name\": \"NCM_VLAN_SVC_ym161f\"," + + " \"model-version\": \"3.0\"," + + " \"distribution-status\": \"DISTRIBUTION_COMPLETE_OK\"," + + " \"model-description\": \"Network Collection service for vLAN tagging\"," + + " \"resource-version\": \"1534788756086\"," + + " \"model-elements\": {" + + " \"model-element\": [{" + + " \"model-element-uuid\": \"901e2641-c66c-4178-a6e8-cbe2877b0a2a\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1534463243387\"," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-ver\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/82194af1-3c2c-485a-8f44-420e22a9eaa4/model-vers/model-ver/46b92144-923a-4d20-b85a-3cbd847668a9\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"82194af1-3c2c-485a-8f44-420e22a9eaa4\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"46b92144-923a-4d20-b85a-3cbd847668a9\"" + + " }" + + " ]," + + " \"related-to-property\": [{" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"service-instance\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }" + + " }, {" + + " \"model-version-id\": \"d2fda667-e92e-4cfa-9620-5da5de01a319\"," + + " \"model-name\": \"NCM_VLAN_SVC_ym161f\"," + + " \"model-version\": \"1.0\"," + + " \"distribution-status\": \"DISTRIBUTION_COMPLETE_OK\"," + + " \"model-description\": \"Network Collection service for vLAN tagging\"," + + " \"resource-version\": \"1534444087221\"," + + " \"model-elements\": {" + + " \"model-element\": [{" + + " \"model-element-uuid\": \"d291ed5e-4f50-4f57-956d-ce0e67a059e5\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1534274421311\"," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-ver\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/82194af1-3c2c-485a-8f44-420e22a9eaa4/model-vers/model-ver/46b92144-923a-4d20-b85a-3cbd847668a9\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"82194af1-3c2c-485a-8f44-420e22a9eaa4\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"46b92144-923a-4d20-b85a-3cbd847668a9\"" + + " }" + + " ]," + + " \"related-to-property\": [{" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"service-instance\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }" + + " }, {" + + " \"model-version-id\": \"d4a447e5-9791-47b9-b365-1abb19b4b626\"," + + " \"model-name\": \"NCM_VLAN_SVC_ym161f\"," + + " \"model-version\": \"4.0\"," + + " \"model-description\": \"Network Collection service for vLAN tagging\"," + + " \"resource-version\": \"1534863624237\"," + + " \"model-elements\": {" + + " \"model-element\": [{" + + " \"model-element-uuid\": \"0ef29f1f-836a-4fab-986c-5f1b96310a3d\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1534863624242\"," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-ver\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/82194af1-3c2c-485a-8f44-420e22a9eaa4/model-vers/model-ver/46b92144-923a-4d20-b85a-3cbd847668a9\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"82194af1-3c2c-485a-8f44-420e22a9eaa4\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"46b92144-923a-4d20-b85a-3cbd847668a9\"" + + " }" + + " ]," + + " \"related-to-property\": [{" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"service-instance\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }" + + " }, {" + + " \"model-version-id\": \"0e97a118-b1b6-40d5-bbad-98cdd51b1c48\"," + + " \"model-name\": \"NCM_VLAN_SVC_ym161f\"," + + " \"model-version\": \"11.0\"," + + " \"distribution-status\": \"DISTRIBUTION_COMPLETE_OK\"," + + " \"model-description\": \"Network Collection service for vLAN tagging\"," + + " \"resource-version\": \"1550783120267\"," + + " \"model-elements\": {" + + " \"model-element\": [{" + + " \"model-element-uuid\": \"0ea8ac21-64b8-4489-9d62-12e625d66995\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1543961990189\"," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-ver\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/82194af1-3c2c-485a-8f44-420e22a9eaa4/model-vers/model-ver/46b92144-923a-4d20-b85a-3cbd847668a9\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"82194af1-3c2c-485a-8f44-420e22a9eaa4\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"46b92144-923a-4d20-b85a-3cbd847668a9\"" + + " }" + + " ]," + + " \"related-to-property\": [{" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"service-instance\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }" + + " }, {" + + " \"model-version-id\": \"46093d8f-6dfa-4332-9c00-7e822c681b59\"," + + " \"model-name\": \"NCM_VLAN_SVC_ym161f\"," + + " \"model-version\": \"7.0\"," + + " \"distribution-status\": \"DISTRIBUTION_COMPLETE_OK\"," + + " \"model-description\": \"Network Collection service for vLAN tagging\"," + + " \"resource-version\": \"1534885144462\"," + + " \"model-elements\": {" + + " \"model-element\": [{" + + " \"model-element-uuid\": \"d74a5dff-ef7f-4e32-9c13-d82fb2c617c9\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1534885014144\"," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-ver\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/82194af1-3c2c-485a-8f44-420e22a9eaa4/model-vers/model-ver/46b92144-923a-4d20-b85a-3cbd847668a9\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"82194af1-3c2c-485a-8f44-420e22a9eaa4\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"46b92144-923a-4d20-b85a-3cbd847668a9\"" + + " }" + + " ]," + + " \"related-to-property\": [{" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"service-instance\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }" + + " }, {" + + " \"model-version-id\": \"12930bcc-5276-42bb-8ed6-1e43d7acae2c\"," + + " \"model-name\": \"NCM_VLAN_SVC_ym161f\"," + + " \"model-version\": \"10.0\"," + + " \"distribution-status\": \"DISTRIBUTION_COMPLETE_OK\"," + + " \"model-description\": \"Network Collection service for vLAN tagging\"," + + " \"resource-version\": \"1539613511543\"," + + " \"model-elements\": {" + + " \"model-element\": [{" + + " \"model-element-uuid\": \"4d57798e-81b7-490e-bee8-48bd382a1349\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1539613450903\"," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-ver\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/82194af1-3c2c-485a-8f44-420e22a9eaa4/model-vers/model-ver/46b92144-923a-4d20-b85a-3cbd847668a9\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"82194af1-3c2c-485a-8f44-420e22a9eaa4\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"46b92144-923a-4d20-b85a-3cbd847668a9\"" + + " }" + + " ]," + + " \"related-to-property\": [{" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"service-instance\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }" + + " }, {" + + " \"model-version-id\": \"f8783bb2-6135-4c35-8320-64fa7deae76b\"," + + " \"model-name\": \"NCM_VLAN_SVC_ym161f\"," + + " \"model-version\": \"2.0\"," + + " \"distribution-status\": \"DISTRIBUTION_COMPLETE_OK\"," + + " \"model-description\": \"Network Collection service for vLAN tagging\"," + + " \"resource-version\": \"1534450229751\"," + + " \"model-elements\": {" + + " \"model-element\": [{" + + " \"model-element-uuid\": \"c666f1dd-99ff-442a-9ba2-1ee2dabb9e25\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1534450167963\"," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-ver\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/82194af1-3c2c-485a-8f44-420e22a9eaa4/model-vers/model-ver/46b92144-923a-4d20-b85a-3cbd847668a9\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"82194af1-3c2c-485a-8f44-420e22a9eaa4\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"46b92144-923a-4d20-b85a-3cbd847668a9\"" + + " }" + + " ]," + + " \"related-to-property\": [{" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"service-instance\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }" + + " }, {" + + " \"model-version-id\": \"0148e4c5-629b-4fef-9728-1e13fd630679\"," + + " \"model-name\": \"NCM_VLAN_SVC_ym161f\"," + + " \"model-version\": \"9.0\"," + + " \"distribution-status\": \"DISTRIBUTION_COMPLETE_OK\"," + + " \"model-description\": \"Network Collection service for vLAN tagging\"," + + " \"resource-version\": \"1537901614540\"," + + " \"model-elements\": {" + + " \"model-element\": [{" + + " \"model-element-uuid\": \"6ae6fd91-2086-470d-8c36-9d668c41fd32\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1537882880185\"," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-ver\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/82194af1-3c2c-485a-8f44-420e22a9eaa4/model-vers/model-ver/46b92144-923a-4d20-b85a-3cbd847668a9\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"82194af1-3c2c-485a-8f44-420e22a9eaa4\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"46b92144-923a-4d20-b85a-3cbd847668a9\"" + + " }" + + " ]," + + " \"related-to-property\": [{" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"service-instance\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }" + + " }, {" + + " \"model-version-id\": \"1ceab842-7ded-49f1-a129-dce2ecef8c71\"," + + " \"model-name\": \"NCM_VLAN_SVC_ym161f\"," + + " \"model-version\": \"6.0\"," + + " \"distribution-status\": \"DISTRIBUTION_COMPLETE_OK\"," + + " \"model-description\": \"Network Collection service for vLAN tagging\"," + + " \"resource-version\": \"1534883213652\"," + + " \"model-elements\": {" + + " \"model-element\": [{" + + " \"model-element-uuid\": \"5ca853fc-2984-45c7-b2e7-8514a56785ba\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1534883154090\"," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-ver\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/82194af1-3c2c-485a-8f44-420e22a9eaa4/model-vers/model-ver/46b92144-923a-4d20-b85a-3cbd847668a9\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"82194af1-3c2c-485a-8f44-420e22a9eaa4\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"46b92144-923a-4d20-b85a-3cbd847668a9\"" + + " }" + + " ]," + + " \"related-to-property\": [{" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"service-instance\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }" + + " }, {" + + " \"model-version-id\": \"fd21f6b5-02f6-4ac0-9515-e1f01112da95\"," + + " \"model-name\": \"NCM_VLAN_SVC_ym161f\"," + + " \"model-version\": \"5.0\"," + + " \"distribution-status\": \"DISTRIBUTION_COMPLETE_OK\"," + + " \"model-description\": \"Network Collection service for vLAN tagging\"," + + " \"resource-version\": \"1534872246413\"," + + " \"model-elements\": {" + + " \"model-element\": [{" + + " \"model-element-uuid\": \"0812b47d-7ef1-4a65-b6fb-9f3ff3bc3eee\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1534872174141\"," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-ver\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/82194af1-3c2c-485a-8f44-420e22a9eaa4/model-vers/model-ver/46b92144-923a-4d20-b85a-3cbd847668a9\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"82194af1-3c2c-485a-8f44-420e22a9eaa4\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"46b92144-923a-4d20-b85a-3cbd847668a9\"" + + " }" + + " ]," + + " \"related-to-property\": [{" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"service-instance\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }" + + " }, {" + + " \"model-version-id\": \"6e0bec91-09f3-43aa-9cf3-e617cd0146be\"," + + " \"model-name\": \"NCM_VLAN_SVC_ym161f\"," + + " \"model-version\": \"8.0\"," + + " \"distribution-status\": \"DISTRIBUTION_COMPLETE_OK\"," + + " \"model-description\": \"Network Collection service for vLAN tagging\"," + + " \"resource-version\": \"1536098608209\"," + + " \"model-elements\": {" + + " \"model-element\": [{" + + " \"model-element-uuid\": \"a0247d2e-3843-4753-be2f-4c252c99390e\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1536098548388\"," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-ver\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/82194af1-3c2c-485a-8f44-420e22a9eaa4/model-vers/model-ver/46b92144-923a-4d20-b85a-3cbd847668a9\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"82194af1-3c2c-485a-8f44-420e22a9eaa4\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"46b92144-923a-4d20-b85a-3cbd847668a9\"" + + " }" + + " ]," + + " \"related-to-property\": [{" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"service-instance\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }" + + " }, {" + + " \"model-invariant-id\": \"868b109c-9481-4a18-891b-af974db7705a\"," + + " \"model-type\": \"resource\"," + + " \"resource-version\": \"1534795610752\"," + + " \"model-vers\": {" + + " \"model-ver\": [{" + + " \"model-version-id\": \"dd182d7d-6949-4b90-b3cc-5befe400742e\"," + + " \"model-name\": \"ncm_vlan_ym161f..NetworkCollection..0\"," + + " \"model-version\": \"1\"," + + " \"distribution-status\": \"DISTRIBUTION_COMPLETE_OK\"," + + " \"resource-version\": \"1534795610763\"" + + " }, {" + + " \"model-version-id\": \"e5fc56b7-e14c-45e5-b127-978c36a921c0\"," + + " \"model-name\": \"ncm_vlan_ym161f..NetworkCollection..0\"," + + " \"model-version\": \"1\"," + + " \"resource-version\": \"1543961989136\"," + + " \"model-elements\": {" + + " \"model-element\": [{" + + " \"model-element-uuid\": \"9001ff96-1142-49c6-af5b-df4e2b23a305\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1543961989136\"," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-ver\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/3bf1e610-45f7-4ad6-b833-ca4c5ee6a3fd/model-vers/model-ver/8e6ee9dc-9017-444a-83b3-219edb018128\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"3bf1e610-45f7-4ad6-b833-ca4c5ee6a3fd\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"8e6ee9dc-9017-444a-83b3-219edb018128\"" + + " }" + + " ]," + + " \"related-to-property\": [{" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"instance-group\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-element\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/081ceb56-eb71-4566-a72d-3e7cbee5cdf1/model-vers/model-ver/a580855f-8d1b-40d5-a75b-50709fbd17d3/model-elements/model-element/06014449-69d3-4aef-a96b-0a5130ba9483/model-elements/model-element/a050dc96-2c35-45c7-ba23-9279215d501e\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"081ceb56-eb71-4566-a72d-3e7cbee5cdf1\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"a580855f-8d1b-40d5-a75b-50709fbd17d3\"" + + " }, {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"06014449-69d3-4aef-a96b-0a5130ba9483\"" + + " }, {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"a050dc96-2c35-45c7-ba23-9279215d501e\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }" + + " }, {" + + " \"model-invariant-id\": \"081ceb56-eb71-4566-a72d-3e7cbee5cdf1\"," + + " \"model-type\": \"resource\"," + + " \"resource-version\": \"1534788713816\"," + + " \"model-vers\": {" + + " \"model-ver\": [{" + + " \"model-version-id\": \"747d2a17-5771-4fd6-879d-c2e9e4c5cd4f\"," + + " \"model-name\": \"NCM_VLAN_ym161f\"," + + " \"model-version\": \"2.0\"," + + " \"model-description\": \"Network Collection Service VF for VLAN TAgging\"," + + " \"resource-version\": \"1534863623891\"," + + " \"model-elements\": {" + + " \"model-element\": [{" + + " \"model-element-uuid\": \"0dd28c63-cadf-48b2-afb0-a7bf7184ef5a\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1534863623895\"," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-ver\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/425b2158-e51d-4509-9945-dad4556474a3/model-vers/model-ver/2a160989-b202-47dd-874b-4a0f275998f7\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"425b2158-e51d-4509-9945-dad4556474a3\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"2a160989-b202-47dd-874b-4a0f275998f7\"" + + " }" + + " ]," + + " \"related-to-property\": [{" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"cloud-region\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-element\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/f6342be5-d66b-4d03-a1aa-c82c3094c4ea/model-vers/model-ver/d4a447e5-9791-47b9-b365-1abb19b4b626/model-elements/model-element/0ef29f1f-836a-4fab-986c-5f1b96310a3d/model-elements/model-element/700f890b-05c9-471a-b859-956655d28f47\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"f6342be5-d66b-4d03-a1aa-c82c3094c4ea\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"d4a447e5-9791-47b9-b365-1abb19b4b626\"" + + " }, {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"0ef29f1f-836a-4fab-986c-5f1b96310a3d\"" + + " }, {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"700f890b-05c9-471a-b859-956655d28f47\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }, {" + + " \"model-version-id\": \"a580855f-8d1b-40d5-a75b-50709fbd17d3\"," + + " \"model-name\": \"NCM_VLAN_ym161f\"," + + " \"model-version\": \"6.0\"," + + " \"model-description\": \"Network Collection Service VF for VLAN TAgging\"," + + " \"resource-version\": \"1543961989670\"," + + " \"model-elements\": {" + + " \"model-element\": [{" + + " \"model-element-uuid\": \"06014449-69d3-4aef-a96b-0a5130ba9483\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1543961989670\"," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-ver\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/8bac3599-9a1c-4b7f-80e5-c1838f744c23/model-vers/model-ver/3f908abc-3a15-40d0-b674-2a639e52884d\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"8bac3599-9a1c-4b7f-80e5-c1838f744c23\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"3f908abc-3a15-40d0-b674-2a639e52884d\"" + + " }" + + " ]," + + " \"related-to-property\": [{" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"collection\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-element\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/f6342be5-d66b-4d03-a1aa-c82c3094c4ea/model-vers/model-ver/0e97a118-b1b6-40d5-bbad-98cdd51b1c48/model-elements/model-element/0ea8ac21-64b8-4489-9d62-12e625d66995/model-elements/model-element/d614653c-5f19-4668-ad98-cfbe012308e1\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"f6342be5-d66b-4d03-a1aa-c82c3094c4ea\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"0e97a118-b1b6-40d5-bbad-98cdd51b1c48\"" + + " }, {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"0ea8ac21-64b8-4489-9d62-12e625d66995\"" + + " }, {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"d614653c-5f19-4668-ad98-cfbe012308e1\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }, {" + + " \"model-version-id\": \"b84e2233-37bf-4c8d-b613-eb8a8820b725\"," + + " \"model-name\": \"NCM_VLAN_ym161f\"," + + " \"model-version\": \"4.0\"," + + " \"model-description\": \"Network Collection Service VF for VLAN TAgging\"," + + " \"resource-version\": \"1534883153714\"," + + " \"model-elements\": {" + + " \"model-element\": [{" + + " \"model-element-uuid\": \"f7c3f5bb-777a-4d9f-9401-a652f5006152\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1534883153720\"," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-ver\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/425b2158-e51d-4509-9945-dad4556474a3/model-vers/model-ver/2a160989-b202-47dd-874b-4a0f275998f7\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"425b2158-e51d-4509-9945-dad4556474a3\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"2a160989-b202-47dd-874b-4a0f275998f7\"" + + " }" + + " ]," + + " \"related-to-property\": [{" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"cloud-region\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-element\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/f6342be5-d66b-4d03-a1aa-c82c3094c4ea/model-vers/model-ver/1ceab842-7ded-49f1-a129-dce2ecef8c71/model-elements/model-element/5ca853fc-2984-45c7-b2e7-8514a56785ba/model-elements/model-element/030553aa-8d82-4b03-a3dc-bc210daadd5e\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"f6342be5-d66b-4d03-a1aa-c82c3094c4ea\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"1ceab842-7ded-49f1-a129-dce2ecef8c71\"" + + " }, {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"5ca853fc-2984-45c7-b2e7-8514a56785ba\"" + + " }, {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"030553aa-8d82-4b03-a3dc-bc210daadd5e\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }, {" + + " \"model-version-id\": \"5ededaad-905c-4356-b30d-471b0ae2a12a\"," + + " \"model-name\": \"NCM_VLAN_ym161f\"," + + " \"model-version\": \"3.0\"," + + " \"model-description\": \"Network Collection Service VF for VLAN TAgging\"," + + " \"resource-version\": \"1534872173817\"," + + " \"model-elements\": {" + + " \"model-element\": [{" + + " \"model-element-uuid\": \"31f558c6-d73a-43e4-aab0-c863ccd6b110\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1534872173821\"," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-ver\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/425b2158-e51d-4509-9945-dad4556474a3/model-vers/model-ver/2a160989-b202-47dd-874b-4a0f275998f7\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"425b2158-e51d-4509-9945-dad4556474a3\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"2a160989-b202-47dd-874b-4a0f275998f7\"" + + " }" + + " ]," + + " \"related-to-property\": [{" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"cloud-region\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-element\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/f6342be5-d66b-4d03-a1aa-c82c3094c4ea/model-vers/model-ver/fd21f6b5-02f6-4ac0-9515-e1f01112da95/model-elements/model-element/0812b47d-7ef1-4a65-b6fb-9f3ff3bc3eee/model-elements/model-element/110a5ba4-997b-45f0-8e53-d64d6b342be1\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"f6342be5-d66b-4d03-a1aa-c82c3094c4ea\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"fd21f6b5-02f6-4ac0-9515-e1f01112da95\"" + + " }, {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"0812b47d-7ef1-4a65-b6fb-9f3ff3bc3eee\"" + + " }, {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"110a5ba4-997b-45f0-8e53-d64d6b342be1\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }, {" + + " \"model-version-id\": \"67b91dcd-4fa5-4111-80c9-60d524740667\"," + + " \"model-name\": \"NCM_VLAN_ym161f\"," + + " \"model-version\": \"1.0\"," + + " \"model-description\": \"Network Collection Service VF for VLAN TAgging\"," + + " \"resource-version\": \"1534788713822\"," + + " \"model-elements\": {" + + " \"model-element\": [{" + + " \"model-element-uuid\": \"6fdf228e-89ce-4cf6-9bd7-399aa1b690b3\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1534788713833\"," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-ver\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/425b2158-e51d-4509-9945-dad4556474a3/model-vers/model-ver/2a160989-b202-47dd-874b-4a0f275998f7\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"425b2158-e51d-4509-9945-dad4556474a3\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"2a160989-b202-47dd-874b-4a0f275998f7\"" + + " }" + + " ]," + + " \"related-to-property\": [{" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"cloud-region\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }" + + " }, {" + + " \"model-version-id\": \"ce8c98bc-4691-44fb-8ff0-7a47487c11c4\"," + + " \"model-name\": \"NCM_VLAN_ym161f\"," + + " \"model-version\": \"5.0\"," + + " \"model-description\": \"Network Collection Service VF for VLAN TAgging\"," + + " \"resource-version\": \"1534885013739\"," + + " \"model-elements\": {" + + " \"model-element\": [{" + + " \"model-element-uuid\": \"4bd10473-a9de-4399-abe7-c9b24e48e0ee\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1534885013745\"," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-ver\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/425b2158-e51d-4509-9945-dad4556474a3/model-vers/model-ver/2a160989-b202-47dd-874b-4a0f275998f7\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"425b2158-e51d-4509-9945-dad4556474a3\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"2a160989-b202-47dd-874b-4a0f275998f7\"" + + " }" + + " ]," + + " \"related-to-property\": [{" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"cloud-region\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"model-element\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/f6342be5-d66b-4d03-a1aa-c82c3094c4ea/model-vers/model-ver/12930bcc-5276-42bb-8ed6-1e43d7acae2c/model-elements/model-element/4d57798e-81b7-490e-bee8-48bd382a1349/model-elements/model-element/93eafb42-11b5-471d-8f8a-333408114a9a\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"f6342be5-d66b-4d03-a1aa-c82c3094c4ea\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"12930bcc-5276-42bb-8ed6-1e43d7acae2c\"" + + " }, {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"4d57798e-81b7-490e-bee8-48bd382a1349\"" + + " }, {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"93eafb42-11b5-471d-8f8a-333408114a9a\"" + + " }" + + " ]" + + " }, {" + + " \"related-to\": \"model-element\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/f6342be5-d66b-4d03-a1aa-c82c3094c4ea/model-vers/model-ver/6e0bec91-09f3-43aa-9cf3-e617cd0146be/model-elements/model-element/a0247d2e-3843-4753-be2f-4c252c99390e/model-elements/model-element/cb986adf-5ca8-48a5-ac9b-b222d6d2e280\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"f6342be5-d66b-4d03-a1aa-c82c3094c4ea\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"6e0bec91-09f3-43aa-9cf3-e617cd0146be\"" + + " }, {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"a0247d2e-3843-4753-be2f-4c252c99390e\"" + + " }, {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"cb986adf-5ca8-48a5-ac9b-b222d6d2e280\"" + + " }" + + " ]" + + " }, {" + + " \"related-to\": \"model-element\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/f6342be5-d66b-4d03-a1aa-c82c3094c4ea/model-vers/model-ver/0148e4c5-629b-4fef-9728-1e13fd630679/model-elements/model-element/6ae6fd91-2086-470d-8c36-9d668c41fd32/model-elements/model-element/a520808b-b8bc-4969-9eba-c85e2797f3dd\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"f6342be5-d66b-4d03-a1aa-c82c3094c4ea\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"0148e4c5-629b-4fef-9728-1e13fd630679\"" + + " }, {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"6ae6fd91-2086-470d-8c36-9d668c41fd32\"" + + " }, {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"a520808b-b8bc-4969-9eba-c85e2797f3dd\"" + + " }" + + " ]" + + " }, {" + + " \"related-to\": \"model-element\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/ca26a7e6-064d-4e90-a5b9-32ffe819f826/model-vers/model-ver/e9a290ca-41f0-4117-a1b5-8b7cd5595ff7/model-elements/model-element/ff3fdeb9-24e9-406f-8761-1334c9ea29d1/model-elements/model-element/bc6ddc86-f948-4f47-a4e6-bededd8d5780\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"ca26a7e6-064d-4e90-a5b9-32ffe819f826\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"e9a290ca-41f0-4117-a1b5-8b7cd5595ff7\"" + + " }, {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"ff3fdeb9-24e9-406f-8761-1334c9ea29d1\"" + + " }, {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"bc6ddc86-f948-4f47-a4e6-bededd8d5780\"" + + " }" + + " ]" + + " }, {" + + " \"related-to\": \"model-element\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.IsA\"," + + " \"related-link\": \"/aai/v14/service-design-and-creation/models/model/f6342be5-d66b-4d03-a1aa-c82c3094c4ea/model-vers/model-ver/46093d8f-6dfa-4332-9c00-7e822c681b59/model-elements/model-element/d74a5dff-ef7f-4e32-9c13-d82fb2c617c9/model-elements/model-element/f7bd32b4-bbbf-4788-9137-9dfa299e6111\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"f6342be5-d66b-4d03-a1aa-c82c3094c4ea\"" + + " }, {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"46093d8f-6dfa-4332-9c00-7e822c681b59\"" + + " }, {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"d74a5dff-ef7f-4e32-9c13-d82fb2c617c9\"" + + " }, {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"f7bd32b4-bbbf-4788-9137-9dfa299e6111\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + "}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIStandardQueryGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIStandardQueryGet.java index 13ee91e2b..642f941e8 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIStandardQueryGet.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIStandardQueryGet.java @@ -1,18 +1,23 @@ package org.onap.simulator.presetGenerator.presets.aai; -import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; -import static org.apache.commons.text.StringEscapeUtils.escapeJson; - import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.Multimap; -import java.util.UUID; -import java.util.stream.Collectors; import org.apache.commons.lang3.RandomStringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.text.StrSubstitutor; import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; import org.springframework.http.HttpMethod; +import java.util.UUID; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; +import static org.apache.commons.text.StringEscapeUtils.escapeJson; +import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.ATT_AIC; +import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.hvf6; + public class PresetAAIStandardQueryGet extends BaseAAIPreset { private final String instanceId; private final String instanceName; @@ -22,8 +27,9 @@ public class PresetAAIStandardQueryGet extends BaseAAIPreset { private final String uri; private final String typeInResponse; private final Multimap<String, String> relationshipsUris; + private Placement placement; - private PresetAAIStandardQueryGet(String typeInResponse, String instanceId, String instanceName, String instanceType, String instanceRole, String uri, Multimap<String, String> relationshipsUris, String additionalProperties) { + private PresetAAIStandardQueryGet(String typeInResponse, String instanceId, String instanceName, String instanceType, String instanceRole, String uri, Multimap<String, String> relationshipsUris, String additionalProperties, Placement placement) { this.instanceId = defaultIfNull(instanceId, randomUUID()); this.instanceName = defaultIfNull(instanceName, randomAlphanumeric()); this.instanceType = defaultIfNull(instanceType, randomAlphanumeric()); @@ -32,15 +38,23 @@ public class PresetAAIStandardQueryGet extends BaseAAIPreset { this.typeInResponse = typeInResponse; this.additionalProperties = additionalProperties; this.relationshipsUris = relationshipsUris; + this.placement = placement; } - private PresetAAIStandardQueryGet(String typeInResponse, String instanceId, String uri, Multimap<String, String> relationshipsUris, String additionalProperties) { - this(typeInResponse, instanceId, randomAlphanumeric(), randomAlphanumeric(), randomAlphanumeric(), uri, relationshipsUris, additionalProperties); + private PresetAAIStandardQueryGet(String typeInResponse, String instanceId, String uri, Multimap<String, String> relationshipsUris, String additionalProperties, Placement placement) { + this(typeInResponse, instanceId, randomAlphanumeric(), randomAlphanumeric(), randomAlphanumeric(), uri, relationshipsUris, additionalProperties, placement); } public static PresetAAIStandardQueryGet ofServiceInstance(String instanceId, final String modelVersionId, final String modelInvariantId, String subscriberId, String serviceType, Multimap<String, String> relationshipsUris) { + return ofServiceInstance(instanceId, "", "", modelVersionId, modelInvariantId, subscriberId, serviceType, "GARBAGE DATA", relationshipsUris); + } + + public static PresetAAIStandardQueryGet ofServiceInstance(String instanceId, String instanceType, String instanceRole, final String modelVersionId, final String modelInvariantId, String subscriberId, String serviceType, String orchStatus, Multimap<String, String> relationshipsUris) { return new PresetAAIStandardQueryGet( "service-instance", instanceId, + randomAlphanumeric(), + instanceType, + instanceRole, new StrSubstitutor(ImmutableMap.of( "global-customer-id", subscriberId, "service-type", serviceType, @@ -53,37 +67,44 @@ public class PresetAAIStandardQueryGet extends BaseAAIPreset { "\"model-invariant-id\": \"" + modelInvariantId + "\", " + "\"model-version-id\": \"" + modelVersionId + "\", " + "\"resource-version\": \"GARBAGE DATA\", " + - "\"orchestration-status\": \"GARBAGE DATA\", " + "\"orchestration-status\": \"" + orchStatus + "\", ", null ); } public static PresetAAIStandardQueryGet ofInstanceGroup(String groupType, String groupRole, Multimap<String, String> relationshipsUris) { + return ofInstanceGroup(groupType, groupRole, relationshipsUris, "4bb2e27e-ddab-4790-9c6d-1f731bc14a45", "daeb6568-cef8-417f-9075-ed259ce59f48"); + } + + public static PresetAAIStandardQueryGet ofInstanceGroup(String groupType, String groupRole, Multimap<String, String> relationshipsUris, String modelInvariantId, String modelVersionId) { final String instanceId = randomUUID(); return new PresetAAIStandardQueryGet( "instance-group", instanceId, randomAlphanumeric(), groupType, groupRole, "/network/instance-groups/instance-group/" + instanceId, relationshipsUris, "" + " \"id\": \"" + instanceId + "\"," + - " \"model-invariant-id\": \"4bb2e27e-ddab-4790-9c6d-1f731bc14a45\"," + - " \"model-version-id\": \"daeb6568-cef8-417f-9075-ed259ce59f48\"," + + addModelIds(modelInvariantId, modelVersionId) + " \"description\": \"vTSBC Customer Landing Network Collection Desc\"," + " \"resource-version\": \"1536169790853\"," + - " \"instance-group-function\": \"vTSBC Customer Landing Network Collection\"," + " \"instance-group-function\": \"vTSBC Customer Landing Network Collection\",", null ); } - public static PresetAAIStandardQueryGet ofVnf(String instanceId, Multimap<String, String> relationshipsUris) { - return ofVnf(instanceId, "vnf-instance-model-version-id", "vnf-instance-model-customization-id", "", relationshipsUris); + public static PresetAAIStandardQueryGet ofVnf(String instanceId, Multimap<String, String> relationshipsUris, Placement placement) { + return ofVnf(instanceId, "vnf-instance-model-version-id", "vnf-instance-model-customization-id", "", relationshipsUris, placement); + } + + public static Placement defaultPlacement() { + return new Placement(ATT_AIC, hvf6, "bae71557c5bb4d5aac6743a4e5f1d054"); } - public static PresetAAIStandardQueryGet ofVnf(String instanceId, String modelVersionId,String modelCustomizationId, String additionalProperties, Multimap<String, String> relationshipsUris) { + public static PresetAAIStandardQueryGet ofVnf(String instanceId, String modelVersionId, String modelCustomizationId, String additionalProperties, Multimap<String, String> relationshipsUris, Placement placement) { return new PresetAAIStandardQueryGet( "vnf", instanceId, "/network/generic-vnfs/generic-vnf/" + instanceId, relationshipsUris, additionalProperties + "\"model-invariant-id\": \"vnf-instance-model-invariant-id\", " + - "\"model-customization-id\": \"" + modelCustomizationId + "\", "+ - "\"model-version-id\": \"" + modelVersionId + "\", " + "\"model-customization-id\": \"" + modelCustomizationId + "\", " + + "\"model-version-id\": \"" + modelVersionId + "\", ", placement ); } @@ -93,7 +114,7 @@ public class PresetAAIStandardQueryGet extends BaseAAIPreset { "/network/generic-vnfs/generic-vnf/" + instanceId, relationshipsUris, additionalProperties + "\"model-invariant-id\": \"vnf-instance-model-invariant-id\", " + - "\"model-version-id\": \"" + modelVersionId + "\", " + "\"model-version-id\": \"" + modelVersionId + "\", ", null ); } @@ -109,7 +130,7 @@ public class PresetAAIStandardQueryGet extends BaseAAIPreset { return ofL3Network(randomUUID(), randomAlphanumeric(), instanceType, relationshipsUris, orchStatus, "prov", "network-instance-model-version-id", "network-instance-model-customization-id"); } - public static PresetAAIStandardQueryGet ofL3Network(String instanceType, String orchStatus, String provStatus, String modelVersionId, String modelCustomizationId,Multimap<String, String> relationshipsUris) { + public static PresetAAIStandardQueryGet ofL3Network(String instanceType, String orchStatus, String provStatus, String modelVersionId, String modelCustomizationId, Multimap<String, String> relationshipsUris) { return ofL3Network(randomUUID(), randomAlphanumeric(), instanceType, relationshipsUris, orchStatus, provStatus, modelVersionId, modelCustomizationId); } @@ -130,7 +151,7 @@ public class PresetAAIStandardQueryGet extends BaseAAIPreset { "\"is-external-network\": true, " + "\"model-invariant-id\": \"network-instance-model-invariant-id\", " + "\"model-customization-id\": \"" + modelCustomizationId + "\", " + - "\"model-version-id\": \"" + modelVersionId + "\", " + "\"model-version-id\": \"" + modelVersionId + "\", ", null ); } @@ -144,19 +165,59 @@ public class PresetAAIStandardQueryGet extends BaseAAIPreset { " \"orchestration-status\": \"Active\"," + " \"model-customization-id\": \"bc3bbdcc-42f3-4682-b151-99c308d15255\"," + " \"vf-module-model-customization-id\": \"bc3bbdcc-42f3-4682-b151-99c308d15255\"," + - " \"resource-version\": \"1533679899735\"," + " \"resource-version\": \"1533679899735\",", null ); } - public static PresetAAIStandardQueryGet ofCollectionResource(String orchStatus, Multimap<String, String> relationshipsUris) { + + public static PresetAAIStandardQueryGet ofCollectionResource(String orchStatus, Multimap<String, String> relationshipsUris, String modelInvariantId, String modelVersionId) { final String instanceId = randomUUID(); return new PresetAAIStandardQueryGet( "collection", instanceId, randomAlphanumeric(), "L3-NETWORK", randomAlphanumeric(), "/network/collections/collection/" + instanceId, relationshipsUris, "" + "\"orchestration-status\": \"" + orchStatus + "\", " + - "\"model-invariant-id\": \"081ceb56-eb71-4566-a72d-3e7cbee5cdf1\", " + - "\"model-version-id\": \"ce8c98bc-4691-44fb-8ff0-7a47487c11c4\", " + addModelIds(modelInvariantId, modelVersionId), null + ); + } + + private static String addModelIds(String modelInvariantId, String modelVersionId) { + return "\"model-invariant-id\": \"" + modelInvariantId + "\", " + + "\"model-version-id\": \"" + modelVersionId + "\", "; + } + + public static PresetAAIStandardQueryGet ofVrf(String orchStatus, Multimap<String, String> relationshipsUris) { + final String instanceId = randomUUID(); + return new PresetAAIStandardQueryGet( + "configuration", instanceId, randomAlphanumeric(), "COLLECTION", randomAlphanumeric(), + "/network/configurations/configuration/" + instanceId, + relationshipsUris, "" + + "\"orchestration-status\": \"" + orchStatus + "\", " + + "\"model-invariant-id\": \"b67a289b-1688-496d-86e8-1583c828be0a\", " + + "\"model-customization-id\": \"dd024d73-9bd1-425d-9db5-476338d53433\", " + + "\"model-version-id\": \"9cac02be-2489-4374-888d-2863b4511a59\", ", null + ); + } + + public static PresetAAIStandardQueryGet ofVpn(String orchStatus, Multimap<String, String> relationshipsUris, String globalRoutTarget, String routeTargetRole, String customerId, String region) { + final String instanceId = randomUUID(); + return new PresetAAIStandardQueryGet( + "vpn", instanceId, randomAlphanumeric(), "SERVICE-INFRASTRUCTURE", randomAlphanumeric(), + "/network/collections/collection/" + instanceId, + relationshipsUris, "" + + "\"orchestration-status\": \"" + orchStatus + "\", " + + "\"prov-status\": \"" + "prov" + "\"," + + "\"model-invariant-id\": \"vpn-model-invariant-id\", " + + "\"model-customization-id\": \"vpn-model-customization-id\", " + + "\"customer-vpn-id\": \"" + customerId + "\", " + + "\"vpn-region\": \"" + region + "\", " + + "\"route-targets\" : [" + + " {" + + " \"global-route-target\":\"" + globalRoutTarget + "\"," + + " \"route-target-role\" : \"" + routeTargetRole + "\"" + + " }" + + " ],"+ + "\"model-version-id\": \"vpn-model-version-id\", ", null ); } @@ -171,7 +232,7 @@ public class PresetAAIStandardQueryGet extends BaseAAIPreset { "\"vlan-id-outer\": " + vlanIdOuter + ", " + "\"resource-version\": \"1518934744675\", " + "\"in-maint\": false, " + - "\"is-ip-unnumbered\": false, " + "\"is-ip-unnumbered\": false, ", null ); } @@ -202,9 +263,10 @@ public class PresetAAIStandardQueryGet extends BaseAAIPreset { additionalProperties + " \"relationship-list\": { " + " \"relationship\": [ " + - relationshipsUris.entries().stream().map( - entry -> buildRelationship(entry.getKey(), entry.getValue()) - ).collect(Collectors.joining(",")) + + Stream.concat( + placement !=null ? Stream.of(buildPlacementRelationship()) : Stream.empty(), + relationshipsUris.entries().stream().map(entry -> buildRelationship(entry.getKey(), entry.getValue()) + )).collect(Collectors.joining(",")) + " ] " + " } " + "} "; @@ -225,6 +287,40 @@ public class PresetAAIStandardQueryGet extends BaseAAIPreset { "}"; } + private String buildPlacementRelationship() { + String relatedTo = StringUtils.equals(instanceType,"vf-module")? "vserver": "tenant"; + return "" + + " {" + + " \"related-to\": \"" + relatedTo + "\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/" + this.placement.lcpRegionId + "/tenants/tenant/" + this.placement.tenantId+ "/vservers/vserver/5eef9f6d-9933-4bc6-9a1a-862d61309437\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"cloud-region.cloud-owner\"," + + " \"relationship-value\": \""+ this.placement.cloudOwner+"\"" + + " }," + + " {" + + " \"relationship-key\": \"cloud-region.cloud-region-id\"," + + " \"relationship-value\": \"" + this.placement.lcpRegionId + "\"" + + " }," + + " {" + + " \"relationship-key\": \"tenant.tenant-id\"," + + " \"relationship-value\": \"" + this.placement.tenantId + "\"" + + " }," + + " {" + + " \"relationship-key\": \"vserver.vserver-id\"," + + " \"relationship-value\": \"5eef9f6d-9933-4bc6-9a1a-862d61309437\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"vserver.vserver-name\"," + + " \"property-value\": \"zolson5bfapn01dns002\"" + + " }" + + " ]" + + " }" ; + } + @Override public HttpMethod getReqMethod() { return HttpMethod.GET; @@ -234,6 +330,4 @@ public class PresetAAIStandardQueryGet extends BaseAAIPreset { public String getReqPath() { return getRootPath() + uri; } - - -} +}
\ No newline at end of file diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/ecompportal_att/PresetGetSessionSlotCheckIntervalGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/ecompportal_att/PresetGetSessionSlotCheckIntervalGet.java index 02ff1c159..e32ed8b34 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/ecompportal_att/PresetGetSessionSlotCheckIntervalGet.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/ecompportal_att/PresetGetSessionSlotCheckIntervalGet.java @@ -13,6 +13,6 @@ public class PresetGetSessionSlotCheckIntervalGet extends BaseEcompPortalPreset } public String getReqPath() { - return getRootPath() + "/v3/getSessionSlotCheckInterval"; + return getRootPath() + "/*v3/getSessionSlotCheckInterval"; } } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarte5G.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarte5G.java index 42b1578f4..0b7c6517f 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarte5G.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarte5G.java @@ -54,7 +54,7 @@ public class PresetMSOCreateNetworkALaCarte5G extends PresetMSOBaseCreateInstanc " \"platformName\": \"platform\"" + " }," + " \"lineOfBusiness\": {" + - " \"lineOfBusinessName\": \"ECOMP\"" + + " \"lineOfBusinessName\": \"ONAP\"" + " }," + " \"relatedInstanceList\": [{" + " \"relatedInstance\": {" + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteOldViewEdit.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteOldViewEdit.java index bccb07251..307aef2c0 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteOldViewEdit.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteOldViewEdit.java @@ -3,11 +3,13 @@ package org.onap.simulator.presetGenerator.presets.mso; public class PresetMSOCreateNetworkALaCarteOldViewEdit extends PresetMSOBaseCreateInstancePost { private final String networkInstanceName; private final String serviceInstanceId; + private final String platform; - public PresetMSOCreateNetworkALaCarteOldViewEdit(String overrideRequestId, String serviceInstanceId, String responseInstanceId, String networkInstanceName) { + public PresetMSOCreateNetworkALaCarteOldViewEdit(String overrideRequestId, String serviceInstanceId, String responseInstanceId, String networkInstanceName, String platform) { super(overrideRequestId, responseInstanceId); this.serviceInstanceId = serviceInstanceId; this.networkInstanceName = networkInstanceName; + this.platform = platform == null ? "" : platform; } @Override @@ -17,12 +19,12 @@ public class PresetMSOCreateNetworkALaCarteOldViewEdit extends PresetMSOBaseCrea @Override public Object getRequestBody() { - return "{\"requestDetails\": {" + + return "{\"requestDetails\": {" + " \"requestInfo\": {" + - " \"instanceName\": \""+networkInstanceName+"\"," + + " \"instanceName\": \"" + networkInstanceName + "\"," + " \"source\": \"VID\"," + " \"suppressRollback\": false," + - " \"requestorId\": \"mo57174000\"," + + " \"requestorId\": \"em1536000\"," + " \"productFamilyId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"" + " }," + " \"modelInfo\": {" + @@ -40,16 +42,14 @@ public class PresetMSOCreateNetworkALaCarteOldViewEdit extends PresetMSOBaseCrea " }," + " \"cloudConfiguration\": {" + " \"lcpCloudRegionId\": \"One\"," + - addCloudOwnerIfNeeded() + + addCloudOwnerIfNeeded() + " \"tenantId\": \"c630e297a3ae486497d63eacec1d7c14\"" + " }," + - " \"platform\": {" + - " \"platformName\": \"xxx1\"" + - " }," + + addPlatformIfNeeded(platform) + " \"relatedInstanceList\": [" + " {" + " \"relatedInstance\": {" + - " \"instanceId\": \""+serviceInstanceId+"\"," + + " \"instanceId\": \"" + serviceInstanceId + "\"," + " \"modelInfo\": {" + " \"modelType\": \"service\"," + " \"modelName\": \"Using VID for VoIP Network Instantiations Shani\"," + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceAlacarte5GServiceWithNetwork.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceAlacarte5GServiceWithNetwork.java index afd96a46f..40c18fa55 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceAlacarte5GServiceWithNetwork.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceAlacarte5GServiceWithNetwork.java @@ -1,9 +1,9 @@ package org.onap.simulator.presetGenerator.presets.mso; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.SERVICE_NAME; - import java.util.Map; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.SERVICE_NAME; + public class PresetMSOCreateServiceInstanceAlacarte5GServiceWithNetwork extends PresetMSOCreateServiceInstanceGen2WithNames { private final String requestorId; @@ -31,13 +31,13 @@ public class PresetMSOCreateServiceInstanceAlacarte5GServiceWithNetwork extends " }," + " \"owningEntity\": {" + " \"owningEntityId\": \"d61e6f2d-12fa-4cc2-91df-7c244011d6fc\"," + - " \"owningEntityName\": \"MetroPacketCore\"" + + " \"owningEntityName\": \"WayneHolland\"" + " }," + " \"subscriberInfo\": {" + " \"globalSubscriberId\": \"e433710f-9217-458d-a79d-1c7aff376d89\"" + " }," + " \"project\": {" + - " \"projectName\": \"DFW\"" + + " \"projectName\": \"WATKINS\"" + " }," + " \"requestInfo\": {" + " \"instanceName\": \""+names.get(SERVICE_NAME)+"\"," + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2.java index 3a7b09b43..0fd70b765 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2.java @@ -26,13 +26,13 @@ public class PresetMSOCreateServiceInstanceGen2 extends PresetMSOBaseCreateInsta " }, " + " \"owningEntity\": { " + " \"owningEntityId\": \"d61e6f2d-12fa-4cc2-91df-7c244011d6fc\", " + - " \"owningEntityName\": \"MetroPacketCore\" " + + " \"owningEntityName\": \"WayneHolland\" " + " }, " + " \"subscriberInfo\": { " + " \"globalSubscriberId\": \"e433710f-9217-458d-a79d-1c7aff376d89\" " + " }, " + " \"project\": { " + - " \"projectName\": \"DFW\" " + + " \"projectName\": \"WATKINS\" " + " }, " + " \"requestInfo\": { " + // " \"instanceName\": \"some instance name_0" + suffix + "\", " + @@ -73,7 +73,7 @@ public class PresetMSOCreateServiceInstanceGen2 extends PresetMSOBaseCreateInsta " \"platformName\": \"platform\" " + " }, " + " \"lineOfBusiness\": { " + - " \"lineOfBusinessName\": \"ECOMP\" " + + " \"lineOfBusinessName\": \"ONAP\" " + " }, " + " \"productFamilyId\": \"e433710f-9217-458d-a79d-1c7aff376d89\", " + " \"instanceParams\": [], " + @@ -82,7 +82,7 @@ public class PresetMSOCreateServiceInstanceGen2 extends PresetMSOBaseCreateInsta " \"modelInfo\": { " + " \"modelInvariantId\": \"7253ff5c-97f0-4b8b-937c-77aeb4d79aa1\", " + " \"modelVersionId\": \"25284168-24bb-4698-8cb4-3f509146eca5\", " + - " \"modelName\": \"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\", " + + " \"modelName\": \"2017488PasqualeVpe..PASQUALE_vRE_BV..module-1\", " + " \"modelType\": \"vfModule\", " + " \"modelVersion\": \"6\" " + " }, " + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2AlacarteService.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2AlacarteService.java index f76293f1d..f80f6bb57 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2AlacarteService.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2AlacarteService.java @@ -26,11 +26,11 @@ public class PresetMSOCreateServiceInstanceGen2AlacarteService extends PresetMSO " \"modelVersion\": \"1.0\" " + " }, " + " \"owningEntity\": { " + - " \"owningEntityName\": \"MetroPacketCore\", " + + " \"owningEntityName\": \"WayneHolland\", " + " \"owningEntityId\": \"d61e6f2d-12fa-4cc2-91df-7c244011d6fc\" " + " }, " + " \"project\": { " + - " \"projectName\": \"DFW\" " + + " \"projectName\": \"WATKINS\" " + " }, " + " \"subscriberInfo\": { " + " \"globalSubscriberId\": \"e433710f-9217-458d-a79d-1c7aff376d89\" " + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesAlacarteGroupingService.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesAlacarteGroupingService.java index 8f0b14115..28705ad89 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesAlacarteGroupingService.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesAlacarteGroupingService.java @@ -35,10 +35,10 @@ public class PresetMSOCreateServiceInstanceGen2WithNamesAlacarteGroupingService " }, " + " \"owningEntity\": { " + " \"owningEntityId\": \"d61e6f2d-12fa-4cc2-91df-7c244011d6fc\", " + - " \"owningEntityName\": \"MetroPacketCore\" " + + " \"owningEntityName\": \"WayneHolland\" " + " }, " + " \"project\": { " + - " \"projectName\": \"DFW\" " + + " \"projectName\": \"WATKINS\" " + " }, " + " \"subscriberInfo\": { " + " \"globalSubscriberId\": \"e433710f-9217-458d-a79d-1c7aff376d89\" " + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesAlacarteServiceCypress.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesAlacarteServiceCypress.java index a864b0d10..e4c14fc01 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesAlacarteServiceCypress.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesAlacarteServiceCypress.java @@ -28,11 +28,11 @@ public class PresetMSOCreateServiceInstanceGen2WithNamesAlacarteServiceCypress e " \"modelVersion\": \"1.0\" " + " }, " + " \"owningEntity\": { " + - " \"owningEntityName\": \"MetroPacketCore\", " + + " \"owningEntityName\": \"WayneHolland\", " + " \"owningEntityId\": \"d61e6f2d-12fa-4cc2-91df-7c244011d6fc\" " + " }, " + " \"project\": { " + - " \"projectName\": \"DFW\" " + + " \"projectName\": \"WATKINS\" " + " }, " + " \"subscriberInfo\": { " + " \"globalSubscriberId\": \"e433710f-9217-458d-a79d-1c7aff376d89\" " + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse.java index 2a8d7586e..d983a6152 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse.java @@ -1,14 +1,10 @@ package org.onap.simulator.presetGenerator.presets.mso; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.SERVICE_NAME; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.VFM_NAME1; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.VFM_NAME2; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.VG_NAME; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.VNF_NAME; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.VNF_NAME2; +import vid.automation.test.infra.Features; import java.util.Map; -import vid.automation.test.infra.Features; + +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.*; public class PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse extends PresetMSOCreateServiceInstanceGen2WithNames { @@ -60,10 +56,6 @@ public class PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse extends } protected String getVnfInstanceParams() { - if (!Features.FLAG_SHIFT_VFMODULE_PARAMS_TO_VNF.isActive()) { - return ""; - } - if (Features.FLAG_SUPPLEMENTARY_FILE.isActive()) { return INSTANCE_PARAMS_WITH_SUPP_FILE_VNF; } @@ -91,13 +83,13 @@ public class PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse extends " }, " + " \"owningEntity\": { " + " \"owningEntityId\": \"d61e6f2d-12fa-4cc2-91df-7c244011d6fc\", " + - " \"owningEntityName\": \"MetroPacketCore\" " + + " \"owningEntityName\": \"WayneHolland\" " + " }, " + " \"subscriberInfo\": { " + " \"globalSubscriberId\": \"e433710f-9217-458d-a79d-1c7aff376d89\" " + " }, " + " \"project\": { " + - " \"projectName\": \"DFW\" " + + " \"projectName\": \"WATKINS\" " + " }, " + " \"requestInfo\": { " + " \"instanceName\": \"" + names.get(SERVICE_NAME) + suffix + "\", " + @@ -118,7 +110,7 @@ public class PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse extends " \"modelType\": \"service\" " + " }, " + " \"instanceParams\": [{ " + - " \"2017488_PASQUALEvpe0_ASN\": \"AV_vPE\"" + + " \"2017488_pasqualevpe0_ASN\": \"AV_vPE\"" + " }" + " ], " + " \"resources\": { " + @@ -142,7 +134,7 @@ public class PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse extends " \"platformName\": \"platform\" " + " }, " + " \"lineOfBusiness\": { " + - " \"lineOfBusinessName\": \"ECOMP\" " + + " \"lineOfBusinessName\": \"ONAP\" " + " }, " + " \"productFamilyId\": \"e433710f-9217-458d-a79d-1c7aff376d89\", " + " \"instanceParams\": [" + INSTANCE_PARAMS_VNF + "] " + @@ -167,18 +159,18 @@ public class PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse extends " \"platformName\": \"platform\" " + " }, " + " \"lineOfBusiness\": { " + - " \"lineOfBusinessName\": \"ECOMP\" " + + " \"lineOfBusinessName\": \"ONAP\" " + " }, " + " \"productFamilyId\": \"e433710f-9217-458d-a79d-1c7aff376d89\", " + " \"instanceParams\": [" + getVnfInstanceParams() + "], " + " \"vfModules\": [{ " + " \"instanceName\": \"" + names.get(VFM_NAME1) + suffix + "\", " + " \"modelInfo\": { " + - " \"modelCustomizationName\": \"2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0\", " + + " \"modelCustomizationName\": \"2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0\", " + " \"modelCustomizationId\": \"a55961b2-2065-4ab0-a5b7-2fcee1c227e3\", " + " \"modelInvariantId\": \"b34833bb-6aa9-4ad6-a831-70b06367a091\", " + " \"modelVersionId\": \"f8360508-3f17-4414-a2ed-6bc71161e8db\", " + - " \"modelName\": \"2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0\", " + + " \"modelName\": \"2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0\", " + " \"modelType\": \"vfModule\", " + " \"modelVersion\": \"5\" " + " }, " + @@ -187,11 +179,11 @@ public class PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse extends " \"instanceName\": \"" + names.get(VFM_NAME2) + suffix + "\", " + " \"volumeGroupInstanceName\": \"" + names.get(VG_NAME) + suffix + "\", " + " \"modelInfo\": { " + - " \"modelCustomizationName\": \"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\", " + + " \"modelCustomizationName\": \"2017488PasqualeVpe..PASQUALE_vRE_BV..module-1\", " + " \"modelCustomizationId\": \"f7e7c365-60cf-49a9-9ebf-a1aa11b9d401\", " + " \"modelInvariantId\": \"7253ff5c-97f0-4b8b-937c-77aeb4d79aa1\", " + " \"modelVersionId\": \"25284168-24bb-4698-8cb4-3f509146eca5\", " + - " \"modelName\": \"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\", " + + " \"modelName\": \"2017488PasqualeVpe..PASQUALE_vRE_BV..module-1\", " + " \"modelType\": \"vfModule\", " + " \"modelVersion\": \"6\" " + " }, " + @@ -212,10 +204,6 @@ public class PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse extends } private String addDuplicatedVnfIfFeatureOn() { - if (!Features.FLAG_DUPLICATE_VNF.isActive()) { - return ""; - } - return " ,{ " + //start of vnf " \"instanceName\": \"" + names.get(VNF_NAME)+ "_001" + suffix + "\", " + @@ -237,18 +225,18 @@ public class PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse extends " \"platformName\": \"platform\" " + " }, " + " \"lineOfBusiness\": { " + - " \"lineOfBusinessName\": \"ECOMP\" " + + " \"lineOfBusinessName\": \"ONAP\" " + " }, " + " \"productFamilyId\": \"e433710f-9217-458d-a79d-1c7aff376d89\", " + " \"instanceParams\": [" + getVnfInstanceParams() + "], " + " \"vfModules\": [{ " + " \"instanceName\": \"" + names.get(VFM_NAME1) + "_001" + suffix + "\", " + " \"modelInfo\": { " + - " \"modelCustomizationName\": \"2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0\", " + + " \"modelCustomizationName\": \"2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0\", " + " \"modelCustomizationId\": \"a55961b2-2065-4ab0-a5b7-2fcee1c227e3\", " + " \"modelInvariantId\": \"b34833bb-6aa9-4ad6-a831-70b06367a091\", " + " \"modelVersionId\": \"f8360508-3f17-4414-a2ed-6bc71161e8db\", " + - " \"modelName\": \"2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0\", " + + " \"modelName\": \"2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0\", " + " \"modelType\": \"vfModule\", " + " \"modelVersion\": \"5\" " + " }, " + @@ -257,11 +245,11 @@ public class PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse extends " \"instanceName\": \"" + names.get(VFM_NAME2) + "_001" + suffix + "\", " + " \"volumeGroupInstanceName\": \"" + names.get(VG_NAME) + "_001" + suffix + "\", " + " \"modelInfo\": { " + - " \"modelCustomizationName\": \"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\", " + + " \"modelCustomizationName\": \"2017488PasqualeVpe..PASQUALE_vRE_BV..module-1\", " + " \"modelCustomizationId\": \"f7e7c365-60cf-49a9-9ebf-a1aa11b9d401\", " + " \"modelInvariantId\": \"7253ff5c-97f0-4b8b-937c-77aeb4d79aa1\", " + " \"modelVersionId\": \"25284168-24bb-4698-8cb4-3f509146eca5\", " + - " \"modelName\": \"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\", " + + " \"modelName\": \"2017488PasqualeVpe..PASQUALE_vRE_BV..module-1\", " + " \"modelType\": \"vfModule\", " + " \"modelVersion\": \"6\" " + " }, " + @@ -289,18 +277,18 @@ public class PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse extends " \"platformName\": \"platform\" " + " }, " + " \"lineOfBusiness\": { " + - " \"lineOfBusinessName\": \"ECOMP\" " + + " \"lineOfBusinessName\": \"ONAP\" " + " }, " + " \"productFamilyId\": \"e433710f-9217-458d-a79d-1c7aff376d89\", " + " \"instanceParams\": [" + getVnfInstanceParams() + "], " + " \"vfModules\": [{ " + " \"instanceName\": \"" + names.get(VFM_NAME1) + "_002" + suffix + "\", " + " \"modelInfo\": { " + - " \"modelCustomizationName\": \"2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0\", " + + " \"modelCustomizationName\": \"2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0\", " + " \"modelCustomizationId\": \"a55961b2-2065-4ab0-a5b7-2fcee1c227e3\", " + " \"modelInvariantId\": \"b34833bb-6aa9-4ad6-a831-70b06367a091\", " + " \"modelVersionId\": \"f8360508-3f17-4414-a2ed-6bc71161e8db\", " + - " \"modelName\": \"2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0\", " + + " \"modelName\": \"2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0\", " + " \"modelType\": \"vfModule\", " + " \"modelVersion\": \"5\" " + " }, " + @@ -309,11 +297,11 @@ public class PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse extends " \"instanceName\": \"" + names.get(VFM_NAME2) + "_002" + suffix + "\", " + " \"volumeGroupInstanceName\": \"" + names.get(VG_NAME) + "_002" + suffix + "\", " + " \"modelInfo\": { " + - " \"modelCustomizationName\": \"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\", " + + " \"modelCustomizationName\": \"2017488PasqualeVpe..PASQUALE_vRE_BV..module-1\", " + " \"modelCustomizationId\": \"f7e7c365-60cf-49a9-9ebf-a1aa11b9d401\", " + " \"modelInvariantId\": \"7253ff5c-97f0-4b8b-937c-77aeb4d79aa1\", " + " \"modelVersionId\": \"25284168-24bb-4698-8cb4-3f509146eca5\", " + - " \"modelName\": \"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\", " + + " \"modelName\": \"2017488PasqualeVpe..PASQUALE_vRE_BV..module-1\", " + " \"modelType\": \"vfModule\", " + " \"modelVersion\": \"6\" " + " }, " + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteCypress.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteCypress.java index dabc526c7..7b434d559 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteCypress.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteCypress.java @@ -1,6 +1,7 @@ package org.onap.simulator.presetGenerator.presets.mso; import com.google.common.collect.ImmutableMap; + import java.util.Map; public class PresetMSOCreateVfModuleALaCarteCypress extends PresetMSOBaseCreateInstancePost { @@ -16,20 +17,20 @@ public class PresetMSOCreateVfModuleALaCarteCypress extends PresetMSOBaseCreateI .put(Keys.instanceName, "mimazepubi") .put(Keys.modelInvariantId, "b34833bb-6aa9-4ad6-a831-70b06367a091") .put(Keys.modelVersionId, "f8360508-3f17-4414-a2ed-6bc71161e8db") - .put(Keys.modelName, "2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0") + .put(Keys.modelName, "2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0") .put(Keys.modelVersion, "5") .put(Keys.modelCustomizationId, "a55961b2-2065-4ab0-a5b7-2fcee1c227e3") - .put(Keys.modelCustomizationName, "2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0") + .put(Keys.modelCustomizationName, "2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0") .build(); public static final Map<Keys, String> module2Names = ImmutableMap.<Keys, String>builder() .put(Keys.instanceName, "bnmgtrx") .put(Keys.modelInvariantId, "eff8cc59-53a1-4101-aed7-8cf24ecf8339") .put(Keys.modelVersionId, "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a") - .put(Keys.modelName, "2017488PASQUALEVpe..PASQUALE_vPFE_BV..module-2") + .put(Keys.modelName, "2017488PasqualeVpe..PASQUALE_vPFE_BV..module-2") .put(Keys.modelVersion, "6") .put(Keys.modelCustomizationId, "3cd946bb-50e0-40d8-96d3-c9023520b557") - .put(Keys.modelCustomizationName, "2017488PASQUALEVpe..PASQUALE_vPFE_BV..module-2") + .put(Keys.modelCustomizationName, "2017488PasqualeVpe..PASQUALE_vPFE_BV..module-2") .build(); public PresetMSOCreateVfModuleALaCarteCypress(String overrideRequestId, String serviceInstanceId, String vnfInstanceId, Map<Keys, String> names, String testApi, boolean withTestApi) { diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleOldViewEdit.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleOldViewEdit.java index bf085cae5..61601eef2 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleOldViewEdit.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleOldViewEdit.java @@ -29,16 +29,16 @@ public class PresetMSOCreateVfModuleOldViewEdit extends PresetMSOBaseCreateInsta " \"instanceName\": \""+instanceName+"\"," + " \"source\": \"VID\"," + " \"suppressRollback\": false," + - " \"requestorId\": \"mo37915000\"" + + " \"requestorId\": \"em35993000\"" + " }," + " \"modelInfo\": {" + " \"modelType\": \"vfModule\"," + " \"modelInvariantId\": \"d9f9c851-9543-476e-b3c2-a2e5284a26aa\"," + " \"modelVersionId\": \"d205e01d-e5da-4e68-8c52-f95cb0607959\"," + - " \"modelName\": \"Vsp1710pid298109Vmmsc..mmsc_mod1_ltm..module-8\"," + + " \"modelName\": \"Vsp1710pid298109Vwinifred..mmsc_mod1_ltm..module-8\"," + " \"modelVersion\": \"1\"," + " \"modelCustomizationId\": \"e81b58ce-ae9b-4bde-9f81-9962a5007756\"," + - " \"modelCustomizationName\": \"Vsp1710pid298109Vmmsc..mmsc_mod1_ltm..module-8\"" + + " \"modelCustomizationName\": \"Vsp1710pid298109Vwinifred..mmsc_mod1_ltm..module-8\"" + " }," + " \"requestParameters\": {" + addTestApi() + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress.java index c8fb7fcf9..764237e18 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress.java @@ -44,10 +44,10 @@ public class PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress extends Prese " \"modelType\":\"" + select("volumeGroup", "vfModule") + "\"," + " \"modelInvariantId\":\"7253ff5c-97f0-4b8b-937c-77aeb4d79aa1\"," + " \"modelVersionId\":\"25284168-24bb-4698-8cb4-3f509146eca5\"," + - " \"modelName\":\"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\"," + + " \"modelName\":\"2017488PasqualeVpe..PASQUALE_vRE_BV..module-1\"," + " \"modelVersion\":\"6\"," + " \"modelCustomizationId\":\"f7e7c365-60cf-49a9-9ebf-a1aa11b9d401\"," + - " \"modelCustomizationName\":\"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\"" + + " \"modelCustomizationName\":\"2017488PasqualeVpe..PASQUALE_vRE_BV..module-1\"" + " }," + " \"cloudConfiguration\":{" + " \"lcpCloudRegionId\":\"my region\"," + @@ -97,11 +97,11 @@ public class PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress extends Prese " \"requestParameters\":{" + addTestApi()+ " \"userParams\":[{" + - " \"2017488_PASQUALEvpe0_vnf_instance_name\":\"mtnj309me6\"," + - " \"2017488_PASQUALEvpe0_vnf_config_template_version\":\"17.2\"," + - " \"PASQUALEvpe0_bandwidth\":\"10\"," + - " \"2017488_PASQUALEvpe0_AIC_CLLI\":\"ATLMY8GA\"," + - " \"PASQUALEvpe0_bandwidth_units\":\"Gbps\"" + + " \"2017488_pasqualevpe0_vnf_instance_name\":\"mtnj309me6\"," + + " \"2017488_pasqualevpe0_vnf_config_template_version\":\"17.2\"," + + " \"pasqualevpe0_bandwidth\":\"10\"," + + " \"2017488_pasqualevpe0_AIC_CLLI\":\"ATLMY8GA\"," + + " \"pasqualevpe0_bandwidth_units\":\"Gbps\"" + " }" + " ]," + " \"usePreload\":true" + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteOldViewEdit.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteOldViewEdit.java index 7947c5b83..d4eaa6dd5 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteOldViewEdit.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteOldViewEdit.java @@ -21,7 +21,7 @@ public class PresetMSOCreateVnfALaCarteOldViewEdit extends PresetMSOCreateVnfBas " \"instanceName\": \""+vnfInstanceName+"\"," + " \"source\": \"VID\"," + " \"suppressRollback\": false," + - " \"requestorId\": \"mo37915000\"," + + " \"requestorId\": \"em35993000\"," + " \"productFamilyId\": \"ebc3bc3d-62fd-4a3f-a037-f619df4ff034\"" + " }," + " \"modelInfo\": {" + @@ -42,7 +42,7 @@ public class PresetMSOCreateVnfALaCarteOldViewEdit extends PresetMSOCreateVnfBas addCloudOwnerIfNeeded() + " \"tenantId\": \"092eb9e8e4b7412e8787dd091bc58e86\"" + " }," + - selectLob("\"lineOfBusiness\": {\"lineOfBusinessName\": \"ECOMP\"},", "") + + selectLob("\"lineOfBusiness\": {\"lineOfBusinessName\": \"ONAP\"},", "") + " \"platform\": {" + " \"platformName\": \"platform\"" + " }," + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfVlanTagging.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfVlanTagging.java index 9fd0a678f..d5faa3f1c 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfVlanTagging.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfVlanTagging.java @@ -34,10 +34,10 @@ public class PresetMSOCreateVnfVlanTagging extends PresetMSOBaseCreateInstancePo " \"requestorId\": \"us16807000\"" + " }," + " \"lineOfBusiness\": {" + - " \"lineOfBusinessName\": \"ECOMP\"" + + " \"lineOfBusinessName\": \"ONAP\"" + " }," + " \"cloudConfiguration\": {" + - " \"lcpCloudRegionId\": \"JANET25\"," + + " \"lcpCloudRegionId\": \"AAIAIC25\"," + addCloudOwnerIfNeeded() + " \"tenantId\": \"092eb9e8e4b7412e8787dd091bc58e86\"" + " }," + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVolumeGroupOldViewEdit.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVolumeGroupOldViewEdit.java index ed5bee788..42e2a7097 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVolumeGroupOldViewEdit.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVolumeGroupOldViewEdit.java @@ -27,16 +27,16 @@ public class PresetMSOCreateVolumeGroupOldViewEdit extends PresetMSOBaseCreateIn " \"instanceName\": \""+instanceName+"\"," + " \"source\": \"VID\"," + " \"suppressRollback\": false," + - " \"requestorId\": \"mo37915000\"" + + " \"requestorId\": \"em35993000\"" + " }," + " \"modelInfo\": {" + " \"modelType\": \"volumeGroup\"," + " \"modelInvariantId\": \"6931e88a-fbcc-4ca9-8583-876b669c3106\"," + " \"modelVersionId\": \"13f022c4-651e-4326-b8e1-61e9a8c7a7ad\"," + - " \"modelName\": \"Vsp1710pid298109Vmmsc..mmsc_mod6_eca_oam..module-3\"," + + " \"modelName\": \"Vsp1710pid298109Vwinifred..mmsc_mod6_eca_oam..module-3\"," + " \"modelVersion\": \"1\"," + " \"modelCustomizationId\": \"020af091-cc66-46db-876c-02f14b4a795f\"," + - " \"modelCustomizationName\": \"Vsp1710pid298109Vmmsc..mmsc_mod6_eca_oam..module-3\"" + + " \"modelCustomizationName\": \"Vsp1710pid298109Vwinifred..mmsc_mod6_eca_oam..module-3\"" + " }," + " \"requestParameters\": {" + addTestApi() + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteBaseVfModuleCypress.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteBaseVfModuleCypress.java index fc9cc3c5c..2f8d218a6 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteBaseVfModuleCypress.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteBaseVfModuleCypress.java @@ -15,16 +15,16 @@ public class PresetMSODeleteBaseVfModuleCypress extends PresetMSODeleteVfModule return "{" + " \"requestDetails\":{" + " \"modelInfo\":{" + - " \"modelCustomizationName\":\"2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0\"," + + " \"modelCustomizationName\":\"2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0\"," + " \"modelCustomizationId\":\"a55961b2-2065-4ab0-a5b7-2fcee1c227e3\"," + " \"modelInvariantId\":\"b34833bb-6aa9-4ad6-a831-70b06367a091\"," + " \"modelVersionId\":\"f8360508-3f17-4414-a2ed-6bc71161e8db\"," + - " \"modelName\":\"2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0\"," + + " \"modelName\":\"2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0\"," + " \"modelType\":\"vfModule\"," + " \"modelVersion\":\"5\"" + " }," + " \"cloudConfiguration\":{" + - " \"lcpCloudRegionId\":\"JANET25\"," + + " \"lcpCloudRegionId\":\"AAIAIC25\"," + addCloudOwnerIfNeeded() + " \"tenantId\":\"092eb9e8e4b7412e8787dd091bc58e86\"," + " }," + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteInstanceGroup.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteInstanceGroup.java index 9174cd2bb..bf18ab31b 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteInstanceGroup.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteInstanceGroup.java @@ -22,7 +22,6 @@ public class PresetMSODeleteInstanceGroup extends PresetMSOBaseDelete { Map<String, String> map = super.getRequestHeaders(); map.put("X-RequestorID", userId); return map; - } } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteMacroService.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteMacroService.java new file mode 100644 index 000000000..10f1c04aa --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteMacroService.java @@ -0,0 +1,33 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSODeleteMacroService extends PresetMSODeleteService { + + public PresetMSODeleteMacroService(String requestId, String serviceInstanceId) + { + super(requestId, serviceInstanceId); + } + + @Override + public Object getRequestBody() + { + return "{ " + + " \"requestDetails\":{ " + + " \"modelInfo\":{ " + + " \"modelInvariantId\":\"dfc2c44c-2429-44ca-ae26-1e6dc1f207fb\"," + + " \"modelVersionId\":\"f028b2e2-7080-4b13-91b2-94944d4c42d8\"," + + " \"modelName\":\"Service with VRF\"," + + " \"modelType\":\"service\"," + + " \"modelVersion\":\"5.0\"" + + " }," + + " \"requestInfo\":{ " + + " \"source\":\"VID\"," + + " \"requestorId\":\"us16807000\"" + + " }," + + " \"requestParameters\":{ " + + " \"aLaCarte\":false" + + " }" + + " }" + + "}"; + + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteService.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteService.java index b407b167a..c7b4fa899 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteService.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteService.java @@ -1,7 +1,5 @@ package org.onap.simulator.presetGenerator.presets.mso; -import vid.automation.test.infra.Features; - public class PresetMSODeleteService extends PresetMSOBaseDelete { private final String serviceInstanceId; public static final String DEFAULT_SERVICE_INSTANCE_ID = "3f93c7cb-2fd0-4557-9514-e189b7b04f9d"; @@ -22,9 +20,7 @@ public class PresetMSODeleteService extends PresetMSOBaseDelete { @Override protected String getRootPath() { - return Features.FLAG_UNASSIGN_SERVICE.isActive() ? - "/mso/serviceInstantiation/v./serviceInstances/" : - "/mso/serviceInstances/v./"; + return "/mso/serviceInstantiation/v./serviceInstances/" ; } } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVfModuleCypress.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVfModuleCypress.java index d4a21cc36..c3ea07f2b 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVfModuleCypress.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVfModuleCypress.java @@ -15,16 +15,16 @@ public class PresetMSODeleteVfModuleCypress extends PresetMSODeleteVfModule { return "{" + " \"requestDetails\":{" + " \"modelInfo\":{" + - " \"modelCustomizationName\":\"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\"," + + " \"modelCustomizationName\":\"2017488PasqualeVpe..PASQUALE_vRE_BV..module-1\"," + " \"modelCustomizationId\":\"f7e7c365-60cf-49a9-9ebf-a1aa11b9d401\"," + " \"modelInvariantId\":\"7253ff5c-97f0-4b8b-937c-77aeb4d79aa1\"," + " \"modelVersionId\":\"25284168-24bb-4698-8cb4-3f509146eca5\"," + - " \"modelName\":\"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\"," + + " \"modelName\":\"2017488PasqualeVpe..PASQUALE_vRE_BV..module-1\"," + " \"modelType\":\"vfModule\"," + " \"modelVersion\":\"6\"" + " }," + " \"cloudConfiguration\":{" + - " \"lcpCloudRegionId\":\"JANET25\"," + + " \"lcpCloudRegionId\":\"AAIAIC25\"," + addCloudOwnerIfNeeded() + " \"tenantId\":\"092eb9e8e4b7412e8787dd091bc58e86\"," + " }," + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestGet.java index 381ac856b..602e32df4 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestGet.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestGet.java @@ -1,16 +1,23 @@ package org.onap.simulator.presetGenerator.presets.mso; +import com.google.common.collect.ImmutableMap; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; import org.springframework.http.HttpMethod; +import vid.automation.test.infra.Features; import java.time.Instant; import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import static java.util.Collections.singletonList; /** * Created by itzikliderman on 13/12/2017. @@ -26,6 +33,7 @@ public class PresetMSOOrchestrationRequestGet extends BaseMSOPreset { private String statusMessage; private String requestState; private int startedHoursAgo = 1; + private boolean isDetailed = true; public PresetMSOOrchestrationRequestGet() { @@ -38,6 +46,16 @@ public class PresetMSOOrchestrationRequestGet extends BaseMSOPreset { this.requestId = DEFAULT_REQUEST_ID; } + /** + * @param requestState + * @param isDetailed - is expect to query param format=detail. Angular1 flows dont' expect it + */ + public PresetMSOOrchestrationRequestGet(String requestState, boolean isDetailed) { + this.requestState = requestState; + this.requestId = DEFAULT_REQUEST_ID; + this.isDetailed = isDetailed; + } + public PresetMSOOrchestrationRequestGet(String requestState, String overrideRequestId) { this.requestState = requestState; this.requestId = overrideRequestId; @@ -49,6 +67,16 @@ public class PresetMSOOrchestrationRequestGet extends BaseMSOPreset { this.statusMessage = statusMessage; } + /** + * @param isDetailed - is expect to query param format=detail. Angular1 flows dont' expect it + */ + public PresetMSOOrchestrationRequestGet(String requestState, String overrideRequestId, String statusMessage, boolean isDetailed) { + this.requestState = requestState; + this.requestId = overrideRequestId; + this.statusMessage = statusMessage; + this.isDetailed = isDetailed; + } + public PresetMSOOrchestrationRequestGet(String requestState, String overrideRequestId, String statusMessage, int startedHoursAgo) { this.requestState = requestState; this.requestId = overrideRequestId; @@ -72,6 +100,13 @@ public class PresetMSOOrchestrationRequestGet extends BaseMSOPreset { } @Override + public Map<String, List> getQueryParams() { + return (isDetailed && Features.FLAG_1908_RESUME_MACRO_SERVICE.isActive()) ? + ImmutableMap.of("format", singletonList("detail")) : + Collections.emptyMap(); + } + + @Override public Object getResponseBody() { String body = "{" + " \"request\": {" + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork.java index 3d83ca55d..1d3b8c00a 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork.java @@ -1,13 +1,14 @@ package org.onap.simulator.presetGenerator.presets.mso; -import static java.util.Collections.singletonList; - import com.google.common.collect.ImmutableMap; -import java.util.List; -import java.util.Map; import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; import org.springframework.http.HttpMethod; +import java.util.List; +import java.util.Map; + +import static java.util.Collections.singletonList; + public class PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork extends BaseMSOPreset { public PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork(ResponseDetails parentDetails, ResponseDetails childDetails, String parentInstanceId) { @@ -84,7 +85,7 @@ public class PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork extend " \"testApi\": \"VNF_API\"" + " }," + " \"project\": {" + - " \"projectName\": \"DFW\"" + + " \"projectName\": \"WATKINS\"" + " }," + " \"owningEntity\": {" + " \"owningEntityId\": \"3f592a6f-459b-435e-b0d4-59959ab1d385\"," + @@ -155,7 +156,7 @@ public class PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork extend " \"platformName\": \"plat1\"" + " }," + " \"lineOfBusiness\": {" + - " \"lineOfBusinessName\": \"ECOMP\"" + + " \"lineOfBusinessName\": \"ONAP\"" + " }" + " }," + " \"instanceReferences\": {" + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetByRequestId.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetByRequestId.java index 69780d0aa..8524d92cd 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetByRequestId.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetByRequestId.java @@ -1,13 +1,14 @@ package org.onap.simulator.presetGenerator.presets.mso; -import static java.util.Collections.singletonList; - import com.google.common.collect.ImmutableMap; -import java.util.List; -import java.util.Map; import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; import org.springframework.http.HttpMethod; +import java.util.List; +import java.util.Map; + +import static java.util.Collections.singletonList; + public class PresetMSOOrchestrationRequestsGetByRequestId extends BaseMSOPreset { @Override diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetByServiceInstanceId.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetByServiceInstanceId.java index 58686f26b..921776569 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetByServiceInstanceId.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetByServiceInstanceId.java @@ -1,15 +1,26 @@ package org.onap.simulator.presetGenerator.presets.mso; -import static java.util.Collections.singletonList; - import com.google.common.collect.ImmutableMap; -import java.util.List; -import java.util.Map; import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; import org.springframework.http.HttpMethod; +import java.util.List; +import java.util.Map; + +import static java.util.Collections.singletonList; + public class PresetMSOOrchestrationRequestsGetByServiceInstanceId extends BaseMSOPreset { + private final String instanceId; + + public PresetMSOOrchestrationRequestsGetByServiceInstanceId() { + this.instanceId = "bc305d54-75b4-431b-adb2-eb6b9e546014"; + } + + public PresetMSOOrchestrationRequestsGetByServiceInstanceId(String instanceId) { + this.instanceId = instanceId; + } + @Override public HttpMethod getReqMethod() { return HttpMethod.GET; @@ -22,7 +33,7 @@ public class PresetMSOOrchestrationRequestsGetByServiceInstanceId extends BaseMS @Override public Map<String, List> getQueryParams() { - return ImmutableMap.of("filter", singletonList("serviceInstanceId:EQUALS:bc305d54-75b4-431b-adb2-eb6b9e546014")); + return ImmutableMap.of("filter", singletonList("serviceInstanceId:EQUALS:" + instanceId)); } @Override diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOResumeRequest.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOResumeRequest.java new file mode 100644 index 000000000..ca13f6ad7 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOResumeRequest.java @@ -0,0 +1,48 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; +import org.springframework.http.HttpMethod; + +import java.util.Map; + +public class PresetMSOResumeRequest extends BaseMSOPreset { + + private final String originalRequestId; + private final String requestId; + private final String instanceId; + private final String userId; + + public PresetMSOResumeRequest(String originalRequestId, String requestId, String instanceId, String userId) { + this.originalRequestId = originalRequestId; + this.requestId = requestId; + this.instanceId = instanceId; + this.userId = userId; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.POST; + } + + @Override + public String getReqPath() { + return super.getRootPath() + "/orchestrationRequests/v./" + originalRequestId + "/resume"; + } + + @Override + public int getResponseCode() { + return 202; + } + + @Override + public Object getResponseBody() { + return "{\"requestReferences\":{\"instanceId\":\"" + instanceId + "\",\"requestId\":\"" + requestId + "\"}}"; + } + + @Override + public Map<String, String> getRequestHeaders() { + Map<String, String> map = super.getRequestHeaders(); + map.put("X-RequestorID", userId); + return map; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOServiceInstanceGen2WithNames.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOServiceInstanceGen2WithNames.java index b851da2d2..793037dbf 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOServiceInstanceGen2WithNames.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOServiceInstanceGen2WithNames.java @@ -1,13 +1,8 @@ package org.onap.simulator.presetGenerator.presets.mso; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.SERVICE_NAME; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.VFM_NAME1; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.VFM_NAME2; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.VG_NAME; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.VNF_NAME; - import java.util.Map; -import vid.automation.test.infra.Features; + +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.*; public abstract class PresetMSOServiceInstanceGen2WithNames extends PresetMSOBaseCreateInstancePost { @@ -42,9 +37,6 @@ public abstract class PresetMSOServiceInstanceGen2WithNames extends PresetMSOBas } protected String getVnfInstanceParams() { - if (!Features.FLAG_SHIFT_VFMODULE_PARAMS_TO_VNF.isActive()) { - return ""; - } return " {" + " \"vmx_int_net_len\": \"24\"," + " \"vre_a_volume_size_0\": \"100\"," + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMsoCreateMacroCommonPre1806.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMsoCreateMacroCommonPre1806.java new file mode 100644 index 000000000..8a1e37f45 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMsoCreateMacroCommonPre1806.java @@ -0,0 +1,151 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import org.apache.commons.lang3.StringUtils; + +public class PresetMsoCreateMacroCommonPre1806 extends PresetMSOBaseCreateInstancePost { + + private String modelInfo; + private String cloudConfiguration; + private String relatedInstanceList; + private String instanceName; + + private PresetMsoCreateMacroCommonPre1806(String requestId, String responseInstanceId, String instanceName, String modelInfo, String relatedInstanceList, String cloudConfiguration) { + super(requestId, responseInstanceId); + this.modelInfo = modelInfo; + this.cloudConfiguration = cloudConfiguration; + this.relatedInstanceList = relatedInstanceList; + this.instanceName = instanceName; + } + + public static PresetMsoCreateMacroCommonPre1806 ofTransportService(String requestId, String responseInstanceId) { + return new PresetMsoCreateMacroCommonPre1806(requestId, responseInstanceId, "", transportServiceModelInfo(), "", ""); + } + + public static PresetMsoCreateMacroCommonPre1806 ofCollectionResource(String requestId, String responseInstanceId) { + return new PresetMsoCreateMacroCommonPre1806( + requestId, + responseInstanceId, + "", + collectionResourceModelInfo(), + "", + hvf6CloudConfiguration()); + } + + public static PresetMsoCreateMacroCommonPre1806 ofServiceWithVRF(String requestId, String responseInstanceId, String instanceName) { + return new PresetMsoCreateMacroCommonPre1806( + requestId, + responseInstanceId, + instanceName, + "" + + " \"modelInfo\": { " + + " \"modelInvariantId\": \"dfc2c44c-2429-44ca-ae26-1e6dc1f207fb\", " + + " \"modelVersionId\": \"f028b2e2-7080-4b13-91b2-94944d4c42d8\", " + + " \"modelName\": \"infraVPN\", " + + " \"modelType\": \"service\", " + + " \"modelVersion\": \"1.0\" " + + " }, ", + "" + + ", " + + " \"relatedInstanceList\": [{ " + + " \"relatedInstance\": { " + + " \"modelInfo\": { " + + " \"modelType\": \"vpnBinding\" " + + " }, " + + " \"instanceId\": \"120d39fb-3627-473d-913c-d228dd0f8e5b\", " + + " \"instanceName\": \"LPPVPN\" " + + " } " + + " }, { " + + " \"relatedInstance\": { " + + " \"modelInfo\": { " + + " \"modelCustomizationId\": \"10a74149-c9d7-4918-bbcf-d5fb9b1799ce\", " + + " \"modelInvariantId\": \"3b3308d4-0cd3-43e4-9a7b-d1925c861135\", " + + " \"modelVersionId\": \"77010093-df36-4dcb-8428-c3d02bf3f88d\", " + + " \"modelType\": \"network\" " + + " }, " + + " \"instanceId\": \"10a74149-c9d7-4918-bbcf-d5fb9b1799ce\", " + + " \"instanceName\": \"AUK51a_oam_calea_net_2\" " + + " } " + + " } " + + " ] ", + hvf6CloudConfiguration()); + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./serviceInstances"; + } + + @Override + public boolean isStrictMatch() { + return true; + } + + @Override + public Object getRequestBody() { + return "{" + + " \"requestDetails\": {" + + modelInfo + + " \"owningEntity\": {" + + " \"owningEntityId\": \"d61e6f2d-12fa-4cc2-91df-7c244011d6fc\"," + + " \"owningEntityName\": \"WayneHolland\"" + + " }," + + " \"subscriberInfo\": {" + + " \"globalSubscriberId\": \"e433710f-9217-458d-a79d-1c7aff376d89\"," + + " \"subscriberName\": \"SILVIA ROBBINS\"" + + " }," + + " \"project\": {" + + " \"projectName\": \"WATKINS\"" + + " }," + + " \"requestParameters\": {" + + " \"subscriptionServiceType\": \"TYLER SILVIA\"," + + " \"aLaCarte\": false," + + " \"userParams\": []" + + " }," + + " \"requestInfo\": {" + + (StringUtils.isEmpty(instanceName) ? "" : "\"instanceName\": \"" + instanceName + "\",") + + " \"productFamilyId\": \"e433710f-9217-458d-a79d-1c7aff376d89\"," + + " \"source\": \"VID\"," + + " \"suppressRollback\": false," + + " \"requestorId\": \"us16807000\"" + + " }" + + relatedInstanceList + + cloudConfiguration + + " }" + + "}"; + } + + private String addModelInfo() { + return modelInfo; + } + + private static String transportServiceModelInfo() { + return " \"modelInfo\": {" + + " \"modelInvariantId\": \"561faa57-7bbb-40ec-a81c-c0d4133e98d4\"," + + " \"modelVersionId\": \"12550cd7-7708-4f53-a09e-41d3d6327ebc\"," + + " \"modelName\": \"AIM Transport SVC_ym161f\"," + + " \"modelType\": \"service\"," + + " \"modelVersion\": \"1.0\"" + + " },"; + } + + private static String hvf6CloudConfiguration() { + return + ","+ + "\"cloudConfiguration\": {" + + " \"lcpCloudRegionId\": \"hvf6\"," + + " \"tenantId\": \"bae71557c5bb4d5aac6743a4e5f1d054\"," + + " \"cloudOwner\": \"irma-aic\"" + + " }"; + } + + private static String collectionResourceModelInfo() { + return + "\"modelInfo\": {" + + " \"modelInvariantId\": \"04bdd793-32ed-4045-adea-4e096304a067\"," + + " \"modelVersionId\": \"abd0cb02-5f97-42cd-be93-7dd3e31a6a64\"," + + " \"modelName\": \"CR_sanity\"," + + " \"modelType\": \"service\"," + + " \"modelVersion\": \"1.0\"" + + " },"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/configuration/PresetMSOCreateConfiguration.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/configuration/PresetMSOCreateConfiguration.java index bba0f20d8..2a7e262a4 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/configuration/PresetMSOCreateConfiguration.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/configuration/PresetMSOCreateConfiguration.java @@ -63,7 +63,7 @@ public class PresetMSOCreateConfiguration extends PresetMSOBaseCreateInstancePos " }," + " \"cloudConfiguration\": {" + addCloudOwnerIfNeeded() + - " \"lcpCloudRegionId\": \"JANET25\"" + + " \"lcpCloudRegionId\": \"AAIAIC25\"" + " }," + " \"requestInfo\": {" + " \"instanceName\": \"dummy_instance\"," + diff --git a/vid-automation/src/main/java/org/onap/vid/api/AsyncInstantiationBase.java b/vid-automation/src/main/java/org/onap/vid/api/AsyncInstantiationBase.java index 2a6b012fe..66bde727e 100644 --- a/vid-automation/src/main/java/org/onap/vid/api/AsyncInstantiationBase.java +++ b/vid-automation/src/main/java/org/onap/vid/api/AsyncInstantiationBase.java @@ -1,34 +1,8 @@ package org.onap.vid.api; -import static java.lang.Boolean.FALSE; -import static java.lang.Boolean.TRUE; -import static java.util.Collections.emptyList; -import static java.util.stream.Collectors.joining; -import static java.util.stream.Collectors.toMap; -import static org.hamcrest.CoreMatchers.hasItem; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.containsInAnyOrder; -import static org.hamcrest.Matchers.hasSize; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys; -import static org.testng.Assert.assertNotNull; -import static org.testng.AssertJUnit.assertEquals; -import static org.testng.AssertJUnit.assertTrue; -import static vid.automation.test.utils.ExtendedHamcrestMatcher.hasItemsFromCollection; - import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.util.concurrent.Uninterruptibles; -import java.time.Instant; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.UUID; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicReference; -import java.util.function.Predicate; -import java.util.stream.Collectors; -import java.util.stream.IntStream; -import java.util.stream.Stream; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -64,6 +38,33 @@ import vid.automation.test.model.ServiceAction; import vid.automation.test.services.AsyncJobsService; import vid.automation.test.services.SimulatorApi; +import java.time.Instant; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.stream.IntStream; +import java.util.stream.Stream; + +import static java.lang.Boolean.FALSE; +import static java.lang.Boolean.TRUE; +import static java.util.Collections.emptyList; +import static java.util.stream.Collectors.joining; +import static java.util.stream.Collectors.toMap; +import static org.hamcrest.CoreMatchers.hasItem; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.hasSize; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys; +import static org.testng.Assert.assertNotNull; +import static org.testng.AssertJUnit.assertEquals; +import static org.testng.AssertJUnit.assertTrue; +import static vid.automation.test.utils.ExtendedHamcrestMatcher.hasItemsFromCollection; + public class AsyncInstantiationBase extends BaseMsoApiTest { public static final String CREATE_BULK_OF_ALACARTE_REQUEST_WITH_VNF = "asyncInstantiation/vidRequestCreateALaCarteWithVnf.json"; @@ -408,10 +409,12 @@ public class AsyncInstantiationBase extends BaseMsoApiTest { } protected void assertExpectedStatusAndServiceInfo(JobStatus finalState, String jobId, ServiceInfo expectedServiceInfo) { - assertExpectedStatusAndServiceInfo(finalState, jobId, false, expectedServiceInfo); + assertExpectedStatusAndServiceInfo(finalState, jobId, PATIENCE_LEVEL.FAIL_FAST, expectedServiceInfo); } - protected void assertExpectedStatusAndServiceInfo(JobStatus finalState, String jobId, boolean longWait, ServiceInfo expectedServiceInfo) { + enum PATIENCE_LEVEL { FAIL_FAST, FAIL_SLOW, FAIL_VERY_SLOW } + + protected void assertExpectedStatusAndServiceInfo(JobStatus finalState, String jobId, PATIENCE_LEVEL patienceLevel, ServiceInfo expectedServiceInfo) { JobInfoChecker<Integer> jobInfoChecker = new JobInfoChecker<>( restTemplate, ImmutableSet.of(JobStatus.PENDING, JobStatus.IN_PROGRESS, finalState), jobId, expectedServiceInfo); boolean result = jobInfoChecker.test(null); @@ -421,10 +424,21 @@ public class AsyncInstantiationBase extends BaseMsoApiTest { if (ImmutableList.of(JobStatus.COMPLETED, JobStatus.PAUSE).contains(finalState) && expectedServiceInfo.serviceInstanceId==null) { expectedServiceInfo.serviceInstanceId = BaseMSOPreset.DEFAULT_INSTANCE_ID; } - result = Wait.waitFor(jobInfoChecker, null, 30, longWait ? 2 : 1); + result = Wait.waitFor(jobInfoChecker, null, 30, waitIntervalBy(patienceLevel)); assertTrue("service info of jobId: " + jobId + " was in status: " + jobInfoChecker.lastStatus, result); } + private int waitIntervalBy(PATIENCE_LEVEL patienceLevel) { + switch (patienceLevel) { + case FAIL_SLOW: + return 2; + case FAIL_VERY_SLOW: + return 3; + default: + return 1; + } + } + protected List<String> createBulkOfMacroInstances(ImmutableList<BasePreset> presets, boolean isPause, int bulkSize, Map<Keys, String> names) { SimulatorApi.registerExpectationFromPresets(presets, SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET); return createBulkOfInstances(isPause, bulkSize, names, CREATE_BULK_OF_MACRO_REQUEST); diff --git a/vid-automation/src/main/java/org/onap/vid/api/BaseApiTest.java b/vid-automation/src/main/java/org/onap/vid/api/BaseApiTest.java index 5b7b1b214..7ce29446c 100644 --- a/vid-automation/src/main/java/org/onap/vid/api/BaseApiTest.java +++ b/vid-automation/src/main/java/org/onap/vid/api/BaseApiTest.java @@ -8,6 +8,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.isEmptyOrNullString; import static org.hamcrest.Matchers.not; +//import com.automation.common.report_portal_integration.listeners.ReportPortalListener; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; @@ -33,10 +34,12 @@ import org.springframework.web.client.DefaultResponseErrorHandler; import org.springframework.web.client.HttpStatusCodeException; import org.springframework.web.client.RestTemplate; import org.testng.annotations.BeforeClass; +import org.testng.annotations.Listeners; import vid.automation.test.infra.FeaturesTogglingConfiguration; import vid.automation.test.services.UsersService; import vid.automation.test.utils.CookieAndJsonHttpHeadersInterceptor; +//@Listeners(ReportPortalListener.class) public class BaseApiTest { protected static final Logger LOGGER = LogManager.getLogger(BaseApiTest.class); @@ -63,7 +66,7 @@ public class BaseApiTest { } private URI getUri() { - String host = System.getProperty("VID_HOST", "10.0.0.10"); + String host = System.getProperty("VID_HOST", "127.0.0.1"); int port = Integer.valueOf(System.getProperty("VID_PORT", "8080")); return new JerseyUriBuilder().host(host).port(port).scheme("http").path("vid").build(); } diff --git a/vid-automation/src/main/java/org/onap/vid/api/BaseMsoApiTest.java b/vid-automation/src/main/java/org/onap/vid/api/BaseMsoApiTest.java index 175638008..caece3217 100644 --- a/vid-automation/src/main/java/org/onap/vid/api/BaseMsoApiTest.java +++ b/vid-automation/src/main/java/org/onap/vid/api/BaseMsoApiTest.java @@ -1,5 +1,6 @@ package org.onap.vid.api; +//import com.automation.common.report_portal_integration.annotations.Step; import com.google.common.collect.ImmutableMap; import org.json.JSONException; import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; @@ -82,6 +83,7 @@ public class BaseMsoApiTest extends BaseApiTest { } } + //@Step(description = "method: ${method}, uri: ${uri}, body: ${body}") protected MsoResponseWrapper2 callMsoForResponseWrapper(HttpMethod method, String uri, String body) { MsoResponseWrapper2 responseWrapper; switch (method) { diff --git a/vid-automation/src/main/java/vid/automation/test/Constants.java b/vid-automation/src/main/java/vid/automation/test/Constants.java index 3df26f6ab..e3eeaca54 100644 --- a/vid-automation/src/main/java/vid/automation/test/Constants.java +++ b/vid-automation/src/main/java/vid/automation/test/Constants.java @@ -50,8 +50,8 @@ public class Constants { public static final String SERVICE_INSTANCEID_TH_ID = "service-instanceId-th-id"; public static final String MULTI_SELECT_UNSELECTED_CLASS = "item-unselected"; public static final String MULTI_SELECT_SELECTED_CLASS = "item-selected"; - public static final String ACTIVE = "Active"; - public static final String INACTIVE = "Inactive"; + public static final String ACTIVE = "ACTIVE"; + public static final String INACTIVE = "INACTIVE"; public static final String MSO_COMMIT_DIALOG_CLOSE_BUTTON = "msoCommitDialogCloseButton"; public static final String REQUIRED = "is required"; public static final String MISSING_DATA = "Missing data (\"%s\")"; @@ -182,6 +182,7 @@ public class Constants { public static final String STATUS_TEXT = "Designing a new service"; public static final String CONTEXT_MENU_BUTTON_HEADER = "openMenuBtn"; public static final String CONTEXT_MENU_HEADER_EDIT_ITEM = "context-menu-header-edit-item"; + public static final String CONTEXT_MENU_HEADER_RESUME_ITEM = "context-menu-header-resume-item"; public static final String CONTEXT_MENU_HEADER_DELETE_ITEM = "context-menu-header-delete-item"; public static final String SERVICE_QUANTITY = "servicesQuantity"; public static final String BACK_BUTTON = "backBtn"; @@ -241,6 +242,7 @@ public class Constants { public static final String ECOMP_NAME_INPUT = "ecomp-instance-name"; public static final String TENANT_CONTEXT_INPUT = "tenant-context"; public static final String ENVIRONMENT_TYPE_DROP_DOWN = "operational-environment-type"; + public static final String ENVIRONMENT_RELEASE = "operational-release"; public static final String WORKLOAD_CONTEXT_DROP_DOWN = "workload-context"; public static final String SUBMIT_BUTTON = "submit-button"; public static final String CANCEL_BUTTON = "cancel-button"; @@ -248,10 +250,12 @@ public class Constants { public static final String POPUP_ERROR_MESSAGE = "test-new-environment-error"; public static final String environmentCreatedSuccesfullyMessage = "Operational Environment successfully created"; + // json content public static final String HEADERS_LIST = "headers"; public static final String BASIC_LIST = "basicList"; public static final String FULL_LIST = "fullList"; + public static final String FULL_LIST_WITHOUT_RELEASE_LABEL = "fullListWithoutReleaseLabel"; public static final String FILTERED_LIST = "filteredList"; public static final String SORTED_LIST = "sortedList"; @@ -323,6 +327,7 @@ public class Constants { public class CreateNewInstance { public static final String SUBSCRIBER_NAME_OPTION_CLASS = "subscriberNameOption"; public static final String SERVICE_TYPE_OPTION_CLASS = "serviceTypeOption"; + public static final String OWNING_ENTITY_OPTION = "owningEntityOption"; public static final String SELECTED_SUBSCRIBER_NAME_TEST_ID = "selectedSubscriberName"; public static final String SELECTED_SERVICE_TYPE_NAME_TEST_ID = "selectedServiceTypeName"; public static final String SERVICE_INSTANCE_NAME_PREFIX = "vid-e2e-test_aai_service_"; @@ -403,6 +408,7 @@ public class Constants { public static final String SUBDETAILS_ERROR_MESSAGE_TEST_ID = "subDetailsErrMsg"; public static final String ERROR_CLASS = "error"; + public static final String COMMON_PORT_MIRRORING_PORT_NAME = "i am a port"; } public class PnfAssociation { public static final String PNF_NAME_TEST_ID = "pnfName"; diff --git a/vid-automation/src/main/java/vid/automation/test/infra/Click.java b/vid-automation/src/main/java/vid/automation/test/infra/Click.java index 0b5f40b84..ec469d13a 100644 --- a/vid-automation/src/main/java/vid/automation/test/infra/Click.java +++ b/vid-automation/src/main/java/vid/automation/test/infra/Click.java @@ -1,5 +1,8 @@ package vid.automation.test.infra; +import static org.onap.sdc.ci.tests.utilities.GeneralUIUtils.getDriver; + +import java.util.List; import org.junit.Assert; import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.openqa.selenium.Alert; @@ -8,10 +11,6 @@ import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.Select; import org.openqa.selenium.support.ui.WebDriverWait; -import java.util.List; - -import static org.onap.sdc.ci.tests.utilities.GeneralUIUtils.getDriver; - public class Click { public static void byText(String text) { WebElement element = GeneralUIUtils.findByText(text); @@ -33,6 +32,11 @@ public class Click { clickWhenClickable(element); } + public static void byTestIdOnceItsAvailable(String testId, int timeout) { + GeneralUIUtils.clickElementUsingActions( + Get.byXpath("//*[@data-tests-id='" + testId + "']", timeout)); + } + public static void byClass(String className) { List<WebElement> elements = Get.byClass(className); Assert.assertTrue(elements != null && elements.size() > 0); diff --git a/vid-automation/src/main/java/vid/automation/test/infra/Features.java b/vid-automation/src/main/java/vid/automation/test/infra/Features.java index cd632ff12..005c06551 100644 --- a/vid-automation/src/main/java/vid/automation/test/infra/Features.java +++ b/vid-automation/src/main/java/vid/automation/test/infra/Features.java @@ -7,17 +7,12 @@ public enum Features implements Feature { CREATE_INSTANCE_TEST, EMPTY_DRAWING_BOARD_TEST, - FLAG_ASYNC_JOBS, FLAG_ADD_MSO_TESTAPI_FIELD, - FLAG_ASYNC_INSTANTIATION, - FLAG_UNASSIGN_SERVICE, FLAG_SERVICE_MODEL_CACHE, FLAG_NETWORK_TO_ASYNC_INSTANTIATION, - FLAG_COLLECTION_RESOURCE_SUPPORT, FLAG_SHOW_ASSIGNMENTS, FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS, FLAG_SHOW_VERIFY_SERVICE, - FLAG_DUPLICATE_VNF, FLAG_DEFAULT_VNF, FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD, FLAG_RESTRICTED_SELECT, @@ -27,7 +22,6 @@ public enum Features implements Feature { FLAG_PRESENT_PROVIDER_NETWORKS_ASSOCIATIONS, FLAG_ASYNC_ALACARTE_VFMODULE, FLAG_SUPPLEMENTARY_FILE, - FLAG_SHIFT_VFMODULE_PARAMS_TO_VNF, FLAG_EXP_ANY_ALACARTE_NEW_INSTANTIATION_UI, FLAG_1810_CR_LET_SELECTING_COLLECTOR_TYPE_UNCONDITIONALLY, FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST, @@ -40,6 +34,12 @@ public enum Features implements Feature { FLAG_VF_MODULE_RESUME_STATUS_CREATE, FLAG_EXP_CREATE_RESOURCES_IN_PARALLEL, FLAG_1906_INSTANTIATION_API_USER_VALIDATION, + FLAG_1908_TRANSPORT_SERVICE_NEW_INSTANTIATION_UI, + FLAG_1908_COLLECTION_RESOURCE_NEW_INSTANTIATION_UI, + FLAG_1908_INFRASTRUCTURE_VPN, + FLAG_1908_RESUME_MACRO_SERVICE, + FLAG_1908_RELEASE_TENANT_ISOLATION, + FLAG_1908_VNF_FC_NEW_INSTANTIATION_UI, ; public boolean isActive() { diff --git a/vid-automation/src/main/java/vid/automation/test/infra/ModelInfo.java b/vid-automation/src/main/java/vid/automation/test/infra/ModelInfo.java index 1284a8b42..59e48013c 100644 --- a/vid-automation/src/main/java/vid/automation/test/infra/ModelInfo.java +++ b/vid-automation/src/main/java/vid/automation/test/infra/ModelInfo.java @@ -51,12 +51,15 @@ public class ModelInfo { public static final ModelInfo macroSriovWithDynamicFieldsEcompNamingFalsePartialModelDetailsVnfEcompNamingFalse = new ModelInfo("6b528779-44a3-4472-bdff-9cd15ec93450", "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0" , "csar-withDynamicFields-ecompNamingFalse-partialModelDetails-vnfEcompNamingFalse.zip"); public static final ModelInfo macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetailsVnfEcompNamingFalse = new ModelInfo("4a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd", "4140a873-00bb-4f57-ac46-0494cc9e674a", "csar-noDynamicFields-ecompNamingFalse-fullModelDetails-1a80c596-vnfEcompNamingFalse.zip"); public static final ModelInfo aLaCarteNetworkProvider5G = new ModelInfo("4659e8bd-0920-4eed-8ec5-550b4c8dceeb", "16e56d12-40b3-4db1-a40e-d48c36679e2e", "service-SrIovProvider1-csar.zip"); - public static final ModelInfo PASQUALEVmxVpeBvService488Annotations = new ModelInfo("f4d84bb4-a416-4b4e-997e-0059973630b9", "598e3f9e-3244-4d8f-a8e0-0e5d7a29eda9", "service-PASQUALEVmxVpeBvService488-csar-annotations.zip"); + public static final ModelInfo pasqualeVmxVpeBvService488Annotations = new ModelInfo("f4d84bb4-a416-4b4e-997e-0059973630b9", "598e3f9e-3244-4d8f-a8e0-0e5d7a29eda9", "service-PasqualeVmxVpeBvService488-csar-annotations.zip"); public static final ModelInfo macroDrawingBoardComplexService = new ModelInfo("6e59c5de-f052-46fa-aa7e-2fca9d674c44","cfef8302-d90f-475f-87cc-3f49a62ef14c", "service-Complexservice-csar.zip" ); public static final ModelInfo aLaCarteServiceCreationTest = new ModelInfo("f913c5d0-206e-45c2-9284-1c68f4e67dc7", "45e61192-876c-4e28-9139-5a0c47410379", "serviceCreationTest.zip"); public static final ModelInfo aLaCarteVnfGroupingService = new ModelInfo("4117a0b6-e234-467d-b5b9-fe2f68c8b0fc", "7ee41ce4-4827-44b0-a48e-2707a59905d2", "csar15782222_instantiationTypeAlacarte_VnfGrouping.zip"); public static final ModelInfo serviceFabricSriovService = new ModelInfo("253f1467-fe68-4e80-ba71-308000caec31", "c15fe228-7d40-4f99-afa7-10abeedf9aac", "service-fabric-SriovService-csar.zip"); - + public static final ModelInfo infrastructureVpnService = new ModelInfo("f028b2e2-7080-4b13-91b2-94944d4c42d8", "dfc2c44c-2429-44ca-ae26-1e6dc1f207fb", "service-Infravpn-csar.zip"); + public static final ModelInfo collectionResourceService = new ModelInfo("abd0cb02-5f97-42cd-be93-7dd3e31a6a64", "04bdd793-32ed-4045-adea-4e096304a067", "csar_collection_resource.zip"); + public static final ModelInfo collectionResourceForResume = new ModelInfo("6e0bec91-09f3-43aa-9cf3-e617cd0146be", "f6342be5-d66b-4d03-a1aa-c82c3094c4ea", "csar_collection_resource_for_resume.zip"); + public static final ModelInfo transportWithPnfsService = new ModelInfo("12550cd7-7708-4f53-a09e-41d3d6327ebc", "561faa57-7bbb-40ec-a81c-c0d4133e98d4", "csarTransportWithPnfs.zip"); public static final ImmutableList<ModelInfo> superSetOfModelInfos = buildModelInfos(); public static ImmutableList<ModelInfo> buildModelInfos() { @@ -70,10 +73,14 @@ public class ModelInfo { .add(macroSriovWithDynamicFieldsEcompNamingFalsePartialModelDetailsVnfEcompNamingFalse) .add(macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetailsVnfEcompNamingFalse) .add(aLaCarteNetworkProvider5G) - .add(PASQUALEVmxVpeBvService488Annotations) + .add(pasqualeVmxVpeBvService488Annotations) .add(macroDrawingBoardComplexService) .add(aLaCarteServiceCreationTest) .add(aLaCarteVnfGroupingService) + .add(infrastructureVpnService) + .add(transportWithPnfsService) + .add(collectionResourceService) + .add(collectionResourceForResume) .build(); } } diff --git a/vid-automation/src/main/java/vid/automation/test/model/Environment.java b/vid-automation/src/main/java/vid/automation/test/model/Environment.java index 9304dd998..a5df54a64 100644 --- a/vid-automation/src/main/java/vid/automation/test/model/Environment.java +++ b/vid-automation/src/main/java/vid/automation/test/model/Environment.java @@ -8,4 +8,5 @@ public class Environment { public String EcompEnvironmentName; public String tenantContext; public String workloadContext; + public String release; } diff --git a/vid-automation/src/main/java/vid/automation/test/model/ServiceAction.java b/vid-automation/src/main/java/vid/automation/test/model/ServiceAction.java index a155c6c72..9a86d9144 100644 --- a/vid-automation/src/main/java/vid/automation/test/model/ServiceAction.java +++ b/vid-automation/src/main/java/vid/automation/test/model/ServiceAction.java @@ -3,5 +3,6 @@ package vid.automation.test.model; public enum ServiceAction { INSTANTIATE, DELETE, - UPDATE + UPDATE, + RESUME }
\ No newline at end of file diff --git a/vid-automation/src/main/java/vid/automation/test/sections/CreateConfigurationPage.java b/vid-automation/src/main/java/vid/automation/test/sections/CreateConfigurationPage.java index 4b837a0ac..6f6b9f57d 100644 --- a/vid-automation/src/main/java/vid/automation/test/sections/CreateConfigurationPage.java +++ b/vid-automation/src/main/java/vid/automation/test/sections/CreateConfigurationPage.java @@ -1,8 +1,6 @@ package vid.automation.test.sections; -import org.junit.Assert; import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; -import org.openqa.selenium.WebElement; import vid.automation.test.Constants; import vid.automation.test.infra.SelectOption; diff --git a/vid-automation/src/main/java/vid/automation/test/sections/CreateNewInstancePage.java b/vid-automation/src/main/java/vid/automation/test/sections/CreateNewInstancePage.java index 68e673b68..11f570211 100644 --- a/vid-automation/src/main/java/vid/automation/test/sections/CreateNewInstancePage.java +++ b/vid-automation/src/main/java/vid/automation/test/sections/CreateNewInstancePage.java @@ -2,7 +2,6 @@ package vid.automation.test.sections; import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import vid.automation.test.Constants; -import vid.automation.test.model.Service; /** * Created by itzikliderman on 13/06/2017. diff --git a/vid-automation/src/main/java/vid/automation/test/sections/DrawingBoardPage.java b/vid-automation/src/main/java/vid/automation/test/sections/DrawingBoardPage.java index acbb4d991..22e8136cf 100644 --- a/vid-automation/src/main/java/vid/automation/test/sections/DrawingBoardPage.java +++ b/vid-automation/src/main/java/vid/automation/test/sections/DrawingBoardPage.java @@ -1,7 +1,34 @@ package vid.automation.test.sections; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.collection.IsEmptyCollection.empty; +import static org.testng.AssertJUnit.assertTrue; +import static vid.automation.test.Constants.DrawingBoard.DEPLOY_BUTTON; +import static vid.automation.test.Constants.DrawingBoard.HIGHLIGHTED_COLOR; +import static vid.automation.test.Constants.DrawingBoard.QUANTITY_LABEL_TEST_ID; +import static vid.automation.test.Constants.DrawingBoard.QUANTITY_LABEL_VALUE; +import static vid.automation.test.Constants.DrawingBoard.SERVICE_INSTANCE_TEST_ID; +import static vid.automation.test.Constants.DrawingBoard.SERVICE_INSTANCE_VALUE; +import static vid.automation.test.Constants.DrawingBoard.SERVICE_NAME; +import static vid.automation.test.Constants.DrawingBoard.SERVICE_QUANTITY; +import static vid.automation.test.Constants.DrawingBoard.SERVICE_STATUS; +import static vid.automation.test.Constants.DrawingBoard.STATUS_TEXT; + import com.google.common.collect.ImmutableList; import com.google.common.collect.Sets; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; @@ -12,20 +39,12 @@ import vid.automation.test.Constants; import vid.automation.test.infra.Click; import vid.automation.test.infra.Get; import vid.automation.test.infra.Wait; - -import java.util.*; -import java.util.function.Function; -import java.util.function.Predicate; -import java.util.stream.Collectors; - -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.collection.IsEmptyCollection.empty; -import static vid.automation.test.Constants.DrawingBoard.*; +import vid.automation.test.test.NewServiceInstanceTest; public class DrawingBoardPage extends VidBasePage { + private static final Logger logger = LogManager.getLogger(DrawingBoardPage.class); + public DrawingBoardPage(){ super(); } @@ -219,7 +238,7 @@ public class DrawingBoardPage extends VidBasePage { assertThat(webElement.getText(), is("Missing required information. Please open and fill in the details.")); } - public void clickDeployButton(){ + private void clickDeployButton(){ GeneralUIUtils.ultimateWait(); try { @@ -233,6 +252,22 @@ public class DrawingBoardPage extends VidBasePage { } + public void deploy() { + try { + logger.info("Redux state before deploy:"); + logger.info(getReduxState()); + } + catch (Exception e) { + //do nothing just logging + } + clickDeployButton(); + + VidBasePage.goOutFromIframe(); + GeneralUIUtils.ultimateWait(); + VidBasePage.goToIframe(); + GeneralUIUtils.ultimateWait(); + } + public void checkDeployButtonDisabled(){ Assert.assertFalse(Get.byTestId(DEPLOY_BUTTON).isEnabled(),"Deploy button is enabled and should be disabled"); } @@ -256,22 +291,22 @@ public class DrawingBoardPage extends VidBasePage { } public static class ServiceStatusChecker implements Predicate<Boolean> { - private String actualInstanceName; + private String uniqueText; private Set<String> expectedStatuses; private Set<String> columnClassesSet; - public ServiceStatusChecker(String actualInstanceName, Set<String> expectedStatuses) { - this.actualInstanceName = actualInstanceName; + public ServiceStatusChecker(String uniqueText, Set<String> expectedStatuses) { + this.uniqueText = uniqueText; this.expectedStatuses = expectedStatuses; } @Override public boolean test(Boolean noMeaning) { InstantiationStatusPage.clickRefreshButton(); - final WebElement row = InstantiationStatusPage.getInstantiationStatusRow(actualInstanceName); + final WebElement row = InstantiationStatusPage.getInstantiationStatusRow(uniqueText); if (row == null) { - System.err.println("**********************" + actualInstanceName + "************************************************"); - columnClassesSet = Collections.singleton(actualInstanceName + " NOT FOUND"); + System.err.println("**********************" + uniqueText + "************************************************"); + columnClassesSet = Collections.singleton(uniqueText + " NOT FOUND"); return false; // treat missing row as if test condition not fulfilled } else { columnClassesSet = new HashSet<>(Arrays.asList( @@ -284,4 +319,13 @@ public class DrawingBoardPage extends VidBasePage { return columnClassesSet; } } + + public void verifyServiceCompletedOnTime(String uniqueStatusText, String nameToDisplay) { + DrawingBoardPage.ServiceStatusChecker serviceStatusChecker = + new DrawingBoardPage.ServiceStatusChecker(uniqueStatusText, Collections.singleton(NewServiceInstanceTest.COMPLETED)); + boolean statusIsShown = Wait.waitFor(serviceStatusChecker, null, 20, 2); + assertTrue(nameToDisplay + " wasn't completed in time", statusIsShown); + VidBasePage.goOutFromIframe(); + } + } diff --git a/vid-automation/src/main/java/vid/automation/test/sections/PnfSearchAssociationPage.java b/vid-automation/src/main/java/vid/automation/test/sections/PnfSearchAssociationPage.java index 2efb9f3c8..e56603f90 100644 --- a/vid-automation/src/main/java/vid/automation/test/sections/PnfSearchAssociationPage.java +++ b/vid-automation/src/main/java/vid/automation/test/sections/PnfSearchAssociationPage.java @@ -1,8 +1,6 @@ package vid.automation.test.sections; -import org.junit.Assert; import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; -import org.openqa.selenium.WebElement; import vid.automation.test.Constants; public class PnfSearchAssociationPage extends VidBasePage { diff --git a/vid-automation/src/main/java/vid/automation/test/sections/ServiceProxyPage.java b/vid-automation/src/main/java/vid/automation/test/sections/ServiceProxyPage.java index 82f45ce7f..b96a7d38d 100644 --- a/vid-automation/src/main/java/vid/automation/test/sections/ServiceProxyPage.java +++ b/vid-automation/src/main/java/vid/automation/test/sections/ServiceProxyPage.java @@ -4,6 +4,7 @@ import org.junit.Assert; import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.openqa.selenium.WebElement; import vid.automation.test.Constants; +import vid.automation.test.Constants.ViewEdit; import vid.automation.test.infra.SelectOption; import static org.hamcrest.core.Is.is; @@ -40,18 +41,34 @@ public class ServiceProxyPage extends VidBasePage { } public ServiceProxyPage clickDeleteConfigurationButton() { - GeneralUIUtils.clickOnElementByTestId(Constants.DELETE_CONFIGURATION_BUTTON, 60); + GeneralUIUtils.clickOnElementByTestId(deleteConfigurationButtonTestId(), 60); return this; } + private String configurationInstanceName() { + return "dummy_instance"; + } + + private String deleteConfigurationButtonTestId() { + return Constants.DELETE_CONFIGURATION_BUTTON + "-" + configurationInstanceName(); + } + + private String activateDeactivateButtonTestId() { + return Constants.ACTIVATE_DEACTIVATE_BUTTON + "-" + configurationInstanceName(); + } + + private String enableDisableButtonTestId(String portName) { + return Constants.ENABLE_DISABLE_BUTTON + "-" + configurationInstanceName() + "-" + portName; + } + public ServiceProxyPage assertDeleteConfigurationButtonExists(boolean shouldExist){ if (shouldExist) { - WebElement selectedV = GeneralUIUtils.getWebElementByTestID(Constants.DELETE_CONFIGURATION_BUTTON, 3); + WebElement selectedV = GeneralUIUtils.getWebElementByTestID(deleteConfigurationButtonTestId(), 3); Assert.assertThat(selectedV != null, is(shouldExist)); Assert.assertThat(selectedV.isDisplayed(), is(shouldExist)); } else { - boolean webElementExistByTestId = GeneralUIUtils.isWebElementExistByTestId(Constants.DELETE_CONFIGURATION_BUTTON); + boolean webElementExistByTestId = GeneralUIUtils.isWebElementExistByTestId(deleteConfigurationButtonTestId()); Assert.assertThat(webElementExistByTestId, is(shouldExist)); } return this; @@ -86,12 +103,12 @@ public class ServiceProxyPage extends VidBasePage { } public ServiceProxyPage clickActivateDeactivateButton() { - GeneralUIUtils.clickOnElementByTestId(Constants.ACTIVATE_DEACTIVATE_BUTTON, 60); + GeneralUIUtils.clickOnElementByTestId(activateDeactivateButtonTestId(), 60); return this; } public ServiceProxyPage clickEnableDisableButton(){ - GeneralUIUtils.clickOnElementByTestId(Constants.ENABLE_DISABLE_BUTTON, 60); + GeneralUIUtils.clickOnElementByTestId(enableDisableButtonTestId(ViewEdit.COMMON_PORT_MIRRORING_PORT_NAME), 60); return this; } } diff --git a/vid-automation/src/main/java/vid/automation/test/sections/TestEnvironmentPage.java b/vid-automation/src/main/java/vid/automation/test/sections/TestEnvironmentPage.java index 71c6e0bd4..5989fb658 100644 --- a/vid-automation/src/main/java/vid/automation/test/sections/TestEnvironmentPage.java +++ b/vid-automation/src/main/java/vid/automation/test/sections/TestEnvironmentPage.java @@ -1,14 +1,10 @@ package vid.automation.test.sections; import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; -import org.openqa.selenium.By; import org.openqa.selenium.WebElement; -import org.testng.Assert; import vid.automation.test.Constants; -import vid.automation.test.infra.Click; import vid.automation.test.infra.Get; - -import java.util.List; +import vid.automation.test.infra.SelectOption; import static org.junit.Assert.assertEquals; @@ -36,4 +32,11 @@ public class TestEnvironmentPage extends VidBasePage { WebElement webElement = Get.byId(Constants.TestEnvironments.attachButtonIdPrefix + envId); return webElement; } + + public static String selectEnvRelease(String envRelease){ + GeneralUIUtils.ultimateWait(); + String selectedOption; + selectedOption = SelectOption.getSelectedOption(Constants.TestEnvironments.ENVIRONMENT_RELEASE); + return selectedOption; + } } diff --git a/vid-automation/src/main/java/vid/automation/test/sections/VidBasePage.java b/vid-automation/src/main/java/vid/automation/test/sections/VidBasePage.java index f749df02b..65d0fb6a0 100644 --- a/vid-automation/src/main/java/vid/automation/test/sections/VidBasePage.java +++ b/vid-automation/src/main/java/vid/automation/test/sections/VidBasePage.java @@ -1,33 +1,33 @@ package vid.automation.test.sections; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.onap.sdc.ci.tests.utilities.GeneralUIUtils.getDriver; - import com.aventstack.extentreports.Status; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.List; -import java.util.function.Function; import org.junit.Assert; import org.onap.sdc.ci.tests.execute.setup.ExtentTestActions; import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.openqa.selenium.By; +import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import vid.automation.test.Constants; -import vid.automation.test.infra.Click; -import vid.automation.test.infra.Exists; -import vid.automation.test.infra.Get; -import vid.automation.test.infra.Input; -import vid.automation.test.infra.SelectOption; -import vid.automation.test.infra.Wait; +import vid.automation.test.Constants.ViewEdit; +import vid.automation.test.infra.*; + +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.function.Function; + +import static java.util.stream.Collectors.toMap; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.onap.sdc.ci.tests.utilities.GeneralUIUtils.getDriver; +import static org.testng.Assert.assertEquals; public class VidBasePage { @@ -192,6 +192,12 @@ public class VidBasePage { return this; } + public VidBasePage selectLineOfBusiness(String lineOfBusines) { + GeneralUIUtils.ultimateWait(); + SelectOption.byValue(lineOfBusines, Constants.ViewEdit.LINE_OF_BUSINESS_SELECT_TESTS_ID); + return this; + } + public VidBasePage selectTenant(String tenant) { GeneralUIUtils.ultimateWait(); SelectOption.byValue(tenant, Constants.ViewEdit.TENANT_SELECT_TESTS_ID); @@ -213,10 +219,6 @@ public class VidBasePage { return this; } - public VidBasePage selectLineOfBusiness(String lob) { - SelectOption.byValue(lob, Constants.OwningEntity.LOB_SELECT_TEST_ID); - return this; - } public void assertButtonState(String dataTestId, boolean shouldBeEnabled) { assertButtonStateInternal(dataTestId, shouldBeEnabled, @@ -312,7 +314,7 @@ public class VidBasePage { if (checkPortMirroring) { Wait.byText("Add node instance"); - Wait.byText("i'm a port"); + Wait.byText(ViewEdit.COMMON_PORT_MIRRORING_PORT_NAME); } if (checkAddVnf) { @@ -334,5 +336,19 @@ public class VidBasePage { return new WebDriverWait(getDriver(), (long)time); } + public String getReduxState() { + final JavascriptExecutor javascriptExecutor = (JavascriptExecutor) GeneralUIUtils.getDriver(); + String reduxState = (String)javascriptExecutor.executeScript("return window.sessionStorage.getItem('reduxState');"); + System.out.println(reduxState); + return reduxState; + } + + public void setReduxState(String state) { + final JavascriptExecutor javascriptExecutor = (JavascriptExecutor) GeneralUIUtils.getDriver(); + String script = String.format("window.sessionStorage.setItem('reduxState', '%s');", state); + System.out.println("executing script:"); + System.out.println(script); + javascriptExecutor.executeScript(script); + } } diff --git a/vid-automation/src/main/java/vid/automation/test/sections/ViewEditPage.java b/vid-automation/src/main/java/vid/automation/test/sections/ViewEditPage.java index e10c872ee..4edabf53d 100644 --- a/vid-automation/src/main/java/vid/automation/test/sections/ViewEditPage.java +++ b/vid-automation/src/main/java/vid/automation/test/sections/ViewEditPage.java @@ -76,6 +76,11 @@ public class ViewEditPage extends VidBasePage { return this; } + public ViewEditPage selectLineOfBusiness(String lineOfBusiness, String cloudOwner){ + selectLineOfBusiness(lineOfBusiness); + return this; + } + public ViewEditPage setLegacyRegion(String legacyRegionName){ setInputText(Constants.ViewEdit.LEGACY_REGION_INPUT_TESTS_ID, legacyRegionName); return this; @@ -126,16 +131,16 @@ public class ViewEditPage extends VidBasePage { return this; } - public ViewEditPage selectLineOfBusiness(String lineOfBusiness) { - try { - SelectOption.selectFirstTwoOptionsFromMultiselectById(Constants.ViewEdit.LINE_OF_BUSINESS_SELECT_TESTS_ID); - } catch (InterruptedException e) { - e.printStackTrace(); - return this; - } - //TODO multi SelectOption.byValue(lineOfBusiness, Constants.ViewEdit.LINE_OF_BUSINESS_SELECT_TESTS_ID); - return this; - } +// public ViewEditPage selectLineOfBusiness(String lineOfBusiness) { +// try { +// SelectOption.selectFirstTwoOptionsFromMultiselectById(Constants.ViewEdit.LINE_OF_BUSINESS_SELECT_TESTS_ID); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// return this; +// } +// //TODO multi SelectOption.byValue(lineOfBusiness, Constants.ViewEdit.LINE_OF_BUSINESS_SELECT_TESTS_ID); +// return this; +// } public ViewEditPage selectPlatform(String platform) { SelectOption.byValue(platform, Constants.OwningEntity.PLATFORM_SELECT_TEST_ID); diff --git a/vid-automation/src/main/java/vid/automation/test/services/BulkRegistration.java b/vid-automation/src/main/java/vid/automation/test/services/BulkRegistration.java index 0f0839537..2d04af9cb 100644 --- a/vid-automation/src/main/java/vid/automation/test/services/BulkRegistration.java +++ b/vid-automation/src/main/java/vid/automation/test/services/BulkRegistration.java @@ -1,35 +1,9 @@ package vid.automation.test.services; -import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.ATT_NC; -import static vid.automation.test.infra.ModelInfo.serviceFabricSriovService; -import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; - import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAICloudRegionAndSourceFromConfigurationPut; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIFilterServiceInstanceById; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetHomingForVfModule; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetModelsByOwningEntity; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetModelsByProject; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetNetworkZones; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetPortMirroringSourcePorts; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubDetailsGet; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubDetailsWithoutInstancesGet; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetTenants; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIPostNamedQueryForViewEdit; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSOActivateFabricConfiguration; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSOBaseCreateInstancePost; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateVfModule; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSODeactivateAndCloudDelete; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSODeleteInstanceOrchestrationRequestGet; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSODeleteNetwork; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSODeleteService; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSODeleteVfModule; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSODeleteVnf; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSODeleteVolumeGroup; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet; +import org.onap.simulator.presetGenerator.presets.aai.*; +import org.onap.simulator.presetGenerator.presets.mso.*; import org.onap.simulator.presetGenerator.presets.mso.configuration.PresetMSOActOnConfiguration; import org.onap.simulator.presetGenerator.presets.mso.configuration.PresetMSOCreateConfiguration; import org.onap.simulator.presetGenerator.presets.mso.configuration.PresetMSODeleteConfiguration; @@ -37,6 +11,12 @@ import org.onap.simulator.presetGenerator.presets.mso.configuration.PresetMsoEna import org.onap.simulator.presetGenerator.presets.sdc.PresetSDCGetServiceMetadataGet; import org.onap.simulator.presetGenerator.presets.sdc.PresetSDCGetServiceToscaModelGet; import vid.automation.test.Constants; +import vid.automation.test.Constants.ViewEdit; + +import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.ATT_NC; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet.COMPLETE; +import static vid.automation.test.infra.ModelInfo.serviceFabricSriovService; +import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; public class BulkRegistration { @@ -74,7 +54,7 @@ public class BulkRegistration { new PresetSDCGetServiceToscaModelGet(serviceFabricSriovService), new PresetAAIGetNetworkZones(), new PresetMSOActivateFabricConfiguration("c187e9fe-40c3-4862-b73e-84ff056205f61234"), - new PresetMSOOrchestrationRequestGet("COMPLETE", "318cc766-b673-4a50-b9c5-471f68914584", "Success")), + new PresetMSOOrchestrationRequestGet(COMPLETE, "318cc766-b673-4a50-b9c5-471f68914584", "Success", false)), SimulatorApi.RegistrationStrategy.APPEND); } @@ -137,11 +117,14 @@ public class BulkRegistration { public static void searchExistingServiceInstancePortMirroring(String orchStatus, boolean isMirrored, String desiredCloudRegionId) { genericSearchExistingServiceInstance(); final String configurationId = "9533-config-LB1113"; + final String configurationId2 = "9533-config-LB1114"; final String portInterfaceId = "d35bf534-7d8e-4cb4-87f9-0a8bb6cd47b2"; final String modelToReplaceWith ="pm1111_equip_model_rename.zip"; SimulatorApi.registerExpectationFromPreset(new PresetAAICloudRegionAndSourceFromConfigurationPut(configurationId, desiredCloudRegionId), APPEND); - SimulatorApi.registerExpectationFromPreset(new PresetAAIGetPortMirroringSourcePorts(configurationId, portInterfaceId, "i'm a port", isMirrored), APPEND); + SimulatorApi.registerExpectationFromPreset(new PresetAAIGetPortMirroringSourcePorts(configurationId, portInterfaceId, ViewEdit.COMMON_PORT_MIRRORING_PORT_NAME, isMirrored), APPEND); + SimulatorApi.registerExpectationFromPreset(new PresetAAICloudRegionAndSourceFromConfigurationPut(configurationId2, desiredCloudRegionId), APPEND); + SimulatorApi.registerExpectationFromPreset(new PresetAAIGetPortMirroringSourcePorts(configurationId2, portInterfaceId, "i'm not your port", isMirrored), APPEND); SimulatorApi.registerExpectationFromPreset(PresetAAIGetCloudOwnersByCloudRegionId.PRESET_MDT1_TO_ATT_NC, APPEND); SimulatorApi.registerExpectation( new String [] { @@ -284,7 +267,7 @@ public class BulkRegistration { SimulatorApi.registerExpectationFromPresets(ImmutableList.of( createInstancePreset, cloudOwnerPreset, - new PresetMSOOrchestrationRequestGet(PresetMSOOrchestrationRequestGet.COMPLETE, createInstancePreset.getRequestId(), "Success")), + new PresetMSOOrchestrationRequestGet(COMPLETE, createInstancePreset.getRequestId(), "Success", false)), SimulatorApi.RegistrationStrategy.APPEND); } @@ -423,7 +406,11 @@ public class BulkRegistration { new PresetMSOCreateVfModule("3f93c7cb-2fd0-4557-9514-e189b7b04f9d", "c015cc0f-0f37-4488-aabf-53795fd93cd3", ATT_NC, vfModuleName, "7a6ee536-f052-46fa-aa7e-2fca9d674c44", "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", "ComplexService"), - new PresetMSOOrchestrationRequestGet("COMPLETE","c0011670-0e1a-4b74-945d-8bf5aede1d9c",Constants.ViewEdit.VF_MODULE_CREATED_SUCCESSFULLY_TEXT)), + new PresetMSOOrchestrationRequestGet( + COMPLETE, + "c0011670-0e1a-4b74-945d-8bf5aede1d9c", + Constants.ViewEdit.VF_MODULE_CREATED_SUCCESSFULLY_TEXT, + false)), SimulatorApi.RegistrationStrategy.APPEND); } @@ -434,7 +421,11 @@ public class BulkRegistration { new PresetAAIGetTenants(), PresetAAIGetCloudOwnersByCloudRegionId.PRESET_MDT1_TO_ATT_NC, new PresetMSOCreateVfModule(serviceInstanceId,vnfInstanceId, ATT_NC), - new PresetMSOOrchestrationRequestGet("COMPLETE","c0011670-0e1a-4b74-945d-8bf5aede1d9c",Constants.ViewEdit.VF_MODULE_CREATED_SUCCESSFULLY_TEXT)), + new PresetMSOOrchestrationRequestGet( + COMPLETE, + "c0011670-0e1a-4b74-945d-8bf5aede1d9c", + Constants.ViewEdit.VF_MODULE_CREATED_SUCCESSFULLY_TEXT, + false)), SimulatorApi.RegistrationStrategy.APPEND); } diff --git a/vid-automation/src/main/java/vid/automation/test/services/SimulatorApi.java b/vid-automation/src/main/java/vid/automation/test/services/SimulatorApi.java index 65ef3679c..087449624 100644 --- a/vid-automation/src/main/java/vid/automation/test/services/SimulatorApi.java +++ b/vid-automation/src/main/java/vid/automation/test/services/SimulatorApi.java @@ -1,26 +1,8 @@ package vid.automation.test.services; -import static org.testng.Assert.assertEquals; -import static vid.automation.test.services.DropTestApiField.dropFieldCloudOwnerFromString; -import static vid.automation.test.services.DropTestApiField.dropTestApiFieldFromString; - import com.fasterxml.jackson.databind.DeserializationFeature; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import java.net.URI; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.function.UnaryOperator; -import java.util.stream.Collectors; -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.glassfish.jersey.client.ClientProperties; import org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJaxbJsonProvider; import org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJsonProvider; @@ -32,6 +14,25 @@ import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; import vid.automation.test.utils.ReadFile; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import java.net.URI; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.function.UnaryOperator; +import java.util.stream.Collectors; + +import static org.testng.Assert.assertEquals; +import static vid.automation.test.services.DropTestApiField.dropFieldCloudOwnerFromString; +import static vid.automation.test.services.DropTestApiField.dropTestApiFieldFromString; + public class SimulatorApi { public enum RegistrationStrategy { @@ -62,7 +63,7 @@ public class SimulatorApi { ImmutableList.of(dropTestApiFieldFromString(), dropFieldCloudOwnerFromString()); static { - String host = System.getProperty("VID_HOST", "10.0.0.10" ); + String host = System.getProperty("VID_HOST", "127.0.0.1" ); Integer port = Integer.valueOf(System.getProperty("SIM_PORT", System.getProperty("VID_PORT", "8080"))); //port for registration uri = new JerseyUriBuilder().host(host).port(port).scheme("http").path("vidSimulator").build(); client = ClientBuilder.newClient(); @@ -116,6 +117,12 @@ public class SimulatorApi { registerToSimulatorAndAssertSuccess(preset.getClass().getCanonicalName(), content, registrationStrategy); } + public static void registerExpectationFromPresetsCollections(Collection<Collection<BasePreset>> presets, RegistrationStrategy registrationStrategy) { + registerExpectationFromPresets(presets.stream() + .flatMap(Collection::stream) + .collect(Collectors.toList()), registrationStrategy); + } + public static void registerExpectationFromPresets(Collection<BasePreset> presets, RegistrationStrategy registrationStrategy) { if (registrationStrategy == RegistrationStrategy.CLEAR_THEN_SET) { clearRegistrations(); diff --git a/vid-automation/src/main/java/vid/automation/test/services/UsersService.java b/vid-automation/src/main/java/vid/automation/test/services/UsersService.java index aae7917f7..84345ebd1 100644 --- a/vid-automation/src/main/java/vid/automation/test/services/UsersService.java +++ b/vid-automation/src/main/java/vid/automation/test/services/UsersService.java @@ -1,10 +1,13 @@ package vid.automation.test.services; -import static org.hamcrest.CoreMatchers.everyItem; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.greaterThan; - +//import com.automation.common.report_portal_integration.annotations.Step; import com.google.common.primitives.Ints; +import org.apache.commons.lang3.StringUtils; +import vid.automation.test.model.User; +import vid.automation.test.model.UsersObject; +import vid.automation.test.utils.DB_CONFIG; +import vid.automation.test.utils.ReadFile; + import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; @@ -13,11 +16,10 @@ import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.ListIterator; -import org.apache.commons.lang3.StringUtils; -import vid.automation.test.model.User; -import vid.automation.test.model.UsersObject; -import vid.automation.test.utils.DB_CONFIG; -import vid.automation.test.utils.ReadFile; + +import static org.hamcrest.CoreMatchers.everyItem; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.greaterThan; /** * Created by itzikliderman on 08/09/2017. @@ -36,6 +38,7 @@ public class UsersService { return usersObject.users; } + //@Step("${method} with id: ${userId}") public User getUser(String userId) { User res = users.get(userId); System.out.println("getUser userId='" + userId + "' returned: " + res); @@ -52,7 +55,7 @@ public class UsersService { /* Creates a user in the DB, were: - Login user name is a deterministic number, hashed from the userId string, with 3 trailing zeroes, - and two leading letters from the userId itself; e.g. "mo26063000" for emanuel. + and two leading letters from the userId itself; e.g. "em97331000" for emanuel. - Login user name == user password - 'user.credentials.userId' and 'user.credentials.password' input fields are overridden with the generated values. - Roles are "read" (roleId==16) and all other roles in object (like subscriberName___serviceType___tenant). @@ -79,7 +82,6 @@ public class UsersService { "VALUES (" + userNumber + ", '" + user.credentials.userId + "', '" + userId + "', '" + user.credentials.userId + "', '" + user.credentials.password + "')"); List<String> roles = user.roles != null ? user.roles : new LinkedList<>(); - roles.add("Standard User"); ListIterator<String> iter = roles.listIterator(); while (iter.hasNext()) { diff --git a/vid-automation/src/main/java/vid/automation/test/test/ALaCarteflowTest.java b/vid-automation/src/main/java/vid/automation/test/test/ALaCarteflowTest.java index 69c619b2a..63fe15000 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/ALaCarteflowTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/ALaCarteflowTest.java @@ -1,33 +1,21 @@ package vid.automation.test.test; -import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.ATT_NC; -import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.MDT_1; -import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.PRESET_MDT1_TO_ATT_NC; -import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.PRESET_SOME_LEGACY_REGION_TO_ATT_AIC; -import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.SOME_LEGACY_REGION; -import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; - import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; 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.BasePresets.BaseMSOPreset; import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet; import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateVfModuleOldViewEdit; import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateVnfALaCarteOldViewEdit; import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateVolumeGroupOldViewEdit; +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.DataProvider; import org.testng.annotations.Test; import vid.automation.test.Constants; import vid.automation.test.infra.Get; -import vid.automation.test.infra.SelectOption; import vid.automation.test.model.ServiceModel; import vid.automation.test.model.User; import vid.automation.test.sections.SideMenu; @@ -36,6 +24,12 @@ import vid.automation.test.sections.ViewEditPage; import vid.automation.test.services.ServicesService; import vid.automation.test.services.SimulatorApi; +import java.util.List; +import java.util.stream.Collectors; + +import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.*; +import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; + public class ALaCarteflowTest extends CreateInstanceDialogBaseTest { static final String SUBSCRIBER = "Emanuel"; @@ -49,7 +43,7 @@ public class ALaCarteflowTest extends CreateInstanceDialogBaseTest { public static final String STATUS_MESSAGE = "status_message"; public static final String REQUEST_TYPE = "REQUEST-TYPE"; public static final String CREATE = "Create"; - public static final String AAIAIC_25 = "JANET25"; + public static final String AAIAIC_25 = "AAIAIC25"; public static final String AIC = "AIC"; public static final String TENANT = "092eb9e8e4b7412e8787dd091bc58e86"; public static final String FALSE = "false"; @@ -100,7 +94,7 @@ public class ALaCarteflowTest extends CreateInstanceDialogBaseTest { GeneralUIUtils.ultimateWait(); goToInstance(); ServiceModel serviceInstance = new ServicesService().getServiceModel(MODEL_UUID); - addVFModule("Vsp1710pid298109Vmmsc..mmsc_mod1_ltm..module-8", vfModuleName, AAIAIC_25, AIC, + addVFModule("Vsp1710pid298109Vwinifred..mmsc_mod1_ltm..module-8", vfModuleName, AAIAIC_25, AIC, TENANT, FALSE, MDT_1, getCurrentUser().tenants, serviceInstance); }); @@ -145,7 +139,7 @@ public class ALaCarteflowTest extends CreateInstanceDialogBaseTest { goToInstance(); ServiceModel serviceInstance = new ServicesService().getServiceModel(MODEL_UUID); addVNF(NODE_INSTANCE, AAIAIC_25, AIC, TENANT, - FALSE, SOME_LEGACY_REGION, "ebc3bc3d-62fd-4a3f-a037-f619df4ff034", "platform", getCurrentUser().tenants, new ArrayList<>(Arrays.asList("ONAP")), serviceInstance, instanceName); + FALSE, SOME_LEGACY_REGION, "ebc3bc3d-62fd-4a3f-a037-f619df4ff034", "platform", getCurrentUser().tenants, "ONAP", serviceInstance, instanceName); }); } @@ -171,7 +165,6 @@ public class ALaCarteflowTest extends CreateInstanceDialogBaseTest { openAndFillVnfPopup(NODE_INSTANCE, AAIAIC_25, AIC, TENANT, FALSE, SOME_LEGACY_REGION, "ebc3bc3d-62fd-4a3f-a037-f619df4ff034", "platform", getCurrentUser().tenants, null, null, instanceName); assertConfirmShowMissingDataErrorOnCurrentPopup(Constants.ViewEdit.LINE_OF_BUSINESS_TEXT); - successConfirmVnfAndClosePopup(); }); } @@ -182,11 +175,11 @@ public class ALaCarteflowTest extends CreateInstanceDialogBaseTest { ViewEditPage viewEditPage = new ViewEditPage(); viewEditPage.selectNodeInstanceToAdd(NODE_INSTANCE); GeneralUIUtils.ultimateWait(); - SelectOption.selectOptionsFromMultiselectById(Constants.OwningEntity.LOB_SELECT_TEST_ID, new ArrayList<>(Arrays.asList(lobToSelect))); + viewEditPage.selectLineOfBusiness(lobToSelect); viewEditPage.clickCancelButtonByTestID(); viewEditPage.selectNodeInstanceToAdd(NODE_INSTANCE); GeneralUIUtils.ultimateWait(); - AssertUnselectedOptionInMultiselectById(Constants.OwningEntity.LOB_SELECT_TEST_ID, lobToSelect); + viewEditPage.selectLineOfBusiness(lobToSelect); viewEditPage.clickCancelButtonByTestID(); } @@ -212,7 +205,7 @@ public class ALaCarteflowTest extends CreateInstanceDialogBaseTest { GeneralUIUtils.ultimateWait(); goToInstance(); ServiceModel serviceInstance = new ServicesService().getServiceModel(MODEL_UUID); - addVolumeGroup("Vsp1710pid298109Vmmsc..mmsc_mod6_eca_oam..module-3", vgName, AAIAIC_25, AIC, TENANT, + addVolumeGroup("Vsp1710pid298109Vwinifred..mmsc_mod6_eca_oam..module-3", vgName, AAIAIC_25, AIC, TENANT, FALSE, SOME_LEGACY_REGION, getCurrentUser().tenants, serviceInstance); }); } diff --git a/vid-automation/src/main/java/vid/automation/test/test/AddNetworkTest.java b/vid-automation/src/main/java/vid/automation/test/test/AddNetworkTest.java index d53b5011a..a65d7bf9d 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/AddNetworkTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/AddNetworkTest.java @@ -1,13 +1,11 @@ package vid.automation.test.test; import com.google.common.collect.ImmutableList; -import java.util.HashMap; -import java.util.Map; -import org.onap.sdc.ci.tests.datatypes.UserCredentials; import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId; import org.onap.simulator.presetGenerator.presets.mso.PresetMSOBaseCreateInstancePost; import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateNetworkALaCarteOldViewEdit; import org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet; +import org.onap.sdc.ci.tests.datatypes.UserCredentials; import org.testng.annotations.Test; import vid.automation.test.Constants; import vid.automation.test.model.User; @@ -15,18 +13,41 @@ import vid.automation.test.sections.ViewEditPage; import vid.automation.test.services.BulkRegistration; import vid.automation.test.services.SimulatorApi; +import java.util.HashMap; +import java.util.Map; + public class AddNetworkTest extends VidBaseTestCase { private ViewEditPage viewEditPage = new ViewEditPage(); private String serviceInstanceIdWithNetwork = "d198cc45-158b-480e-8d2c-03943c51268e"; + private User user = usersService.getUser(Constants.Users.EMANUEL_EMANUEL); + private String instanceName = viewEditPage.generateInstanceName(Constants.ViewEdit.NETWORK_INSTANCE_NAME_PREFIX); @Test public void testAddNetworkFullFlow() { - User user = usersService.getUser(Constants.Users.EMANUEL_EMANUEL); + String platform = "xxx1"; + this.goToNetworkPopup(platform); + Map<String, String> networkMetadata= getNetworkExpectedMetadata(); + addNetwork(networkMetadata,instanceName, "AIC30_CONTRAIL_BASIC 0", "One", "FUSION", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", platform, "zzz1","c630e297a3ae486497d63eacec1d7c14", + "false", "some legacy region",user.tenants); + } + + + @Test + public void testAddNetworkFullFlowWithoutPlatform() { + this.goToNetworkPopup(null); + Map<String, String> networkMetadata= getNetworkExpectedMetadata(); + addNetwork(networkMetadata,instanceName, "AIC30_CONTRAIL_BASIC 0", "One", "FUSION", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",null, "zzz1","c630e297a3ae486497d63eacec1d7c14", + "false", "some legacy region",user.tenants); + } + + + private void goToNetworkPopup(String platform){ + SimulatorApi.clearAll(); BulkRegistration.genericSearchExistingServiceInstance(); BulkRegistration.addNetwork(); - String instanceName = viewEditPage.generateInstanceName(Constants.ViewEdit.NETWORK_INSTANCE_NAME_PREFIX); + SimulatorApi.registerExpectationFromPresets( ImmutableList.of( @@ -35,18 +56,17 @@ public class AddNetworkTest extends VidBaseTestCase { PresetMSOBaseCreateInstancePost.DEFAULT_REQUEST_ID, "d198cc45-158b-480e-8d2c-03943c51268e", "c187e9fe-40c3-4862-b73e-84ff056205f6", - instanceName + instanceName, + platform ), new PresetMSOOrchestrationRequestGet( PresetMSOOrchestrationRequestGet.COMPLETE, PresetMSOOrchestrationRequestGet.DEFAULT_REQUEST_ID, - "Success")), + "Success", + false)), SimulatorApi.RegistrationStrategy.APPEND); goToExistingInstanceById(serviceInstanceIdWithNetwork); - Map<String, String> networkMetadata= getNetworkExpectedMetadata(); - addNetwork(networkMetadata,instanceName, "AIC30_CONTRAIL_BASIC 0", "One", "FUSION", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb","xxx1", "y1","c630e297a3ae486497d63eacec1d7c14", - "false", "some legacy region",user.tenants); } private Map<String, String> getNetworkExpectedMetadata() { diff --git a/vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java b/vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java index 2b5a09823..f082044fd 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java @@ -1,26 +1,16 @@ package vid.automation.test.test; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static vid.automation.test.infra.Features.FLAG_5G_IN_NEW_INSTANTIATION_UI; -import static vid.automation.test.infra.ModelInfo.aLaCarteForBrowseSdc; -import static vid.automation.test.infra.ModelInfo.aLaCarteServiceCreationTest; -import static vid.automation.test.infra.ModelInfo.instantiationTypeAlacarte_vidNotionsInstantiationUIByUUID; -import static vid.automation.test.infra.ModelInfo.macroForBrowseSdc; - import com.google.common.collect.ImmutableList; -import java.util.List; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.hamcrest.Matchers; -import org.onap.sdc.ci.tests.datatypes.UserCredentials; -import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.onap.simulator.presetGenerator.presets.BasePresets.BasePreset; import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetServicesGet; import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet; import org.onap.simulator.presetGenerator.presets.aai.PresetAAIServiceDesignAndCreationPut; import org.onap.simulator.presetGenerator.presets.ecompportal_att.PresetGetSessionSlotCheckIntervalGet; +import org.onap.sdc.ci.tests.datatypes.UserCredentials; +import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.testng.Assert; @@ -29,23 +19,22 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import vid.automation.test.Constants; -import vid.automation.test.infra.Click; -import vid.automation.test.infra.Exists; -import vid.automation.test.infra.FeatureTogglingTest; -import vid.automation.test.infra.Features; -import vid.automation.test.infra.Get; -import vid.automation.test.infra.ModelInfo; -import vid.automation.test.infra.SelectOption; +import vid.automation.test.infra.*; import vid.automation.test.model.Service; import vid.automation.test.model.User; -import vid.automation.test.sections.BrowseASDCPage; -import vid.automation.test.sections.DeployMacroDialogBase; -import vid.automation.test.sections.DeployMacroDialogOld; -import vid.automation.test.sections.SideMenu; -import vid.automation.test.sections.ViewEditPage; +import vid.automation.test.sections.*; import vid.automation.test.services.ServicesService; import vid.automation.test.services.SimulatorApi; +import java.util.List; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; +import static vid.automation.test.infra.Features.FLAG_1908_TRANSPORT_SERVICE_NEW_INSTANTIATION_UI; +import static vid.automation.test.infra.Features.FLAG_5G_IN_NEW_INSTANTIATION_UI; +import static vid.automation.test.infra.ModelInfo.*; + public class BrowseASDCTest extends CreateInstanceDialogBaseTest { private final String invariantUUIDAlacarte = aLaCarteForBrowseSdc.modelInvariantId; @@ -193,7 +182,8 @@ public class BrowseASDCTest extends CreateInstanceDialogBaseTest { } @Test - private void browseServiceModel_deployServiceMacroWithCR_creationPopupIsOldMacro() throws Exception { + @FeatureTogglingTest(flagActive = false, value = FLAG_1908_TRANSPORT_SERVICE_NEW_INSTANTIATION_UI) + public void browseServiceModel_deployServiceMacroWithCR_creationPopupIsOldMacro() throws Exception { deployServiceAndAssertInstantiationType( "csar15782222_instantiationTypeMacroWithCR.zip", invariantUUIDMacro, @@ -204,7 +194,7 @@ public class BrowseASDCTest extends CreateInstanceDialogBaseTest { @Test private void browseServiceModel_deployServiceMacroWithNetwork_creationPopupIsMacroByFF() throws Exception { - String macroInstantiationAccordingFF = Features.FLAG_ASYNC_INSTANTIATION.isActive() && Features.FLAG_NETWORK_TO_ASYNC_INSTANTIATION.isActive() ? instantiationTypeNameMacro : oldMacro; + String macroInstantiationAccordingFF = Features.FLAG_NETWORK_TO_ASYNC_INSTANTIATION.isActive() ? instantiationTypeNameMacro : oldMacro; deployServiceAndAssertInstantiationType( "csar15782222_instantiationTypeMacroWithNetwork.zip", invariantUUIDMacro, @@ -406,7 +396,7 @@ public class BrowseASDCTest extends CreateInstanceDialogBaseTest { viewEditPage.selectNodeInstanceToAdd("VID-RODERICK-05-15-17 0"); viewEditPage.generateAndSetInstanceName(Constants.ViewEdit.VNF_INSTANCE_NAME_PREFIX); viewEditPage.selectProductFamily("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"); - viewEditPage.selectLcpRegion("JANET25", "AIC"); + viewEditPage.selectLcpRegion("AAIAIC25", "AIC"); viewEditPage.selectTenant("092eb9e8e4b7412e8787dd091bc58e86"); viewEditPage.setLegacyRegion("llkjhlkjhlkjh"); diff --git a/vid-automation/src/main/java/vid/automation/test/test/ChangeManagementTest.java b/vid-automation/src/main/java/vid/automation/test/test/ChangeManagementTest.java index 179eb968c..2f5489f31 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/ChangeManagementTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/ChangeManagementTest.java @@ -1,54 +1,42 @@ package vid.automation.test.test; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.CoreMatchers.everyItem; -import static org.hamcrest.CoreMatchers.hasItem; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.greaterThan; -import static org.hamcrest.collection.IsEmptyCollection.empty; -import static org.hamcrest.core.IsNot.not; - import com.google.common.collect.ImmutableMap; import com.google.common.primitives.Ints; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; import org.json.JSONException; import org.junit.Assert; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet; import org.onap.sdc.ci.tests.datatypes.UserCredentials; import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.RemoteWebElement; import org.openqa.selenium.support.ui.Select; import org.skyscreamer.jsonassert.JSONAssert; import org.skyscreamer.jsonassert.JSONCompareMode; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterMethod; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.testng.annotations.*; import vid.automation.test.Constants; -import vid.automation.test.infra.Click; -import vid.automation.test.infra.Exists; -import vid.automation.test.infra.Get; -import vid.automation.test.infra.Input; -import vid.automation.test.infra.SelectOption; -import vid.automation.test.infra.Wait; +import vid.automation.test.infra.*; import vid.automation.test.model.User; import vid.automation.test.sections.ChangeManagementPage; import vid.automation.test.services.SimulatorApi; import vid.automation.test.utils.DB_CONFIG; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static org.hamcrest.CoreMatchers.*; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.greaterThan; +import static org.hamcrest.collection.IsEmptyCollection.empty; +import static org.hamcrest.core.IsNot.not; + public class ChangeManagementTest extends VidBaseTestCase { public static final String SCHEDULED_ID = "0b87fe60-50b0-4bac-a0a7-49e951b0ba9e"; diff --git a/vid-automation/src/main/java/vid/automation/test/test/CreateInstanceDialogBaseTest.java b/vid-automation/src/main/java/vid/automation/test/test/CreateInstanceDialogBaseTest.java index 0837f79ca..df3b41d06 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/CreateInstanceDialogBaseTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/CreateInstanceDialogBaseTest.java @@ -108,7 +108,7 @@ public class CreateInstanceDialogBaseTest extends VidBaseTestCase { } protected void addVNF(String name, String lcpRegion, String cloudOwner, String tenant, String suppressRollback, - String legacyRegion, String productFamily, String platform, ArrayList<String> permittedTenants, List<String> lobs, ServiceModel serviceModel, String instanceName) { + String legacyRegion, String productFamily, String platform, ArrayList<String> permittedTenants, String lobs, ServiceModel serviceModel, String instanceName) { openAndFillVnfPopup(name, lcpRegion, cloudOwner, tenant, suppressRollback, legacyRegion, productFamily, platform,permittedTenants, lobs, serviceModel, instanceName); viewEditPage.clickConfirmButton(); successConfirmVnfAndClosePopup(); @@ -116,7 +116,7 @@ public class CreateInstanceDialogBaseTest extends VidBaseTestCase { } protected void openAndFillVnfPopup(String name, String lcpRegion, String cloudOwner, String tenant, String suppressRollback, - String legacyRegion, String productFamily, String platform, ArrayList<String> permittedTenants, List<String> lobs, ServiceModel serviceModel, String instanceName) { + String legacyRegion, String productFamily, String platform, ArrayList<String> permittedTenants, String lobs, ServiceModel serviceModel, String instanceName) { viewEditPage.selectNodeInstanceToAdd(name); GeneralUIUtils.ultimateWait(); if(serviceModel != null) { @@ -130,7 +130,7 @@ public class CreateInstanceDialogBaseTest extends VidBaseTestCase { Click.onFirstSelectOptionById(Constants.OwningEntity.PLATFORM_SELECT_TEST_ID); } if(lobs != null) { - SelectOption.selectOptionsFromMultiselectById(Constants.OwningEntity.LOB_SELECT_TEST_ID, lobs); + viewEditPage.selectLineOfBusiness(lobs); } fillDetailsInDialog(instanceName, lcpRegion, cloudOwner, tenant, suppressRollback, legacyRegion, permittedTenants); } @@ -144,7 +144,7 @@ public class CreateInstanceDialogBaseTest extends VidBaseTestCase { protected void assertConfirmShowMissingDataErrorOnCurrentPopup(String field) { viewEditPage.clickConfirmButton(); boolean byclassAndText = Exists.byClassAndText(Constants.ViewEdit.ERROR_CLASS, String.format(Constants.MISSING_DATA, field)); - Assert.assertFalse(field + " " + Constants.REQUIRED, byclassAndText); + Assert.assertTrue(field + " " + Constants.REQUIRED, byclassAndText); } protected void cancelPopup() { diff --git a/vid-automation/src/main/java/vid/automation/test/test/CreateNewInstanceTest.java b/vid-automation/src/main/java/vid/automation/test/test/CreateNewInstanceTest.java index bb13514bf..b57d18789 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/CreateNewInstanceTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/CreateNewInstanceTest.java @@ -1,7 +1,5 @@ package vid.automation.test.test; -import java.io.IOException; -import java.util.List; import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.openqa.selenium.WebElement; import org.testng.Assert; @@ -18,6 +16,9 @@ import vid.automation.test.services.BulkRegistration; import vid.automation.test.services.ServicesService; import vid.automation.test.services.SimulatorApi; +import java.io.IOException; +import java.util.List; + public class CreateNewInstanceTest extends CreateInstanceDialogBaseTest { private ServicesService servicesService = new ServicesService(); diff --git a/vid-automation/src/main/java/vid/automation/test/test/CreatePortMirroringConfigurationTest.java b/vid-automation/src/main/java/vid/automation/test/test/CreatePortMirroringConfigurationTest.java index 89e28d7a6..835aacd3e 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/CreatePortMirroringConfigurationTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/CreatePortMirroringConfigurationTest.java @@ -1,8 +1,6 @@ package vid.automation.test.test; import com.google.common.collect.ImmutableMap; -import java.util.HashMap; -import java.util.Map; import org.junit.Assert; import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.openqa.selenium.WebElement; @@ -18,6 +16,9 @@ import vid.automation.test.sections.ViewEditPage; import vid.automation.test.services.BulkRegistration; import vid.automation.test.services.SimulatorApi; +import java.util.HashMap; +import java.util.Map; + public class CreatePortMirroringConfigurationTest extends VidBaseTestCase { private ViewEditPage viewEditPage = new ViewEditPage(); @@ -311,7 +312,7 @@ public class CreatePortMirroringConfigurationTest extends VidBaseTestCase { createConfigurationPage.assertButtonState(Constants.ConfigurationCreation.TENANT_DROPDOWN_TEST_ID,false); //WebElement tenantDDL= Get.byTestId(Constants.ConfigurationCreation.TENANT_DROPDOWN_TEST_ID); - createConfigurationPage.chooseRegion("JANET25"); + createConfigurationPage.chooseRegion("AAIAIC25"); GeneralUIUtils.ultimateWait(); // Wait.waitByTestId(Constants.ConfigurationCreation.TENANT_DROPDOWN_TEST_ID, 30); createConfigurationPage.chooseTenant("USP-SIP-IC-24335-T-01"); @@ -319,7 +320,7 @@ public class CreatePortMirroringConfigurationTest extends VidBaseTestCase { } private void assertFormFields() { Assert.assertEquals("dummy_instance",createConfigurationPage.getInstanceName()); - Assert.assertEquals("JANET25", createConfigurationPage.getRegion()); + Assert.assertEquals("AAIAIC25", createConfigurationPage.getRegion()); Assert.assertEquals("USP-SIP-IC-24335-T-01",createConfigurationPage.getTenant()); createConfigurationPage.assertButtonState(Constants.ConfigurationCreation.NEXT_BUTTON_TEST_ID,true); diff --git a/vid-automation/src/main/java/vid/automation/test/test/DeleteResumeTest.java b/vid-automation/src/main/java/vid/automation/test/test/DeleteResumeTest.java index 55ab567dc..a334646cc 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/DeleteResumeTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/DeleteResumeTest.java @@ -16,7 +16,7 @@ public class DeleteResumeTest extends CreateInstanceDialogBaseTest { SimulatorApi.clearAll(); BulkRegistration.resumeVfModule(serviceInstanceId,vnfInstanceId); navigateToViewEditPageOfuspVoiceVidTest444("240376de-870e-48df-915a-31f140eedd2c"); - resumeVFModule("aa","JANET25", "AIC", "092eb9e8e4b7412e8787dd091bc58e86","mdt1",user.tenants); + resumeVFModule("aa","AAIAIC25", "AIC", "092eb9e8e4b7412e8787dd091bc58e86","mdt1",user.tenants); } }
\ No newline at end of file diff --git a/vid-automation/src/main/java/vid/automation/test/test/DrawingBoardTest.java b/vid-automation/src/main/java/vid/automation/test/test/DrawingBoardTest.java index bacd83155..fa7181c89 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/DrawingBoardTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/DrawingBoardTest.java @@ -1,43 +1,27 @@ package vid.automation.test.test; -import static org.testng.AssertJUnit.assertFalse; -import static vid.automation.test.Constants.DrawingBoard.AVAILABLE_MODELS_TREE; -import static vid.automation.test.Constants.DrawingBoard.BACK_BUTTON; -import static vid.automation.test.Constants.DrawingBoard.CONTEXT_MENU_BUTTON_HEADER; -import static vid.automation.test.Constants.DrawingBoard.CONTEXT_MENU_HEADER_EDIT_ITEM; -import static vid.automation.test.Constants.DrawingBoard.DEFAULT_SERVICE_NAME; -import static vid.automation.test.Constants.DrawingBoard.DRAWING_BOARD_TREE; -import static vid.automation.test.Constants.DrawingBoard.SEARCH_LEFT_TREE; -import static vid.automation.test.Constants.DrawingBoard.SERVICE_QUANTITY; -import static vid.automation.test.infra.Features.FLAG_ASYNC_INSTANTIATION; -import static vid.automation.test.infra.ModelInfo.macroDrawingBoardComplexService; -import static vid.automation.test.infra.ModelInfo.macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetails; - import com.google.common.collect.ImmutableList; +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateServiceInstanceGen2; import org.onap.sdc.ci.tests.datatypes.UserCredentials; import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateServiceInstanceGen2; import org.openqa.selenium.WebDriver; import org.testng.Assert; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import vid.automation.test.Constants; -import vid.automation.test.infra.Click; -import vid.automation.test.infra.Exists; -import vid.automation.test.infra.FeatureTogglingTest; -import vid.automation.test.infra.Get; -import vid.automation.test.infra.Input; -import vid.automation.test.infra.ModelInfo; -import vid.automation.test.infra.SelectOption; -import vid.automation.test.infra.Wait; +import vid.automation.test.infra.*; import vid.automation.test.model.User; import vid.automation.test.sections.BrowseASDCPage; import vid.automation.test.sections.DrawingBoardPage; import vid.automation.test.sections.VidBasePage; -@FeatureTogglingTest(FLAG_ASYNC_INSTANTIATION) +import static org.testng.AssertJUnit.assertFalse; +import static vid.automation.test.Constants.DrawingBoard.*; +import static vid.automation.test.infra.ModelInfo.macroDrawingBoardComplexService; +import static vid.automation.test.infra.ModelInfo.macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetails; + public class DrawingBoardTest extends VidBaseTestCase { private DrawingBoardPage drawingBoardPage = new DrawingBoardPage(); diff --git a/vid-automation/src/main/java/vid/automation/test/test/EnvironmentsTest.java b/vid-automation/src/main/java/vid/automation/test/test/EnvironmentsTest.java index f21a76d83..03378b615 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/EnvironmentsTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/EnvironmentsTest.java @@ -5,7 +5,6 @@ import org.junit.Assert; import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.openqa.selenium.WebElement; import org.springframework.http.HttpStatus; -import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -71,7 +70,7 @@ public class EnvironmentsTest extends VidBaseTestCase { GET_STATUS_FAILURE } - @BeforeClass + @BeforeMethod //Sometimes we clear registration while we are in view/edit page //And there is alert so we can not navigate any more. //So we first navigate to welcome page, and only the, clear registration @@ -200,6 +199,10 @@ public class EnvironmentsTest extends VidBaseTestCase { String environmentTypeDefault = Get.selectedOptionText(Constants.TestEnvironments.ENVIRONMENT_TYPE_DROP_DOWN); Assert.assertEquals(environment.operationalEnvironmentType, environmentTypeDefault); + if (Features.FLAG_1908_RELEASE_TENANT_ISOLATION.isActive()) { + SelectOption.byTestIdAndVisibleText(environment.release, Constants.TestEnvironments.ENVIRONMENT_RELEASE); + environment.workloadContext = environment.workloadContext.concat("_" + environment.release); + } SelectOption.byTestIdAndVisibleText(environment.workloadContext, Constants.TestEnvironments.WORKLOAD_CONTEXT_DROP_DOWN); WebElement submitButton = Get.byTestId(Constants.TestEnvironments.SUBMIT_BUTTON); @@ -212,14 +215,14 @@ public class EnvironmentsTest extends VidBaseTestCase { GeneralUIUtils.ultimateWait(); // refresh table - Map <String, List<String>> file = ReadFile.getJsonFile(ENVIRONMENTS_CONF, Map.class); + Map <String, List<List<String>>> file = ReadFile.getJsonFile(ENVIRONMENTS_CONF, Map.class); String tableId = Constants.TestEnvironments.ENVIRONMENTS_TABLE; SimulatorApi.registerExpectation(GET_FULL_OPERATIONAL_ENVIRONMENT_JSON, ImmutableMap.of("new_name", environment.operationalEnvironmentName, "new_tenant", environment.tenantContext, "new_ecomp_id", environment.EcompEnvironmentId, "new_ecomp_name", environment.EcompEnvironmentName, "new_workload_context", environment.workloadContext), SimulatorApi.RegistrationStrategy.APPEND); Click.byTestId(REFRESH_BUTTON); Wait.angularHttpRequestsLoaded(); List<List<String>> body = Get.tableBodyValuesByTestId(tableId); - Assert.assertEquals(file.get(Constants.TestEnvironments.FULL_LIST), body); + Assert.assertEquals(file.get(fullListId()), body); GeneralUIUtils.ultimateWait(); } @@ -277,7 +280,7 @@ public class EnvironmentsTest extends VidBaseTestCase { Click.byId(Constants.generalSubmitButtonId); SimulatorApi.registerExpectation("environment/activate/get_operational_environments_aai1.json", - ImmutableMap.of("Deactivate", "Activate"), SimulatorApi.RegistrationStrategy.APPEND); + ImmutableMap.of("INACTIVE", "ACTIVE"), SimulatorApi.RegistrationStrategy.APPEND); boolean waitForTextResult = Wait.waitByClassAndText("status", Constants.TestEnvironments.environmentActivatedSuccesfullyMessage, 60); assertTrue(Constants.TestEnvironments.environmentActivatedSuccesfullyMessage + " message didn't appear on time", waitForTextResult); @@ -290,7 +293,7 @@ public class EnvironmentsTest extends VidBaseTestCase { assertTrue("Failed to find Deactivate button for test env with id: "+envId, deactivationButton.isDisplayed()); WebElement status = Get.byId(Constants.TestEnvironments.environmentStatusIdPrefix + envId); - assertEquals("Active", status.getText()); + assertEquals("ACTIVE", status.getText()); WebElement attachButton = TestEnvironmentPage.getTestEnvironmentAttachButton(envId); assertTrue("Failed to find Attach button for test env with id: "+envId, attachButton.isDisplayed()); @@ -321,7 +324,7 @@ public class EnvironmentsTest extends VidBaseTestCase { assertTrue("Failed to find Activate button for test env with id: "+envId, activationButton.isDisplayed()); WebElement status = Get.byId(Constants.TestEnvironments.environmentStatusIdPrefix + envId); - assertEquals("Inactive", status.getText()); + assertEquals("INACTIVE", status.getText()); WebElement attachButton = TestEnvironmentPage.getTestEnvironmentAttachButton(envId); assertFalse("attach button shouldn't be displayed for test env with id: "+envId, attachButton.isDisplayed()); @@ -500,5 +503,11 @@ public class EnvironmentsTest extends VidBaseTestCase { SideMenu.navigateToTestEnvironmentsPage(); } + private String fullListId() { + return Features.FLAG_1908_RELEASE_TENANT_ISOLATION.isActive() ? + Constants.TestEnvironments.FULL_LIST : Constants.TestEnvironments.FULL_LIST_WITHOUT_RELEASE_LABEL; + } + + } diff --git a/vid-automation/src/main/java/vid/automation/test/test/InstantiationStatusTest.java b/vid-automation/src/main/java/vid/automation/test/test/InstantiationStatusTest.java index a3480f8c2..4eb637a10 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/InstantiationStatusTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/InstantiationStatusTest.java @@ -1,39 +1,34 @@ package vid.automation.test.test; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.SERVICE_NAME; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.VNF_NAME; -import static org.testng.Assert.assertEquals; -import static org.testng.AssertJUnit.assertTrue; -import static vid.automation.test.Constants.DrawingBoard.DEPLOY_BUTTON; -import static vid.automation.test.infra.Features.FLAG_ASYNC_INSTANTIATION; - import com.google.common.collect.ImmutableMap; -import java.util.Collections; 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.mso.PresetMSOServiceInstanceGen2WithNames; import org.onap.vid.api.AsyncInstantiationBase; import org.onap.vid.api.CreateServiceWithFailedVnf; import org.onap.vid.api.TestUtils; +import org.onap.sdc.ci.tests.datatypes.UserCredentials; +import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import vid.automation.test.Constants; -import vid.automation.test.infra.Click; -import vid.automation.test.infra.FeatureTogglingTest; -import vid.automation.test.infra.Features; -import vid.automation.test.infra.Get; -import vid.automation.test.infra.Wait; +import vid.automation.test.infra.*; import vid.automation.test.sections.DrawingBoardPage; import vid.automation.test.sections.InstantiationStatusPage; import vid.automation.test.sections.SideMenu; import vid.automation.test.sections.VidBasePage; import vid.automation.test.services.AsyncJobsService; -@FeatureTogglingTest(FLAG_ASYNC_INSTANTIATION) +import java.util.Collections; + +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.SERVICE_NAME; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.VNF_NAME; +import static org.testng.Assert.assertEquals; +import static org.testng.AssertJUnit.assertTrue; +import static vid.automation.test.Constants.DrawingBoard.DEPLOY_BUTTON; + public class InstantiationStatusTest extends VidBaseTestCase { private final String serviceModelVersion = "5.1"; diff --git a/vid-automation/src/main/java/vid/automation/test/test/NewServiceInstanceTest.java b/vid-automation/src/main/java/vid/automation/test/test/NewServiceInstanceTest.java index 42749c15f..9b1956d30 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/NewServiceInstanceTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/NewServiceInstanceTest.java @@ -1,64 +1,19 @@ package vid.automation.test.test; -import static junit.framework.TestCase.assertNull; -import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.startsWith; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.PRESET_SOME_LEGACY_REGION_TO_ATT_AIC; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet.COMPLETE; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet.DEFAULT_SERVICE_INSTANCE_ID; -import static org.testng.Assert.assertEquals; -import static org.testng.AssertJUnit.assertTrue; -import static vid.automation.test.infra.Features.FLAG_1902_VNF_GROUPING; -import static vid.automation.test.infra.Features.FLAG_5G_IN_NEW_INSTANTIATION_UI; -import static vid.automation.test.infra.Features.FLAG_ASYNC_INSTANTIATION; -import static vid.automation.test.infra.ModelInfo.PASQUALEVmxVpeBvService488Annotations; -import static vid.automation.test.infra.ModelInfo.aLaCarteNetworkProvider5G; -import static vid.automation.test.infra.ModelInfo.aLaCarteVnfGroupingService; -import static vid.automation.test.infra.ModelInfo.macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetails; -import static vid.automation.test.infra.ModelInfo.macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetailsVnfEcompNamingFalse; -import static vid.automation.test.infra.ModelInfo.macroSriovWithDynamicFieldsEcompNamingFalsePartialModelDetailsVnfEcompNamingFalse; -import static vid.automation.test.infra.ModelInfo.macroSriovWithDynamicFieldsEcompNamingTruePartialModelDetails; -import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; -import static vid.automation.test.services.SimulatorApi.registerExpectationFromPreset; -import static vid.automation.test.services.SimulatorApi.registerExpectationFromPresets; -import static vid.automation.test.test.ALaCarteflowTest.AIC; - +//import com.automation.common.report_portal_integration.annotations.Step; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.UUID; -import java.util.stream.Collectors; import org.apache.commons.lang3.mutable.MutableInt; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.hamcrest.Matchers; -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.PresetAAIGetTenants; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIPostNamedQueryForViewEdit; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSOBaseCreateInstancePost; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateNetworkALaCarte5G; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateServiceInstanceAlacarte5GServiceWithNetwork; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateServiceInstanceGen2WithNamesAlacarteGroupingService; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork; +import org.onap.simulator.presetGenerator.presets.aai.*; +import org.onap.simulator.presetGenerator.presets.mso.*; import org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork.ResponseDetails; import org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys; +import org.onap.sdc.ci.tests.datatypes.UserCredentials; +import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.RemoteWebElement; @@ -69,33 +24,44 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import vid.automation.test.Constants; import vid.automation.test.Constants.BrowseASDC.NewServicePopup; -import vid.automation.test.infra.Click; -import vid.automation.test.infra.FeatureTogglingTest; -import vid.automation.test.infra.Features; -import vid.automation.test.infra.Get; -import vid.automation.test.infra.Input; -import vid.automation.test.infra.ModelInfo; -import vid.automation.test.infra.SelectOption; -import vid.automation.test.infra.Wait; +import vid.automation.test.infra.*; import vid.automation.test.model.Service; import vid.automation.test.model.User; -import vid.automation.test.sections.BrowseASDCPage; -import vid.automation.test.sections.DrawingBoardPage; -import vid.automation.test.sections.InstantiationStatusPage; -import vid.automation.test.sections.SideMenu; -import vid.automation.test.sections.VidBasePage; +import vid.automation.test.sections.*; import vid.automation.test.services.AsyncJobsService; import vid.automation.test.services.ServicesService; import vid.automation.test.services.SimulatorApi; +import vid.automation.test.test.NewServiceInstanceTest.ServiceData.IS_GENERATED_NAMING; import vid.automation.test.utils.ReadFile; -@FeatureTogglingTest(FLAG_ASYNC_INSTANTIATION) +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +import static junit.framework.TestCase.assertNull; +import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; +import static org.hamcrest.CoreMatchers.startsWith; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.PRESET_SOME_LEGACY_REGION_TO_ATT_AIC; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet.COMPLETE; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet.DEFAULT_SERVICE_INSTANCE_ID; +import static org.testng.Assert.assertEquals; +import static org.testng.AssertJUnit.assertTrue; +import static vid.automation.test.infra.Features.*; +import static vid.automation.test.infra.ModelInfo.*; +import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; +import static vid.automation.test.services.SimulatorApi.registerExpectationFromPreset; +import static vid.automation.test.services.SimulatorApi.registerExpectationFromPresets; +import static vid.automation.test.test.ALaCarteflowTest.AIC; + public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { - private static final String COMPLETED = "COMPLETED"; + public static final String COMPLETED = "COMPLETED"; private static final String IN_PROGRESS = "IN_PROGRESS"; private static final String PENDING = "PENDING"; - private final String vfModule0Name = "2017488_PASQUALEvpe0..2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0"; + private final String vfModule0Name = "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0"; private final String vfModule0UUID = "f8360508-3f17-4414-a2ed-6bc71161e8db"; private ServicesService servicesService = new ServicesService(); private DrawingBoardPage drawingBoardPage = new DrawingBoardPage(); @@ -215,13 +181,13 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { ServiceData serviceData = new ServiceData( macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetails.modelVersionId, new ArrayList<>(), - false, true, true, true, + IS_GENERATED_NAMING.FALSE, true, true, true, "2017-488_PASQUALE-vPE 0", - "2017488_PASQUALEvpe0..2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1", 0, 1, new ArrayList<>(), "25284168-24bb-4698-8cb4-3f509146eca5"); + "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1", 0, 1, new ArrayList<>(), "25284168-24bb-4698-8cb4-3f509146eca5"); prepareServicePreset(macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetails, false); - final String serviceInstanceName = createSriovService(serviceData, true); + final String serviceInstanceName = createMacroService(serviceData, true); createVnf(serviceData, true, true, serviceInstanceName); createVfModule(serviceData, serviceInstanceName, false, false); @@ -261,19 +227,19 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { ServiceData serviceData = new ServiceData( macroSriovWithDynamicFieldsEcompNamingFalsePartialModelDetailsVnfEcompNamingFalse.modelVersionId, - Collections.singletonList("2017488 PASQUALEvpe0 asn:"), - false, false, true, false, + Collections.singletonList("2017488 pasqualevpe0 asn:"), + IS_GENERATED_NAMING.FALSE, false, true, false, "2017-488_PASQUALE-vPE 0", - "2017488_PASQUALEvpe0..2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1", 0, 1, ImmutableList.of("Bandwidth", "Bandwidth units"), + "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1", 0, 1, ImmutableList.of("Bandwidth", "Bandwidth units"), "25284168-24bb-4698-8cb4-3f509146eca5"); - // this is the instance-name that createSriovService is going to use + // this is the instance-name that createMacroService is going to use String serviceInstanceName = randomAlphabetic + "instancename"; doReduxStep(reduxStates, randomAlphabetic, startInStep, reduxForStep, i, mode, () -> { prepareServicePreset(macroSriovWithDynamicFieldsEcompNamingFalsePartialModelDetailsVnfEcompNamingFalse, false); - createSriovService(serviceData, false, randomAlphabetic); + createMacroService(serviceData, false, randomAlphabetic, true, 3); }); doReduxStep(reduxStates, randomAlphabetic, startInStep, reduxForStep, i, mode, () -> @@ -295,9 +261,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { doReduxStep(reduxStates, randomAlphabetic, startInStep, reduxForStep, i, mode, () -> { editVfModuleAndJustSetName(vfModule0Name, vfModule0UUID); - if (Features.FLAG_DUPLICATE_VNF.isActive()) { - duplicateVnf(serviceData.vnfData, 2); - } + duplicateVnf(serviceData.vnfData, 2); vidBasePage.screenshotDeployDialog(serviceInstanceName); }); @@ -305,8 +269,8 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { prepareServicePreset(macroSriovWithDynamicFieldsEcompNamingFalsePartialModelDetailsVnfEcompNamingFalse, true); - final String vfModuleName1 = "2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0"; - final String vfModuleName2 = "2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1"; + final String vfModuleName1 = "2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0"; + final String vfModuleName2 = "2017488PasqualeVpe..PASQUALE_vRE_BV..module-1"; final String request1 = PresetMSOBaseCreateInstancePost.DEFAULT_REQUEST_ID; final String request2 = "ce010256-3fdd-4cb5-aed7-37112a2c6e93"; final ImmutableMap<Keys, String> vars = ImmutableMap.<Keys, String>builder() @@ -333,6 +297,97 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { } @Test + @FeatureTogglingTest(FLAG_1908_INFRASTRUCTURE_VPN) + public void createNewServiceInstance_infraStructureVpn() { + String requestId = UUID.randomUUID().toString(); + String instanceId = UUID.randomUUID().toString(); + + prepareServicePreset(infrastructureVpnService, false); + + SimulatorApi.registerExpectationFromPresets(ImmutableList.of( + PresetAAIGetCloudOwnersByCloudRegionId.PRESET_MTN6_TO_ATT_AIC, + new PresetAAIGetL3NetworksByCloudRegionSpecificState("irma-aic", "hvf6", "AIN Web Tool-15-D-testalexandria"), + new PresetAAIGetVpnsByType() + ), APPEND); + + ServiceData serviceData = new ServiceData( + infrastructureVpnService.modelVersionId, + new ArrayList<>(), + IS_GENERATED_NAMING.TRUE_BUT_GIVE_NAME_EITHER_WAY, true, true, false, + null, + null, 0, 1, new ArrayList<>(), null); + final String serviceInstanceName = createMacroService(serviceData, false); + + SimulatorApi.registerExpectationFromPresets(ImmutableList.of( + PresetMsoCreateMacroCommonPre1806.ofServiceWithVRF(requestId, instanceId, serviceInstanceName), + new PresetMSOOrchestrationRequestGet(COMPLETE, requestId) + ), APPEND); + + // Wizard pages of Network and VPN + Click.byTestIdOnceItsAvailable("10a74149-c9d7-4918-bbcf-d5fb9b1799ce", 20); + Click.byTestId("setMembersBtn"); + GeneralUIUtils.ultimateWait(); + + Click.byTestIdOnceItsAvailable("120d39fb-3627-473d-913c-d228dd0f8e5b", 20); + Click.byTestId("setMembersBtn"); + GeneralUIUtils.ultimateWait(); + + Assert.assertEquals(Get.byTestId("node-type-indicator").getText(),"VRF"); + + drawingBoardPage.deploy(); + drawingBoardPage.verifyServiceCompletedOnTime(serviceInstanceName, "Service "+serviceInstanceName); + } + + @Test + @FeatureTogglingTest(FLAG_1908_COLLECTION_RESOURCE_NEW_INSTANTIATION_UI) + public void createNewServiceInstance_collectionResource() { + prepareServicePreset(collectionResourceService, false); + String requestId = UUID.randomUUID().toString(); + String instanceId = UUID.randomUUID().toString(); + + SimulatorApi.registerExpectationFromPresets(ImmutableList.of( + PresetAAIGetCloudOwnersByCloudRegionId.PRESET_MTN6_TO_ATT_AIC, + PresetMsoCreateMacroCommonPre1806.ofCollectionResource(requestId, instanceId), + new PresetMSOOrchestrationRequestGet(COMPLETE, requestId) + ), APPEND); + + ServiceData serviceData = new ServiceData( + collectionResourceService.modelVersionId, + new ArrayList<>(), + IS_GENERATED_NAMING.TRUE, true, true, false, + null, + null, 0, 1, new ArrayList<>(), null); + createMacroService(serviceData, false, randomAlphabetic(5), true, 1); + + drawingBoardPage.deploy(); + drawingBoardPage.verifyServiceCompletedOnTime("CR_sanity", "service with collection resource"); + } + + @Test + @FeatureTogglingTest(FLAG_1908_TRANSPORT_SERVICE_NEW_INSTANTIATION_UI) + public void createNewServiceInstance_transportService() { + prepareServicePreset(transportWithPnfsService, false); + String requestId = UUID.randomUUID().toString(); + String instanceId = UUID.randomUUID().toString(); + + SimulatorApi.registerExpectationFromPresets(ImmutableList.of( + PresetMsoCreateMacroCommonPre1806.ofTransportService(requestId, instanceId), + new PresetMSOOrchestrationRequestGet(COMPLETE, requestId) + ), APPEND); + + ServiceData serviceData = new ServiceData( + transportWithPnfsService.modelVersionId, + new ArrayList<>(), + IS_GENERATED_NAMING.TRUE, true, true, false, + null, + null, 0, 1, new ArrayList<>(), null); + createMacroService(serviceData, false, randomAlphabetic(5), false, 1); + + drawingBoardPage.deploy(); + drawingBoardPage.verifyServiceCompletedOnTime("AIM Transport SVC_ym161f", "transport service"); + } + + @Test @FeatureTogglingTest(FLAG_1902_VNF_GROUPING) public void createNewServiceInstance_aLaCarte_VnfGrouping() { @@ -341,7 +396,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { ServiceData serviceData = new ServiceData( aLaCarteVnfGroupingService.modelVersionId, ImmutableList.of(), - false, false, true, false, + IS_GENERATED_NAMING.FALSE, false, true, false, null, null, 0, 1, ImmutableList.of(), null); prepareServicePreset(aLaCarteVnfGroupingService, false); @@ -360,7 +415,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { new PresetAAIPostNamedQueryForViewEdit(serviceInstanceId, serviceInstanceName, false, false) ), SimulatorApi.RegistrationStrategy.APPEND); - deploy(); + drawingBoardPage.deploy(); verifyModuleInPendingTable(serviceInstanceName, requestId, null, ImmutableSet.of(IN_PROGRESS), false, false); verifyModuleInPendingTable(serviceInstanceName, requestId, null, ImmutableSet.of(COMPLETED), false, true); InstantiationStatusPage.verifyOpenNewViewEdit(serviceInstanceName, serviceInstanceId, aLaCarteVnfGroupingService.modelVersionId, "TYLER SILVIA", "e433710f-9217-458d-a79d-1c7aff376d89", "EDIT"); @@ -379,20 +434,20 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { return; } else if (currentStep.getValue() == startInStep) { - setReduxState(reduxForStep); + vidBasePage.setReduxState(reduxForStep); vidBasePage.navigateTo("serviceModels.htm#/servicePlanning?serviceModelId=6b528779-44a3-4472-bdff-9cd15ec93450"); vidBasePage.goToIframe(); } - reduxStates.put(String.valueOf(currentStep), getReduxState()); + reduxStates.put(String.valueOf(currentStep), vidBasePage.getReduxState()); break; case "RUNTIME": default: // log current redux state, before invocation - reduxStates.put(String.valueOf(currentStep), getReduxState()); - logger.info("reduxGator runtime reduxState for step {}:\n{}", currentStep, getReduxState()); + reduxStates.put(String.valueOf(currentStep), vidBasePage.getReduxState()); + logger.info("reduxGator runtime reduxState for step {}:\n{}", currentStep, vidBasePage.getReduxState()); break; } @@ -403,7 +458,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { "Current step: " + currentStep, "Random alphabetic: " + randomAlphabetic, "Starting reduxState: " + reduxStates.get(String.valueOf(currentStep)), - "Current reduxState: " + getReduxState() + "Current reduxState: " + vidBasePage.getReduxState() ), e); } } finally { @@ -412,6 +467,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { } } + //@Step("duplicate vnf") private void duplicateVnf(VnfData vnfData, int count) { hoverAndClickDuplicateButton(extractNodeToEdit(vnfData)); vidBasePage.screenshotDeployDialog("duplicateVnf-" + vnfData.vnfName); @@ -425,6 +481,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { return String.join("", s).replace(" ", ""); } + //@Step("edit vf module and just set name") private void editVfModuleAndJustSetName(String vfModuleName, String vfModuleUUID) { if (Features.FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD.isActive()) { hoverAndClickEditButton(vfModuleUUID + "-" + vfModuleName); @@ -432,7 +489,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { drawingBoardPage.clickAddButtonByNodeName(vfModuleName); } Input.text("VF instance name ZERO", "instanceName"); - Click.byTestId("form-set"); + Click.byTestId(VNF_SET_BUTTON_TEST_ID); } @Test @@ -440,13 +497,13 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { ServiceData serviceData = new ServiceData( macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetails.modelVersionId, new ArrayList<>(), - false, true, false, true, + IS_GENERATED_NAMING.FALSE, true, false, true, "2017-488_PASQUALE-vPE 0", vfModule0Name, 1, 1, new ArrayList<>(), vfModule0UUID); prepareServicePreset(macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetails, false); - final String serviceInstanceName = createSriovService(serviceData, true); + final String serviceInstanceName = createMacroService(serviceData, true); createVnf(serviceData, true, true, serviceInstanceName); createVfModule(serviceData, serviceInstanceName, true, false); @@ -457,13 +514,13 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { ServiceData serviceData = new ServiceData( macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetailsVnfEcompNamingFalse.modelVersionId, new ArrayList<>(), - false, false, false, false, + IS_GENERATED_NAMING.FALSE, false, false, false, "2017-488_PASQUALE-vPE 0", vfModule0Name, 1, 1, new ArrayList<>(), vfModule0UUID); prepareServicePreset(macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetailsVnfEcompNamingFalse, false); - final String serviceInstanceName = createSriovService(serviceData, true); + final String serviceInstanceName = createMacroService(serviceData, true); createVnf(serviceData, true, true, serviceInstanceName); createVfModule(serviceData, serviceInstanceName, true, false); @@ -474,13 +531,13 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { ServiceData serviceData = new ServiceData( macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetailsVnfEcompNamingFalse.modelVersionId, new ArrayList<>(), - false, false, true, false, + IS_GENERATED_NAMING.FALSE, false, true, false, "2017-488_PASQUALE-vPE 0", - "2017488_PASQUALEvpe0..2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1", 0, 1, new ArrayList<>(), "25284168-24bb-4698-8cb4-3f509146eca5"); + "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1", 0, 1, new ArrayList<>(), "25284168-24bb-4698-8cb4-3f509146eca5"); prepareServicePreset(macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetailsVnfEcompNamingFalse, false); - final String serviceInstanceName = createSriovService(serviceData, true); + final String serviceInstanceName = createMacroService(serviceData, true); createVnf(serviceData, true, true, serviceInstanceName); clickRemoveVfModule(vfModule0UUID, vfModule0Name); createVfModule(serviceData, serviceInstanceName, false, true); @@ -530,71 +587,47 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { browseASDCPage.goToIframe(); VnfData networkData = new VnfData("SR-IOV Provider-1", "840ffc47-e4cf-46de-8e23-525fd8c6fdc3", defactoNetworkInstanceName, false); createNetwork(networkData, false, false, serviceInstanceName); - drawingBoardPage.clickDeployButton(); - - VidBasePage.goOutFromIframe(); - GeneralUIUtils.ultimateWait(); - vidBasePage.goToIframe(); - GeneralUIUtils.ultimateWait(); - DrawingBoardPage.ServiceStatusChecker serviceStatusChecker = new DrawingBoardPage.ServiceStatusChecker(serviceInstanceName, Collections.singleton(COMPLETED)); - boolean statusIsShown = Wait.waitFor(serviceStatusChecker, null, 20, 2); - assertTrue("service "+serviceInstanceName+" wasnt completed after in time", statusIsShown); - - VidBasePage.goOutFromIframe(); + drawingBoardPage.deploy(); + drawingBoardPage.verifyServiceCompletedOnTime(serviceInstanceName, "service "+serviceInstanceName); } @Test public void createNewServiceInstance_macro_validPopupDataAndUI() { - List<String> serviceDynamicFields = Arrays.asList("2017488 PASQUALEvpe0 asn:"); + List<String> serviceDynamicFields = Arrays.asList("2017488 pasqualevpe0 asn:"); ServiceData serviceData = new ServiceData( macroSriovWithDynamicFieldsEcompNamingTruePartialModelDetails.modelVersionId, serviceDynamicFields, - true, true, true, false, + IS_GENERATED_NAMING.TRUE, true, true, false, "2017-488_PASQUALE-vPE 0", - "2017488_PASQUALEvpe0..2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1", 0, 1, new ArrayList<>(), "25284168-24bb-4698-8cb4-3f509146eca5"); + "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1", 0, 1, new ArrayList<>(), "25284168-24bb-4698-8cb4-3f509146eca5"); prepareServicePreset(macroSriovWithDynamicFieldsEcompNamingTruePartialModelDetails, false); - final String serviceInstanceName = createSriovService(serviceData, true); + final String serviceInstanceName = createMacroService(serviceData, true); createVnf(serviceData, true, true, serviceInstanceName); clickRemoveVfModule(vfModule0UUID, vfModule0Name); createVfModule(serviceData, serviceInstanceName, false, false); } + //@Step("deploy and verify module in pending table") private void deployAndVerifyModuleInPendingTableMacro(String serviceInstanceName, String requestId1, String requestId2) { - deploy(); + drawingBoardPage.deploy(); boolean simulatorUpdated = false; int[] ids = {0, 0, 1, 2}; String[] statuses = {IN_PROGRESS, COMPLETED, IN_PROGRESS, PENDING}; for (int i = 0; i < ids.length; i++) { - String actualInstanceName = getActualInstanceName(serviceInstanceName, ids[i], statuses[i]); + String actualInstanceName = getActualInstanceName(serviceInstanceName, ids[i]); verifyModuleInPendingTable(actualInstanceName, requestId1, requestId2, ImmutableSet.of(statuses[i]), true, simulatorUpdated); simulatorUpdated = true; } vidBasePage.screenshotDeployDialog(serviceInstanceName); } - private void deploy() { - try { - logger.info("Redux state before deploy:"); - logger.info(getReduxState()); - } - catch (Exception e) { - //do nothing just logging - } - drawingBoardPage.clickDeployButton(); - - VidBasePage.goOutFromIframe(); - GeneralUIUtils.ultimateWait(); - vidBasePage.goToIframe(); - GeneralUIUtils.ultimateWait(); - } - private void verifyModuleInPendingTable(String serviceInstanceName, String requestId1, String requestId2, Set<String> expectedStatuses, boolean isMacro, boolean simulatorUpdated) { DrawingBoardPage.ServiceStatusChecker serviceStatusChecker = new DrawingBoardPage.ServiceStatusChecker(serviceInstanceName, expectedStatuses); boolean statusIsShown = Wait.waitFor(serviceStatusChecker, null, 20, 2); @@ -622,15 +655,16 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { vidBasePage.screenshotDeployDialog(serviceInstanceName); } - private String getActualInstanceName(String serviceInstanceName, Integer i, String status) { + private String getActualInstanceName(String serviceInstanceName, Integer i) { return i==0 ? serviceInstanceName : serviceInstanceName + "_00" + i; } + //@Step("verify open view edit") private void verifyOpenViewEdit(String serviceInstanceName) { boolean[] openEnabled = {true, false, false}; String[] statuses = {COMPLETED, IN_PROGRESS, PENDING}; ImmutableList.of(0, 1, 2).forEach(i -> { - String actualInstanceName = getActualInstanceName(serviceInstanceName, i, statuses[i]); + String actualInstanceName = getActualInstanceName(serviceInstanceName, i); if (Features.FLAG_1902_NEW_VIEW_EDIT.isActive()) { InstantiationStatusPage.verifyOpenNewViewEdit(actualInstanceName, openEnabled[i], "EDIT"); } @@ -640,11 +674,12 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { }); } + //@Step("verify open audit info") private void verifyOpenAuditInfo(String serviceInstanceName) { boolean auditInfoEnabled = true; String[] statuses = {COMPLETED, IN_PROGRESS, PENDING}; for (Integer i : ImmutableList.of(0, 1, 2)) { - String actualInstanceName = getActualInstanceName(serviceInstanceName, i, statuses[i]); + String actualInstanceName = getActualInstanceName(serviceInstanceName, i); InstantiationStatusPage.checkMenuItem(actualInstanceName, Constants.InstantiationStatus.CONTEXT_MENU_HEADER_AUDIT_INFO_ITEM, auditInfoEnabled, contextMenuOpen -> { Click.byTestId(contextMenuOpen); checkAuditInfoModal(actualInstanceName, i, statuses); @@ -672,8 +707,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { .collect(Collectors.toList()); List<String> serviceStatus = Arrays.asList(Arrays.copyOfRange(statuses, i, statuses.length)); - assertThat("statuses for " + actualInstanceName + " must be as expected", vidStatuses, is(Lists.reverse(serviceStatus))); - + assertThat("statuses for " + actualInstanceName + " must be as expected", vidStatuses, containsInAnyOrder(serviceStatus.toArray())); String dateString = vidTableElement.findElements(By.id("vidStatusTime")).get(0).getText(); assertTrue("vid Status Time column must contains valid date in format : MMM dd, yyyy HH:mm", isDateValid(dateString, "MMM dd, yyyy HH:mm")); @@ -710,12 +744,14 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { return true; } + //@Step("verifyDeleteJob") private void verifyDeleteJob(String serviceInstanceName) { boolean[] deleteEnabled = {false, false, true}; String[] statuses = {COMPLETED, IN_PROGRESS, PENDING}; verifyDeleteOrHideOperation(serviceInstanceName, Constants.InstantiationStatus.CONTEXT_MENU_REMOVE, statuses, deleteEnabled, "deleted"); } + //@Step("verify hide job") private void verifyHideJob(String serviceInstanceName) { boolean[] hideEnabled = {true, false}; String[] statuses = {COMPLETED, IN_PROGRESS}; @@ -724,7 +760,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { private void verifyDeleteOrHideOperation(String serviceInstanceName, String contextMenuItem, String[] statuses, boolean[] operationEnabled, String operationName) { for (int i = 0; i < statuses.length; i++) { - String actualInstanceName = getActualInstanceName(serviceInstanceName, i, statuses[i]); + String actualInstanceName = getActualInstanceName(serviceInstanceName, i); InstantiationStatusPage.checkMenuItem(actualInstanceName, contextMenuItem, operationEnabled[i], contextMenuDelete -> { Click.byTestId(contextMenuDelete); GeneralUIUtils.ultimateWait(); @@ -766,11 +802,13 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { .build(); } - private String createSriovService(ServiceData serviceData, boolean tryCancelsAndReentries) { - return createSriovService(serviceData, tryCancelsAndReentries, randomAlphabetic(5)); + //@Step("create sriov service") + private String createMacroService(ServiceData serviceData, boolean tryCancelsAndReentries) { + return createMacroService(serviceData, tryCancelsAndReentries, randomAlphabetic(5), true, 3); } - private String createSriovService(ServiceData serviceData, boolean tryCancelsAndReentries, String randomAlphabetic) { + //@Step("create sriov service") + private String createMacroService(ServiceData serviceData, boolean tryCancelsAndReentries, String randomAlphabetic, boolean fillLcpRegionAndTenantAndZone, int bulkSize) { BrowseASDCPage browseASDCPage = new BrowseASDCPage(); User user = usersService.getUser(Constants.Users.SILVIA_ROBBINS_TYLER_SILVIA); @@ -788,14 +826,17 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { WebElement instanceName = Get.byId("instanceName"); boolean isRequired = isElementByIdRequired("instanceName-label"); - if (serviceData.isGeneratedNaming) { + if (serviceData.isGeneratedNaming == IS_GENERATED_NAMING.TRUE || serviceData.isGeneratedNaming == IS_GENERATED_NAMING.TRUE_BUT_GIVE_NAME_EITHER_WAY) { Assert.assertNotNull(instanceName, "instance name input should be visible when serviceEcompNaming == true."); Assert.assertFalse(isRequired,"instance name input should be optional when ecompNaming == true."); - } else { Assert.assertTrue(isRequired,"instance name input should be required when serviceEcompNaming == false."); + } + + if (serviceData.isGeneratedNaming == IS_GENERATED_NAMING.FALSE || serviceData.isGeneratedNaming == IS_GENERATED_NAMING.TRUE_BUT_GIVE_NAME_EITHER_WAY) { instanceName.sendKeys(serviceInstanceName); } + String setButtonTestId = "form-set"; //serviceType should be dependent on subscriber selection assertElementDisabled("serviceType-select"); @@ -816,38 +857,47 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { Wait.waitByClassAndText(Constants.CreateNewInstance.SERVICE_TYPE_OPTION_CLASS, serviceType, 30); browseASDCPage.selectServiceTypeByName(serviceType); - //tenant should be dependent on lcpRegion selection - assertElementDisabled("tenant-select"); + String owningEntity = "WayneHolland"; + GeneralUIUtils.ultimateWait(); + Wait.waitByClassAndText(Constants.CreateNewInstance.OWNING_ENTITY_OPTION, owningEntity, 30); + SelectOption.byTestIdAndVisibleText(owningEntity, (Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID)); + assertSetButtonDisabled(setButtonTestId); - String lcpRegion = "hvf6"; - Wait.waitByClassAndText("lcpRegionOption", lcpRegion, 30); - viewEditPage.selectLcpRegion(lcpRegion, AIC); + SelectOption.byTestIdAndVisibleText("ERICA", Constants.ViewEdit.PRODUCT_FAMILY_SELECT_TESTS_ID); + browseASDCPage.selectProductFamily("e433710f-9217-458d-a79d-1c7aff376d89"); - GeneralUIUtils.ultimateWait(); - browseASDCPage.selectTenant("bae71557c5bb4d5aac6743a4e5f1d054"); + if (fillLcpRegionAndTenantAndZone) { - String setButtonTestId = "form-set"; - assertSetButtonDisabled(setButtonTestId); + //we assume that if fillLcpRegionAndTenantAndZone is true tenant and lcpRegion are required for this service model + //If you want to fill lcpRegionAndTenant where they are optional you can refactor this test... + assertSetButtonDisabled(setButtonTestId); - SelectOption.byTestIdAndVisibleText("WayneHolland", (Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID)); - assertSetButtonDisabled(setButtonTestId); + //tenant should be dependent on lcpRegion selection + assertElementDisabled("tenant-select"); - SelectOption.byTestIdAndVisibleText("ERICA", Constants.ViewEdit.PRODUCT_FAMILY_SELECT_TESTS_ID); - assertSetButtonEnabled(setButtonTestId); + String lcpRegion = "hvf6"; + Wait.waitByClassAndText("lcpRegionOption", lcpRegion, 30); + viewEditPage.selectLcpRegion(lcpRegion, AIC); - browseASDCPage.selectProductFamily("e433710f-9217-458d-a79d-1c7aff376d89"); + GeneralUIUtils.ultimateWait(); + browseASDCPage.selectTenant("bae71557c5bb4d5aac6743a4e5f1d054"); - browseASDCPage.selectAicZone("NFT1"); + browseASDCPage.selectAicZone("NFT1"); + } - SelectOption.byTestIdAndVisibleText("WATKINS", Constants.OwningEntity.PROJECT_SELECT_TEST_ID); + assertSetButtonEnabled(setButtonTestId); - assertNotificationAreaVisibilityBehaviour(); + + SelectOption.byTestIdAndVisibleText("WATKINS", Constants.OwningEntity.PROJECT_SELECT_TEST_ID); + if (bulkSize!=1) { + assertNotificationAreaVisibilityBehaviourAndSetBulkSize(bulkSize); + } assertPauseOnPausePointsVisibility(serviceData.multiStageDesign); validateDynamicFields(serviceData.dynamicFields); - vidBasePage.screenshotDeployDialog("createSriovService-" + serviceInstanceName); + vidBasePage.screenshotDeployDialog("createMacroService-" + serviceInstanceName); if ("WILL_CANCEL".equals(cycle)) { Click.byTestId(Constants.CANCEL_BUTTON_TEST_ID); @@ -874,9 +924,10 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { loadServicePopup(serviceData.modelUuid); WebElement instanceName = Get.byId("instanceName"); - if (serviceData.isGeneratedNaming) { + if (serviceData.isGeneratedNaming == IS_GENERATED_NAMING.TRUE || serviceData.isGeneratedNaming == IS_GENERATED_NAMING.TRUE_BUT_GIVE_NAME_EITHER_WAY) { Assert.assertNull(instanceName, "instance name input should be invisible when serviceEcompNaming == true."); - } else { + } + if (serviceData.isGeneratedNaming == IS_GENERATED_NAMING.FALSE || serviceData.isGeneratedNaming == IS_GENERATED_NAMING.TRUE_BUT_GIVE_NAME_EITHER_WAY) { instanceName.sendKeys(serviceInstanceName); } @@ -922,6 +973,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { Assert.assertEquals(webElement.getTagName(), tag); } + //@Step("create vnf") private void createVnf(ServiceData serviceData, boolean tryCancelsAndReentries, boolean addedByDefault, String serviceInstanceName) { createVnf(serviceData.vnfData, tryCancelsAndReentries, addedByDefault, serviceInstanceName); } @@ -957,12 +1009,12 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { assertElementDisabled("tenant-select"); WebElement legacyRegion = Get.byTestId("lcpRegionText"); - Assert.assertNull(legacyRegion, "legacy region shouldn't be visible when lcp region isn't JANET25,olson3 or olson5a."); + Assert.assertNull(legacyRegion, "legacy region shouldn't be visible when lcp region isn't AAIAIC25,olson3 or olson5a."); - browseASDCPage.selectLcpRegion("JANET25"); + browseASDCPage.selectLcpRegion("AAIAIC25"); legacyRegion = Get.byTestId("lcpRegionText"); - Assert.assertNotNull(legacyRegion, "legacy region should be visible when lcp region is JANET25,olson3 or olson5a."); + Assert.assertNotNull(legacyRegion, "legacy region should be visible when lcp region is AAIAIC25,olson3 or olson5a."); browseASDCPage.selectTenant("092eb9e8e4b7412e8787dd091bc58e86"); @@ -970,10 +1022,11 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { browseASDCPage.selectPlatform("platform"); + browseASDCPage.selectLineOfBusiness("ONAP"); assertSetButtonEnabled(VNF_SET_BUTTON_TEST_ID); browseASDCPage.setLegacyRegion("some legacy region"); - browseASDCPage.selectLineOfBusiness("ONAP"); + Wait.waitByTestId("model-item-value-subscriberName", 10); Assert.assertEquals(Get.byTestId("model-item-value-subscriberName").getText(), "SILVIA ROBBINS", "Subscriber name should be shown in vf module"); @@ -993,7 +1046,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { Wait.byText("TYLER SILVIA"); GeneralUIUtils.ultimateWait(); - assertThat(Get.selectedOptionText(Constants.ViewEdit.LCP_REGION_SELECT_TESTS_ID), startsWith("JANET25")); + assertThat(Get.selectedOptionText(Constants.ViewEdit.LCP_REGION_SELECT_TESTS_ID), startsWith("AAIAIC25")); Assert.assertEquals(Get.selectedOptionText(Constants.ViewEdit.TENANT_SELECT_TESTS_ID), "USP-SIP-IC-24335-T-01"); Assert.assertEquals(Get.selectedOptionText(Constants.ViewEdit.LINE_OF_BUSINESS_SELECT_TESTS_ID), "ONAP"); Assert.assertEquals(Get.selectedOptionText(Constants.OwningEntity.PLATFORM_SELECT_TEST_ID), "platform"); @@ -1053,6 +1106,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { } } + //@Step("create vf module") private void createVfModule(ServiceData serviceData, String serviceInstanceName, boolean addedByDefault, boolean addOpensPopup) { clickAddVfModule(serviceData, addedByDefault); if (!addOpensPopup) { @@ -1133,33 +1187,34 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { } } - private void assertNotificationAreaVisibilityBehaviour() { + private void assertNotificationAreaVisibilityBehaviourAndSetBulkSize(int size) { WebElement webElement = Get.byId("notification-area"); Assert.assertNull(webElement, "notification area should be invisible if only 1 qty."); - SelectOption.byIdAndVisibleText("quantity-select", "3"); + SelectOption.byIdAndVisibleText("quantity-select", String.valueOf(size)); webElement = Get.byId("notification-area"); Assert.assertNotNull(webElement, "notification area should be visible if more then 1 qty."); } + //@Step("prepare service preset") private void prepareServicePreset(ModelInfo modelInfo, boolean deploy) { String subscriberId = "e433710f-9217-458d-a79d-1c7aff376d89"; if (deploy) { registerExpectationForServiceDeployment( - ImmutableList.of( - modelInfo, - PASQUALEVmxVpeBvService488Annotations - ), - subscriberId, null); + ImmutableList.of( + modelInfo, + pasqualeVmxVpeBvService488Annotations + ), + subscriberId, null); } else { registerExpectationForServiceBrowseAndDesign(ImmutableList.of(modelInfo), subscriberId); } } - private class ServiceData { - ServiceData(String modelUuid, List<String> dynamicFields, boolean isServiceGeneratedNaming, boolean isVnfGeneratedNaming, boolean isVgEnabled, boolean multiStageDesign, String vnfName, String vfName, int vfMin, int vfMax, List<String> vfModuleDynamicFields, String vfVersionId) { + static class ServiceData { + ServiceData(String modelUuid, List<String> dynamicFields, IS_GENERATED_NAMING isServiceGeneratedNaming, boolean isVnfGeneratedNaming, boolean isVgEnabled, boolean multiStageDesign, String vnfName, String vfName, int vfMin, int vfMax, List<String> vfModuleDynamicFields, String vfVersionId) { this.modelUuid = modelUuid; this.dynamicFields = dynamicFields; this.isGeneratedNaming = isServiceGeneratedNaming; @@ -1170,13 +1225,15 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { final String modelUuid; final List<String> dynamicFields; - final boolean isGeneratedNaming; + final IS_GENERATED_NAMING isGeneratedNaming; final boolean multiStageDesign; final VnfData vnfData; final VfData vfData; + + enum IS_GENERATED_NAMING { TRUE, FALSE, TRUE_BUT_GIVE_NAME_EITHER_WAY} } - private class VnfData { + private static class VnfData { VnfData(String vnfName, String vnfUuid, String vnfInstanceName, boolean isGeneratedNaming) { this.vnfName = vnfName; this.vnfUuid = vnfUuid; @@ -1191,7 +1248,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { } - private class VfData { + private static class VfData { VfData(String vfName, boolean vgEnabled, int vfMin, int vfMax, List<String> dynamicFields, String uuid) { this.vfName = vfName; this.vgEnabled = vgEnabled; diff --git a/vid-automation/src/main/java/vid/automation/test/test/SanityMacroDeployTest.java b/vid-automation/src/main/java/vid/automation/test/test/SanityMacroDeployTest.java index 0741a4b38..59c132367 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/SanityMacroDeployTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/SanityMacroDeployTest.java @@ -1,17 +1,13 @@ package vid.automation.test.test; -import static org.hamcrest.Matchers.containsString; -import static vid.automation.test.infra.ModelInfo.macroForBrowseSdc; -import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; - 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; @@ -22,6 +18,10 @@ import vid.automation.test.sections.BrowseASDCPage; import vid.automation.test.sections.SideMenu; import vid.automation.test.services.SimulatorApi; +import static org.hamcrest.Matchers.containsString; +import static vid.automation.test.infra.ModelInfo.macroForBrowseSdc; +import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; + public class SanityMacroDeployTest extends CreateInstanceDialogBaseTest { static final String NEW_INSTANCE_NAME = "New Instance Name"; diff --git a/vid-automation/src/main/java/vid/automation/test/test/SanityTest.java b/vid-automation/src/main/java/vid/automation/test/test/SanityTest.java index 4ec3d4958..eb41c38e4 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/SanityTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/SanityTest.java @@ -1,10 +1,9 @@ package vid.automation.test.test; -import java.io.IOException; import org.junit.Assert; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet; import org.onap.sdc.ci.tests.datatypes.UserCredentials; import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet; import org.openqa.selenium.WebElement; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -16,6 +15,8 @@ import vid.automation.test.sections.SearchExistingPage; import vid.automation.test.sections.SideMenu; import vid.automation.test.services.SimulatorApi; +import java.io.IOException; + public class SanityTest extends VidBaseTestCase { static final String SUBSCRIBER = "Emanuel"; diff --git a/vid-automation/src/main/java/vid/automation/test/test/SearchExistingInstanceTest.java b/vid-automation/src/main/java/vid/automation/test/test/SearchExistingInstanceTest.java index c8370a571..b1d31f8e2 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/SearchExistingInstanceTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/SearchExistingInstanceTest.java @@ -1,10 +1,7 @@ package vid.automation.test.test; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; - -import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet; +import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import vid.automation.test.Constants; @@ -15,6 +12,9 @@ import vid.automation.test.sections.SideMenu; import vid.automation.test.services.BulkRegistration; import vid.automation.test.services.SimulatorApi; +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertTrue; + public class SearchExistingInstanceTest extends VidBaseTestCase { public static final String serviceIdOeWirelineProjectX1 = "7e4f8130-5dee-47c4-8770-1abc5f5ded83"; diff --git a/vid-automation/src/main/java/vid/automation/test/test/VidBaseTestCase.java b/vid-automation/src/main/java/vid/automation/test/test/VidBaseTestCase.java index c472793fc..ced874ee3 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/VidBaseTestCase.java +++ b/vid-automation/src/main/java/vid/automation/test/test/VidBaseTestCase.java @@ -1,23 +1,19 @@ package vid.automation.test.test; +//import com.automation.common.report_portal_integration.annotations.Step; +//import com.automation.common.report_portal_integration.listeners.ReportPortalListener; +//import com.automation.common.report_portal_integration.screenshots.WebDriverScreenshotsProvider; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableList; import org.apache.commons.lang3.StringUtils; import org.glassfish.jersey.uri.internal.JerseyUriBuilder; import org.junit.Assert; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubDetailsGet; +import org.onap.sdc.ci.tests.datatypes.Configuration; import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; import org.onap.simulator.presetGenerator.presets.BasePresets.BasePreset; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAICloudRegionAndSourceFromConfigurationPut; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetNetworkZones; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetPortMirroringSourcePorts; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetServicesGet; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubDetailsWithoutInstancesGet; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetTenants; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIPostNamedQueryForViewEdit; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIServiceDesignAndCreationPut; +import org.onap.simulator.presetGenerator.presets.aai.*; import org.onap.simulator.presetGenerator.presets.ecompportal_att.EcompPortalPresetsUtils; +import org.onap.simulator.presetGenerator.presets.ecompportal_att.PresetGetSessionSlotCheckIntervalGet; import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateServiceInstanceGen2; import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateServiceInstancePost; import org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet; @@ -35,8 +31,10 @@ import org.springframework.web.client.RestTemplate; import org.testng.ITestContext; import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Listeners; import org.testng.annotations.Test; import vid.automation.test.Constants; +import vid.automation.test.Constants.ViewEdit; import vid.automation.test.infra.*; import vid.automation.test.model.Credentials; import vid.automation.test.model.User; @@ -66,11 +64,13 @@ import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.collection.IsEmptyCollection.empty; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet.COMPLETE; import static org.testng.Assert.assertEquals; import static org.testng.AssertJUnit.fail; import static vid.automation.test.utils.TestHelper.GET_SERVICE_MODELS_BY_DISTRIBUTION_STATUS; import static vid.automation.test.utils.TestHelper.GET_TENANTS; +//@Listeners(com.automation.common.report_portal_integration.listeners.ReportPortalListener.class) public class VidBaseTestCase extends SetupCDTest{ protected final UsersService usersService = new UsersService(); @@ -129,7 +129,7 @@ public class VidBaseTestCase extends SetupCDTest{ } @Override - protected org.onap.sdc.ci.tests.datatypes.Configuration getEnvConfiguration() { + protected Configuration getEnvConfiguration() { return TestConfigurationHelper.getEnvConfiguration(); } @@ -170,29 +170,14 @@ public class VidBaseTestCase extends SetupCDTest{ LoginExternalPage.performLoginExternal(userCredentials); } - protected String getReduxState() { - final JavascriptExecutor javascriptExecutor = (JavascriptExecutor) GeneralUIUtils.getDriver(); - String reduxState = (String)javascriptExecutor.executeScript("return window.sessionStorage.getItem('reduxState');"); - System.out.println(reduxState); - return reduxState; - } - - protected void setReduxState(String state) { - final JavascriptExecutor javascriptExecutor = (JavascriptExecutor) GeneralUIUtils.getDriver(); - String script = String.format("window.sessionStorage.setItem('reduxState', '%s');", state); - System.out.println("executing script:"); - System.out.println(script); - javascriptExecutor.executeScript(script); - } - protected void registerExpectationForLegacyServiceDeployment(ModelInfo modelInfo, String subscriberId) { List<BasePreset> presets = new ArrayList<>(Arrays.asList( new PresetAAIPostNamedQueryForViewEdit(BaseMSOPreset.DEFAULT_INSTANCE_ID, true, false), - new PresetAAIGetPortMirroringSourcePorts("9533-config-LB1113", "myRandomInterfaceId", "i'm a port", true) + new PresetAAIGetPortMirroringSourcePorts("9533-config-LB1113", "myRandomInterfaceId", ViewEdit.COMMON_PORT_MIRRORING_PORT_NAME, true) )); presets.add(new PresetMSOCreateServiceInstancePost()); - presets.add(new PresetMSOOrchestrationRequestGet()); + presets.add(new PresetMSOOrchestrationRequestGet(COMPLETE, false)); presets.addAll(getPresetForServiceBrowseAndDesign(ImmutableList.of(modelInfo), subscriberId)); @@ -202,7 +187,7 @@ public class VidBaseTestCase extends SetupCDTest{ protected void registerExpectationForServiceDeployment(List<ModelInfo> modelInfoList, String subscriberId, PresetMSOCreateServiceInstanceGen2 createServiceInstancePreset) { List<BasePreset> presets = new ArrayList<>(Arrays.asList( new PresetAAIPostNamedQueryForViewEdit(BaseMSOPreset.DEFAULT_INSTANCE_ID, true, false), - new PresetAAIGetPortMirroringSourcePorts("9533-config-LB1113", "myRandomInterfaceId", "i'm a port", true) + new PresetAAIGetPortMirroringSourcePorts("9533-config-LB1113", "myRandomInterfaceId", ViewEdit.COMMON_PORT_MIRRORING_PORT_NAME, true) )); if (createServiceInstancePreset != null) { @@ -222,6 +207,7 @@ public class VidBaseTestCase extends SetupCDTest{ protected List<BasePreset> getPresetForServiceBrowseAndDesign(List<ModelInfo> modelInfoList, String subscriberId) { List<BasePreset> presets = new ArrayList<>(Arrays.asList( + new PresetGetSessionSlotCheckIntervalGet(), new PresetAAIGetSubDetailsGet(subscriberId), new PresetAAIGetSubDetailsWithoutInstancesGet(subscriberId), new PresetAAIGetSubscribersGet(), @@ -342,9 +328,9 @@ public class VidBaseTestCase extends SetupCDTest{ viewEditPage.selectTenant(tenant); viewEditPage.selectSuppressRollback(suppressRollback); - viewEditPage.selectPlatform(platform); - //viewEditPage.setLegacyRegion(legacyRegion); - + if(platform != null){ + viewEditPage.selectPlatform(platform); + } viewEditPage.clickConfirmButton(); viewEditPage.assertMsoRequestModal(Constants.ViewEdit.MSO_SUCCESSFULLY_TEXT); viewEditPage.clickCloseButton(); @@ -371,6 +357,7 @@ public class VidBaseTestCase extends SetupCDTest{ Assert.assertTrue(Constants.ViewEdit.VF_MODULE_CREATION_FAILED_MESSAGE, byText); } + //@Step("${method}: ${instanceUUID}") void goToExistingInstanceById(String instanceUUID) { SearchExistingPage searchExistingPage = searchExistingInstanceById(instanceUUID); assertViewEditButtonState( Constants.VIEW_EDIT_BUTTON_TEXT, instanceUUID); @@ -498,13 +485,9 @@ public class VidBaseTestCase extends SetupCDTest{ } public DeployMacroDialogBase getMacroDialog(){ - if (Features.FLAG_ASYNC_INSTANTIATION.isActive()) { - VidBasePage vidBasePage =new VidBasePage(); - vidBasePage.goToIframe(); - return new DeployMacroDialog(); - } - else - return new DeployMacroDialogOld(); + VidBasePage vidBasePage =new VidBasePage(); + vidBasePage.goToIframe(); + return new DeployMacroDialog(); } protected void loadServicePopup(ModelInfo modelInfo) { @@ -591,8 +574,8 @@ public class VidBaseTestCase extends SetupCDTest{ SideMenu.navigateToWelcomePage(); vidBasePage.navigateTo("serviceModels.htm#/instantiate?" + "subscriberId=e433710f-9217-458d-a79d-1c7aff376d89&" + - "subscriberName=USP%20VOICE&" + - "serviceType=VIRTUAL%20USP&" + + "subscriberName=SILVIA%20ROBBINS&" + + "serviceType=TYLER%20SILVIA&" + "serviceInstanceId=" + serviceInstanceId + "&" + "aaiModelVersionId=" + aaiModelVersionId + "&" + "isPermitted=true"); diff --git a/vid-automation/src/main/java/vid/automation/test/test/VidBaseTestWithoutLogin.java b/vid-automation/src/main/java/vid/automation/test/test/VidBaseTestWithoutLogin.java index 48f776406..1522c1057 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/VidBaseTestWithoutLogin.java +++ b/vid-automation/src/main/java/vid/automation/test/test/VidBaseTestWithoutLogin.java @@ -1,5 +1,6 @@ package vid.automation.test.test; +import org.onap.sdc.ci.tests.datatypes.Configuration; import org.onap.sdc.ci.tests.datatypes.UserCredentials; import org.onap.sdc.ci.tests.execute.setup.DriverFactory; import vid.automation.test.utils.TestConfigurationHelper; @@ -12,7 +13,7 @@ public abstract class VidBaseTestWithoutLogin extends DriverFactory { } @Override - protected org.onap.sdc.ci.tests.datatypes.Configuration getEnvConfiguration() { + protected Configuration getEnvConfiguration() { return TestConfigurationHelper.getEnvConfiguration(); } diff --git a/vid-automation/src/main/java/vid/automation/test/test/ViewEditServiceInstanceTest.java b/vid-automation/src/main/java/vid/automation/test/test/ViewEditServiceInstanceTest.java index ed64bba0a..a24ecb735 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/ViewEditServiceInstanceTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/ViewEditServiceInstanceTest.java @@ -1,47 +1,42 @@ package vid.automation.test.test; -import static org.apache.logging.log4j.core.util.Assert.isNonEmpty; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.collection.IsEmptyCollection.empty; -import static org.testng.AssertJUnit.assertEquals; -import static vid.automation.test.infra.Features.FLAG_1810_CR_SOFT_DELETE_ALACARTE_VF_MODULE; -import static vid.automation.test.infra.Features.FLAG_COLLECTION_RESOURCE_SUPPORT; -import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; - import com.google.common.collect.ImmutableMap; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.time.LocalDate; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import org.hamcrest.MatcherAssert; import org.junit.Assert; import org.junit.Before; -import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetNetworkCollectionDetails; +import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.testng.annotations.AfterMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import vid.automation.test.Constants; -import vid.automation.test.infra.Click; -import vid.automation.test.infra.Exists; -import vid.automation.test.infra.FeatureTogglingTest; -import vid.automation.test.infra.Features; -import vid.automation.test.infra.Get; -import vid.automation.test.infra.Wait; +import vid.automation.test.infra.*; import vid.automation.test.model.User; import vid.automation.test.sections.VidBasePage; import vid.automation.test.sections.ViewEditPage; import vid.automation.test.services.BulkRegistration; import vid.automation.test.services.SimulatorApi; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.apache.logging.log4j.core.util.Assert.isNonEmpty; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.collection.IsEmptyCollection.empty; +import static org.testng.AssertJUnit.assertEquals; +import static vid.automation.test.infra.Features.FLAG_1810_CR_SOFT_DELETE_ALACARTE_VF_MODULE; +import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; + public class ViewEditServiceInstanceTest extends VidBaseTestCase { private ViewEditPage viewEditPage = new ViewEditPage(); @@ -67,9 +62,9 @@ public class ViewEditServiceInstanceTest extends VidBaseTestCase { /// Activate / Deactivate service instance /// ////////////////////////////////////////////// - @FeatureTogglingTest(value = FLAG_COLLECTION_RESOURCE_SUPPORT) + @FeatureTogglingTest(value = Features.FLAG_1908_RESUME_MACRO_SERVICE, flagActive = false) @Test - public void testViewEditCRServiceInstance()throws Exception { + public void testViewEditCRServiceInstance() { SimulatorApi.clearAll(); BulkRegistration.searchExistingCRServiceInstance("Created"); BulkRegistration.activateServiceInstance(ACTIVATE_ACTION); diff --git a/vid-automation/src/main/java/vid/automation/test/test/ViewEditWithDrawingBoardTest.java b/vid-automation/src/main/java/vid/automation/test/test/ViewEditWithDrawingBoardTest.java index 724e68065..76cc7a44b 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/ViewEditWithDrawingBoardTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/ViewEditWithDrawingBoardTest.java @@ -1,80 +1,77 @@ package vid.automation.test.test; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.SERVICE_NAME; -import static org.testng.AssertJUnit.assertTrue; -import static vid.automation.test.infra.ModelInfo.aLaCarteVnfGroupingService; -import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; -import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET; -import static vid.automation.test.services.SimulatorApi.registerExpectationFromPresets; - import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMultimap; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.UUID; -import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.onap.simulator.presetGenerator.presets.BasePresets.BasePreset; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIFilterServiceInstanceById; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetServicesGet; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubDetailsGetSpecificService; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubDetailsWithoutInstancesGetSpecificService; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIModelsByInvariantIdGet; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIStandardQueryGet; +import org.onap.simulator.presetGenerator.presets.aai.*; import org.onap.simulator.presetGenerator.presets.ecompportal_att.PresetGetSessionSlotCheckIntervalGet; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSOAddOrRemoveOneInstanceGroupMember; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateServiceInstanceGen2WithNamesAlacarteGroupingService; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSODeleteInstanceGroup; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames; +import org.onap.simulator.presetGenerator.presets.mso.*; import org.onap.simulator.presetGenerator.presets.sdc.PresetSDCGetServiceMetadataGet; import org.onap.simulator.presetGenerator.presets.sdc.PresetSDCGetServiceToscaModelGet; +import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.testng.annotations.Test; import vid.automation.test.Constants; +import vid.automation.test.infra.Click; import vid.automation.test.infra.FeatureTogglingTest; import vid.automation.test.infra.Features; -import vid.automation.test.infra.Wait; +import vid.automation.test.infra.ModelInfo; import vid.automation.test.sections.DrawingBoardPage; -import vid.automation.test.sections.VidBasePage; import vid.automation.test.services.SimulatorApi; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIStandardQueryGet.defaultPlacement; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.SERVICE_NAME; +import static vid.automation.test.Constants.DrawingBoard.CONTEXT_MENU_BUTTON_HEADER; +import static vid.automation.test.Constants.DrawingBoard.CONTEXT_MENU_HEADER_RESUME_ITEM; +import static vid.automation.test.infra.ModelInfo.aLaCarteVnfGroupingService; +import static vid.automation.test.infra.ModelInfo.collectionResourceForResume; +import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET; +import static vid.automation.test.services.SimulatorApi.registerExpectationFromPresets; + public class ViewEditWithDrawingBoardTest extends VidBaseTestCase { - private final String RELATED_VNF_UUID1 = "a9f1b136-11ed-471f-8d77-f123c7501a01"; - private final String RELATED_VNF_UUID2 = "963b67e1-079a-404e-abef-b745d770bd85"; - private final String RELATED_VNF_UUID3 = "5a34a4f4-81a4-4eed-871b-f0b1187160d4"; + private static final String MSO_COMPLETE_STATUS = "COMPLETE"; private static final String COMPLETED = "COMPLETED"; private String vnfGroupInstanceId; - private String vnfGroupInstanceName; - private String serviceInstanceName; - private String serviceInstanceId = "b9af7c1d-a2d7-4370-b747-1b266849ad32"; - String subscriberId = "e433710f-9217-458d-a79d-1c7aff376d89"; - String serviceType = "TYLER SILVIA"; - String serviceReqId = "3cf5ea96-6b34-4945-b5b1-4a7798b1caf2"; + private String serviceInstanceToDeleteName; + private String vnf1Name; + private String subscriberId = "e433710f-9217-458d-a79d-1c7aff376d89"; + private String serviceType = "TYLER SILVIA"; + private String serviceInstanceToResumeName; @FeatureTogglingTest(Features.FLAG_1902_VNF_GROUPING) @Test public void testDeleteVnfGroupWithMembers() { - String vnf1Name = registerServiceInstanceTopologyExpectationOnAAIAndGetVnf1Name(); - final ImmutableMap<PresetMSOServiceInstanceGen2WithNames.Keys, String> names = ImmutableMap.of(SERVICE_NAME, serviceInstanceName); - - - List<BasePreset> presets = ImmutableList.of( - new PresetAAIGetSubscribersGet(), - new PresetAAIGetServicesGet(), - new PresetAAIFilterServiceInstanceById(subscriberId, serviceType, serviceInstanceId), - new PresetAAIGetSubDetailsGetSpecificService(subscriberId, serviceType, "Active", aLaCarteVnfGroupingService, serviceInstanceId), - new PresetAAIGetSubDetailsWithoutInstancesGetSpecificService(subscriberId, serviceType), - new PresetSDCGetServiceMetadataGet(aLaCarteVnfGroupingService), - new PresetSDCGetServiceToscaModelGet(aLaCarteVnfGroupingService), - new PresetMSOCreateServiceInstanceGen2WithNamesAlacarteGroupingService(names, 0, serviceReqId) + String serviceInstanceId = "b9af7c1d-a2d7-4370-b747-1b266849ad32"; + String serviceReqId = "3cf5ea96-6b34-4945-b5b1-4a7798b1caf2"; + + //createPresetsForServiceInstanceTopologyExpectationOnAAIAndGetVnf1Name init serviceInstanceToDeleteName + final List<BasePreset> presetsForGetTopology = createPresetsForServiceInstanceTopologyExpectationOnAAIAndGetVnf1Name(serviceInstanceId); + final ImmutableMap<PresetMSOServiceInstanceGen2WithNames.Keys, String> names = ImmutableMap.of(SERVICE_NAME, serviceInstanceToDeleteName); + SimulatorApi.registerExpectationFromPresetsCollections(ImmutableList.of( + presetsForSearchAndEdit(aLaCarteVnfGroupingService, subscriberId, serviceType, serviceInstanceId), + presetsForGetTopology, + ImmutableList.of( + new PresetAAIModelsByInvariantIdGet(ImmutableList.of(aLaCarteVnfGroupingService.modelInvariantId)), + new PresetMSOCreateServiceInstanceGen2WithNamesAlacarteGroupingService(names, 0, serviceReqId) + ) + ), + CLEAR_THEN_SET); + + registerMsoPresetForRemoveInstanceGroupMember(); + searchEditAndWaitForCompletion( + serviceInstanceId, + serviceInstanceToDeleteName, + () -> hoverAndClickMenuByName(vnf1Name, "daeb6568-cef8-417f-9075-ed259ce59f48-groupingservicefortest..ResourceInstanceGroup..0", Constants.InstantiationStatus.CONTEXT_MENU_DELETE) ); + } - SimulatorApi.registerExpectationFromPresets(presets, APPEND); - registerMsoPreset(); + protected void searchEditAndWaitForCompletion(String serviceInstanceId, String serviceInstanceName, Runnable action) { GeneralUIUtils.ultimateWait(); goToExistingInstanceById(serviceInstanceId); GeneralUIUtils.ultimateWait(); @@ -82,23 +79,14 @@ public class ViewEditWithDrawingBoardTest extends VidBaseTestCase { DrawingBoardPage drawingBoardPage = new DrawingBoardPage(); drawingBoardPage.goToIframe(); GeneralUIUtils.ultimateWait(); - hoverAndClickMenuByName(vnf1Name, "daeb6568-cef8-417f-9075-ed259ce59f48-groupingservicefortest..ResourceInstanceGroup..0", Constants.InstantiationStatus.CONTEXT_MENU_DELETE); - GeneralUIUtils.ultimateWait(); - drawingBoardPage.clickDeployButton(); - - - VidBasePage.goOutFromIframe(); - GeneralUIUtils.ultimateWait(); - drawingBoardPage.goToIframe(); + action.run(); GeneralUIUtils.ultimateWait(); - - DrawingBoardPage.ServiceStatusChecker serviceStatusChecker = new DrawingBoardPage.ServiceStatusChecker(serviceInstanceName, Collections.singleton(COMPLETED)); - boolean statusIsShown = Wait.waitFor(serviceStatusChecker, null, 10, 1); - assertTrue("Service "+serviceInstanceName+" wasn't completed after in time", statusIsShown); - + drawingBoardPage.screenshotDeployDialog(serviceInstanceId); + drawingBoardPage.deploy(); + drawingBoardPage.verifyServiceCompletedOnTime(serviceInstanceName, "Service " + serviceInstanceName); } - public void registerMsoPreset(){ + public void registerMsoPresetForRemoveInstanceGroupMember() { String vnfGroupRequestId = UUID.randomUUID().toString(); String firstMemberRequestId = UUID.randomUUID().toString(); String secondMemberRequestId = UUID.randomUUID().toString(); @@ -129,18 +117,23 @@ public class ViewEditWithDrawingBoardTest extends VidBaseTestCase { } - public String registerServiceInstanceTopologyExpectationOnAAIAndGetVnf1Name() { + public List<BasePreset> createPresetsForServiceInstanceTopologyExpectationOnAAIAndGetVnf1Name(String serviceInstanceId) { + + final String RELATED_VNF_UUID1 = "a9f1b136-11ed-471f-8d77-f123c7501a01"; + final String RELATED_VNF_UUID2 = "963b67e1-079a-404e-abef-b745d770bd85"; + final String RELATED_VNF_UUID3 = "5a34a4f4-81a4-4eed-871b-f0b1187160d4"; + PresetAAIStandardQueryGet relatedVnf1 = PresetAAIStandardQueryGet.ofVnf(RELATED_VNF_UUID1, "7a6ee536-f052-46fa-aa7e-2fca9d674c44", "7a6ee536-f052-46fa-aa7e-2fca9d674c44", - "", ImmutableMultimap.of()); + "", ImmutableMultimap.of(), defaultPlacement()); PresetAAIStandardQueryGet relatedVnf2 = PresetAAIStandardQueryGet.ofVnf(RELATED_VNF_UUID2, "d6557200-ecf2-4641-8094-5393ae3aae60","d6557200-ecf2-4641-8094-5393ae3aae60", - "", ImmutableMultimap.of()); + "", ImmutableMultimap.of(), defaultPlacement()); PresetAAIStandardQueryGet relatedVnf3 = PresetAAIStandardQueryGet.ofVnf(RELATED_VNF_UUID3, "d6557200-ecf2-4641-8094-5393ae3aae60","d6557200-ecf2-4641-8094-5393ae3aae60", - "", ImmutableMultimap.of()); + "", ImmutableMultimap.of(), defaultPlacement()); final PresetAAIStandardQueryGet vnfGroup1 = PresetAAIStandardQueryGet.ofInstanceGroup("vnfGroup-type", "Teresa Bradley", @@ -158,21 +151,93 @@ public class ViewEditWithDrawingBoardTest extends VidBaseTestCase { .putAll("instance-group", vnfGroup1.getReqPath(), vnfGroup2.getReqPath()) .build() ); - SimulatorApi.registerExpectationFromPresets(ImmutableList.of( + + serviceInstanceToDeleteName = serviceInstance.getInstanceName(); + vnfGroupInstanceId = vnfGroup1.getInstanceId(); + vnf1Name = vnfGroup1.getInstanceName(); + return ImmutableList.of( serviceInstance, - vnfGroup1,vnfGroup2, relatedVnf1, relatedVnf2, relatedVnf3, - new PresetAAIModelsByInvariantIdGet(ImmutableList.of(aLaCarteVnfGroupingService.modelInvariantId)), + vnfGroup1, vnfGroup2, relatedVnf1, relatedVnf2, relatedVnf3); + } + + private List<BasePreset> presetsForSearchAndEdit(ModelInfo modelInfo, String subscriberId, String serviceType, String serviceInstanceId) { + return ImmutableList.of( new PresetGetSessionSlotCheckIntervalGet(), new PresetAAIGetSubscribersGet(), - new PresetSDCGetServiceMetadataGet(aLaCarteVnfGroupingService), - new PresetSDCGetServiceToscaModelGet(aLaCarteVnfGroupingService) - ), CLEAR_THEN_SET); + new PresetSDCGetServiceMetadataGet(modelInfo), + new PresetSDCGetServiceToscaModelGet(modelInfo), + new PresetAAIGetServicesGet(), + new PresetAAIFilterServiceInstanceById(subscriberId, serviceType, serviceInstanceId), + new PresetAAIGetSubDetailsGetSpecificService(subscriberId, serviceType, "Assigned", modelInfo, serviceInstanceId), + new PresetAAIGetSubDetailsWithoutInstancesGetSpecificService(subscriberId, serviceType) + ); + } - serviceInstanceName = serviceInstance.getInstanceName(); - vnfGroupInstanceName = vnfGroup1.getInstanceName(); - vnfGroupInstanceId = vnfGroup1.getInstanceId(); - return vnfGroupInstanceName; + @FeatureTogglingTest({Features.FLAG_1908_COLLECTION_RESOURCE_NEW_INSTANTIATION_UI, Features.FLAG_1908_RESUME_MACRO_SERVICE}) + @Test + public void testResumeServiceInstanceWithCollectionResource() { + + String serviceInstanceId = "0d7b5429-da18-475b-8b67-1b8c0a596f68"; + String serviceReqId = "405652f4-ceb3-4a75-9474-8aea71480a77"; //from PresetMSOOrchestrationRequestsGetByServiceInstanceId + + //createPresetsForServiceInstanceTopologyExpectationOnAAIAndGetVnf1Name init serviceInstanceToDeleteName + final List<BasePreset> presetsForGetTopology = createPresetsForGetTopologyOfServiceInstanceWithCRandInstanceGroup(serviceInstanceId); + SimulatorApi.registerExpectationFromPresetsCollections(ImmutableList.of( + presetsForSearchAndEdit(collectionResourceForResume, subscriberId, serviceType, serviceInstanceId), + presetsForGetTopology, + createPresetsForResume(serviceInstanceId, serviceReqId) + ), + CLEAR_THEN_SET); + + searchEditAndWaitForCompletion( + serviceInstanceId, + serviceInstanceToResumeName, //side effect of createPresetsForGetTopologyOfServiceInstanceWithCRandInstanceGroup + () -> { + Click.byTestId(CONTEXT_MENU_BUTTON_HEADER); + Click.byTestId(CONTEXT_MENU_HEADER_RESUME_ITEM); + }); } + private List<BasePreset> createPresetsForResume(String serviceInstanceId, String serviceReqId) { + String resumeRequestId = UUID.randomUUID().toString(); + return ImmutableList.of( + new PresetMSOOrchestrationRequestsGetByServiceInstanceId(serviceInstanceId), + new PresetMSOResumeRequest(serviceReqId, resumeRequestId, serviceInstanceId, "us16807000"), + new PresetMSOOrchestrationRequestGet(MSO_COMPLETE_STATUS, resumeRequestId) + ); + } + + private List<BasePreset> createPresetsForGetTopologyOfServiceInstanceWithCRandInstanceGroup(String serviceInstanceId) { + PresetAAIStandardQueryGet instanceGroup = PresetAAIStandardQueryGet.ofInstanceGroup( + "L3-NETWORK", "SUB_INTERFACE", ImmutableMultimap.of(), + "868b109c-9481-4a18-891b-af974db7705a", "dd182d7d-6949-4b90-b3cc-5befe400742e"); + + PresetAAIStandardQueryGet cr = PresetAAIStandardQueryGet.ofCollectionResource( + "Assigned", + ImmutableMultimap.of("instance-group", instanceGroup.getReqPath()), + "081ceb56-eb71-4566-a72d-3e7cbee5cdf1", + "ce8c98bc-4691-44fb-8ff0-7a47487c11c4" + ); + + PresetAAIStandardQueryGet service = PresetAAIStandardQueryGet.ofServiceInstance( + serviceInstanceId, + "INFRASTRUCTURE", "", collectionResourceForResume.modelVersionId, + collectionResourceForResume.modelInvariantId, + subscriberId, + serviceType, + "Assigned", + ImmutableMultimap.of("collection", cr.getReqPath()) + ); + + PresetAAIModelsByInvariantIdGetForServiceWithCR aaiModelsPreset = new PresetAAIModelsByInvariantIdGetForServiceWithCR( + ImmutableList.of( + "868b109c-9481-4a18-891b-af974db7705a", + "081ceb56-eb71-4566-a72d-3e7cbee5cdf1", + collectionResourceForResume.modelInvariantId)); + + serviceInstanceToResumeName = service.getInstanceName(); + + return ImmutableList.of(service, cr, instanceGroup, aaiModelsPreset); + } } diff --git a/vid-automation/src/main/java/vid/automation/test/test/VlanTagSubInterfaceTest.java b/vid-automation/src/main/java/vid/automation/test/test/VlanTagSubInterfaceTest.java index 3f8db2a94..5f594cb97 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/VlanTagSubInterfaceTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/VlanTagSubInterfaceTest.java @@ -1,27 +1,10 @@ package vid.automation.test.test; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.is; -import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.PRESET_AAIAIC25_TO_ATT_AIC; -import static org.testng.AssertJUnit.assertEquals; -import static vid.automation.test.infra.Features.FLAG_COLLECTION_RESOURCE_SUPPORT; -import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; -import static vid.automation.test.test.ALaCarteflowTest.AIC; - import com.google.common.collect.ImmutableList; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; -import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetInstanceGroupsByCloudRegionInvalidRequest; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetRelatedInstanceGroupsByVnfId; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetServicesGet; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet; -import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetTenants; +import org.onap.simulator.presetGenerator.presets.aai.*; import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateVnfVlanTagging; import org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet; +import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.Select; import org.testng.Assert; @@ -30,7 +13,6 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import vid.automation.test.Constants; import vid.automation.test.infra.Click; -import vid.automation.test.infra.FeatureTogglingTest; import vid.automation.test.infra.Get; import vid.automation.test.infra.SelectOption; import vid.automation.test.sections.SearchExistingPage; @@ -38,7 +20,19 @@ import vid.automation.test.sections.VidBasePage; import vid.automation.test.services.BulkRegistration; import vid.automation.test.services.SimulatorApi; -@FeatureTogglingTest(FLAG_COLLECTION_RESOURCE_SUPPORT) +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.is; +import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.PRESET_AAIAIC25_TO_ATT_AIC; +import static org.testng.AssertJUnit.assertEquals; +import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; +import static vid.automation.test.test.ALaCarteflowTest.AIC; + public class VlanTagSubInterfaceTest extends CreateInstanceDialogBaseTest { private final String ecompNamingFalseInstanceId = "dc3a893e-0104-4ef6-abfe-6c2932294a3e"; @@ -56,7 +50,7 @@ public class VlanTagSubInterfaceTest extends CreateInstanceDialogBaseTest { ); final PresetAAIGetInstanceGroupsByCloudRegionInvalidRequest presetAAIGetInstanceGroupsByCloudRegion1 = new PresetAAIGetInstanceGroupsByCloudRegionInvalidRequest("irma-aic", "hvf6", "untraaa"); - final PresetAAIGetInstanceGroupsByCloudRegionInvalidRequest presetAAIGetInstanceGroupsByCloudRegion2 = new PresetAAIGetInstanceGroupsByCloudRegionInvalidRequest("irma-aic", "JANET25", "untraaa"); + final PresetAAIGetInstanceGroupsByCloudRegionInvalidRequest presetAAIGetInstanceGroupsByCloudRegion2 = new PresetAAIGetInstanceGroupsByCloudRegionInvalidRequest("irma-aic", "AAIAIC25", "untraaa"); SimulatorApi.registerExpectationFromPresets(ImmutableList.of( new PresetAAIGetServicesGet(), @@ -67,8 +61,8 @@ public class VlanTagSubInterfaceTest extends CreateInstanceDialogBaseTest { new PresetAAIGetTenants(), presetAAIGetInstanceGroupsByCloudRegion1, presetAAIGetInstanceGroupsByCloudRegion2, - new PresetMSOOrchestrationRequestGet("IN_PROGRESS"), - new PresetMSOOrchestrationRequestGet("COMPLETE") + new PresetMSOOrchestrationRequestGet("IN_PROGRESS", false), + new PresetMSOOrchestrationRequestGet("COMPLETE", false) ), APPEND); @@ -104,7 +98,7 @@ public class VlanTagSubInterfaceTest extends CreateInstanceDialogBaseTest { WebElement instanceNameInput = GeneralUIUtils.getInputElement(Constants.INSTANCE_NAME_SELECT_TESTS_ID); instanceNameInput.sendKeys("NewName"); SelectOption.byTestIdAndVisibleText("TYLER SILVIA", Constants.ViewEdit.PRODUCT_FAMILY_SELECT_TESTS_ID); - viewEditPage.selectLcpRegion("JANET25", AIC); + viewEditPage.selectLcpRegion("AAIAIC25", AIC); SelectOption.byTestIdAndVisibleText("USP-SIP-IC-24335-T-01", Constants.ViewEdit.TENANT_SELECT_TESTS_ID); SelectOption.byTestIdAndVisibleText("UUUAIAAI-YYY1", Constants.ViewEdit.AIC_ZONE_TEST_ID); SelectOption.byTestIdAndVisibleText("xxx1", Constants.OwningEntity.PLATFORM_SELECT_TEST_ID); diff --git a/vid-automation/src/main/java/vid/automation/test/utils/DB_CONFIG.java b/vid-automation/src/main/java/vid/automation/test/utils/DB_CONFIG.java index 717e2a746..18cda6bda 100644 --- a/vid-automation/src/main/java/vid/automation/test/utils/DB_CONFIG.java +++ b/vid-automation/src/main/java/vid/automation/test/utils/DB_CONFIG.java @@ -2,7 +2,7 @@ package vid.automation.test.utils; public class DB_CONFIG { public static String url = String.format("jdbc:mariadb://%s:%d/vid_portal", - System.getProperty("DB_HOST", System.getProperty("VID_HOST", "10.0.0.10" )), + System.getProperty("DB_HOST", System.getProperty("VID_HOST", "127.0.0.1" )), Integer.valueOf(System.getProperty("DB_PORT", "3306")) ); public static String username = "euser"; diff --git a/vid-automation/src/main/java/vid/automation/test/utils/TestConfigurationHelper.java b/vid-automation/src/main/java/vid/automation/test/utils/TestConfigurationHelper.java index 0b2978dda..0d40a30e7 100644 --- a/vid-automation/src/main/java/vid/automation/test/utils/TestConfigurationHelper.java +++ b/vid-automation/src/main/java/vid/automation/test/utils/TestConfigurationHelper.java @@ -1,18 +1,19 @@ package vid.automation.test.utils; +import org.onap.sdc.ci.tests.datatypes.Configuration; import vid.automation.test.infra.FeaturesTogglingConfiguration; public class TestConfigurationHelper { private TestConfigurationHelper(){} - public static org.onap.sdc.ci.tests.datatypes.Configuration getEnvConfiguration() { + public static Configuration getEnvConfiguration() { try { String envUrl = System.getProperty("ENV_URL"); boolean isCustomLogin = Boolean.parseBoolean(System.getProperty("CUSTOM_LOGIN")); - org.onap.sdc.ci.tests.datatypes.Configuration configuration = new org.onap.sdc.ci.tests.datatypes.Configuration(envUrl, isCustomLogin); + Configuration configuration = new Configuration(envUrl, isCustomLogin); String geckoDriverPath = System.getProperty("GECKO_PATH"); if(geckoDriverPath == null){ |