summaryrefslogtreecommitdiffstats
path: root/vid-automation
diff options
context:
space:
mode:
authorEylon Malin <eylon.malin@intl.att.com>2019-11-13 16:41:33 +0200
committerIttay Stern <ittay.stern@att.com>2019-11-19 17:41:46 +0200
commit4728ff865a7c6ab7a27bb3a12ad88b304fcf8d3d (patch)
tree2f08b173a1ae398607dbd7c41488cfa12dd2c989 /vid-automation
parentab4243c9b71a08f760d85529abebea521eb45c7f (diff)
a-la-carte services new instantiation ui selenium test
Issue-ID: VID-701 Change-Id: I72f5245493d0ad3e3cc4447617c4b6a011bfd41c Signed-off-by: Eylon Malin <eylon.malin@intl.att.com> Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-automation')
-rw-r--r--vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceAlacarte.java (renamed from vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceAlacarte5GServiceWithNetwork.java)22
-rw-r--r--vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteCypress.java20
-rw-r--r--vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteE2E.java75
-rw-r--r--vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleBase.java23
-rw-r--r--vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteE2E.java67
-rw-r--r--vid-automation/src/main/java/vid/automation/test/infra/ModelInfo.java25
-rw-r--r--vid-automation/src/main/java/vid/automation/test/test/NewServiceInstanceTest.java144
7 files changed, 311 insertions, 65 deletions
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/PresetMSOCreateServiceInstanceAlacarte.java
index 40c18fa55..180aaefd1 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/PresetMSOCreateServiceInstanceAlacarte.java
@@ -1,16 +1,20 @@
package org.onap.simulator.presetGenerator.presets.mso;
-import java.util.Map;
-
import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.SERVICE_NAME;
-public class PresetMSOCreateServiceInstanceAlacarte5GServiceWithNetwork extends PresetMSOCreateServiceInstanceGen2WithNames {
+import java.util.Map;
+import vid.automation.test.infra.ModelInfo;
+
+public class PresetMSOCreateServiceInstanceAlacarte extends PresetMSOCreateServiceInstanceGen2WithNames {
private final String requestorId;
+ protected final ModelInfo modelInfo;
- public PresetMSOCreateServiceInstanceAlacarte5GServiceWithNetwork(Map<Keys, String> names, String requestId, String requestorId) {
- super(names, 0, requestId);
+ public PresetMSOCreateServiceInstanceAlacarte(Map<Keys, String> names, String requestId, String responseInstanceId,
+ String requestorId, ModelInfo modelInfo) {
+ super(names, 0, requestId, responseInstanceId);
this.requestorId = requestorId;
+ this.modelInfo = modelInfo;
}
@Override
@@ -22,13 +26,7 @@ public class PresetMSOCreateServiceInstanceAlacarte5GServiceWithNetwork extends
public Object getRequestBody() {
return "{" +
" \"requestDetails\": {" +
- " \"modelInfo\": {" +
- " \"modelInvariantId\": \"16e56d12-40b3-4db1-a40e-d48c36679e2e\"," +
- " \"modelVersionId\": \"4659e8bd-0920-4eed-8ec5-550b4c8dceeb\"," +
- " \"modelName\": \"SR-IOV Provider-1\"," +
- " \"modelType\": \"service\"," +
- " \"modelVersion\": \"1.0\"" +
- " }," +
+ modelInfo.createMsoModelInfo()+
" \"owningEntity\": {" +
" \"owningEntityId\": \"d61e6f2d-12fa-4cc2-91df-7c244011d6fc\"," +
" \"owningEntityName\": \"WayneHolland\"" +
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 7b434d559..ace17888f 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,12 +1,10 @@
package org.onap.simulator.presetGenerator.presets.mso;
import com.google.common.collect.ImmutableMap;
-
import java.util.Map;
-public class PresetMSOCreateVfModuleALaCarteCypress extends PresetMSOBaseCreateInstancePost {
- private String serviceInstanceId;
- private String vnfInstanceId;
+public class PresetMSOCreateVfModuleALaCarteCypress extends PresetMSOCreateVfModuleBase {
+
protected final Map<Keys, String> names;
public enum Keys {
@@ -34,25 +32,13 @@ public class PresetMSOCreateVfModuleALaCarteCypress extends PresetMSOBaseCreateI
.build();
public PresetMSOCreateVfModuleALaCarteCypress(String overrideRequestId, String serviceInstanceId, String vnfInstanceId, Map<Keys, String> names, String testApi, boolean withTestApi) {
- super(overrideRequestId);
- this.vnfInstanceId = vnfInstanceId;
- this.serviceInstanceId = serviceInstanceId;
+ super(overrideRequestId, serviceInstanceId, vnfInstanceId);
this.names = names;
this.msoTestApi = testApi;
this.withTestApi = withTestApi;
}
@Override
- public boolean isStrictMatch() {
- return true;
- }
-
- @Override
- public String getReqPath() {
- return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/vnfs/" + vnfInstanceId + "/vfModules";
- }
-
- @Override
public Object getRequestBody() {
return "" +
"{" +
diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteE2E.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteE2E.java
new file mode 100644
index 000000000..57d15bd40
--- /dev/null
+++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteE2E.java
@@ -0,0 +1,75 @@
+package org.onap.simulator.presetGenerator.presets.mso;
+
+import vid.automation.test.infra.ModelInfo;
+
+public class PresetMSOCreateVfModuleALaCarteE2E extends PresetMSOCreateVfModuleBase {
+
+ protected final String requestorId;
+ protected final ModelInfo serviceModelInfo;
+
+ public PresetMSOCreateVfModuleALaCarteE2E(
+ String overrideRequestId,
+ String serviceInstanceId,
+ String vnfInstanceId,
+ String requestorId,
+ ModelInfo serviceModelInfo) {
+ super(overrideRequestId, serviceInstanceId, vnfInstanceId);
+ this.requestorId = requestorId;
+ this.serviceModelInfo = serviceModelInfo;
+ }
+
+ @Override
+ public Object getRequestBody() {
+ return "{"
+ + " \"requestDetails\": {"
+ + " \"modelInfo\": {"
+ + " \"modelCustomizationName\": \"Vocg1804Vf..base_ocg..module-0\","
+ + " \"modelCustomizationId\": \"a7b333d7-7633-4197-b40d-80fcfcadee94\","
+ + " \"modelInvariantId\": \"e9c795c8-6b98-4db3-bd90-a84b8ca5181b\","
+ + " \"modelVersionId\": \"815db6e5-bdfd-4cb6-9575-82c36df8747a\","
+ + " \"modelName\": \"Vocg1804Vf..base_ocg..module-0\","
+ + " \"modelType\": \"vfModule\","
+ + " \"modelVersion\": \"4\""
+ + " },"
+ + " \"cloudConfiguration\": {"
+ + " \"lcpCloudRegionId\": \"hvf6\","
+ + addCloudOwnerIfNeeded()
+ + " \"tenantId\": \"bae71557c5bb4d5aac6743a4e5f1d054\""
+ + " },"
+ + " \"requestInfo\": {"
+ + " \"source\": \"VID\","
+ + " \"suppressRollback\": false,"
+ + " \"requestorId\": \""+requestorId+"\""
+ + " },"
+ + " \"relatedInstanceList\": [{"
+ + " \"relatedInstance\": {"
+ + serviceModelInfo.createMsoModelInfo()
+ + " \"instanceId\": \""+serviceInstanceId+"\""
+ + " }"
+ + " }, {"
+ + " \"relatedInstance\": {"
+ + " \"modelInfo\": {"
+ + " \"modelCustomizationName\": \"vOCG_1804_VF 0\","
+ + " \"modelCustomizationId\": \"e9ed1da0-c078-426a-8e84-6f4e85eace59\","
+ + " \"modelInvariantId\": \"db23d71a-4cb4-4030-9c9b-e3f886c2b35c\","
+ + " \"modelVersionId\": \"aca3f7b1-15f9-45a5-b182-b8b5aca84a76\","
+ + " \"modelName\": \"vOCG_1804_VF\","
+ + " \"modelType\": \"vnf\","
+ + " \"modelVersion\": \"4.0\""
+ + " },"
+ + " \"instanceId\": \""+vnfInstanceId+"\""
+ + " }"
+ + " }"
+ + " ],"
+ + " \"requestParameters\": {"
+ + " \"userParams\": [{"
+ + " \"param\": \"ABCD\","
+ + " \"vnf_instance_name\": \"sample\""
+ + " }"
+ + " ],"
+ + " \"testApi\": \"VNF_API\""
+ + " }"
+ + " }"
+ + "}";
+ }
+}
diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleBase.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleBase.java
new file mode 100644
index 000000000..344f43cdd
--- /dev/null
+++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleBase.java
@@ -0,0 +1,23 @@
+package org.onap.simulator.presetGenerator.presets.mso;
+
+public class PresetMSOCreateVfModuleBase extends PresetMSOBaseCreateInstancePost {
+
+ protected String serviceInstanceId;
+ protected String vnfInstanceId;
+
+ public PresetMSOCreateVfModuleBase(String requestId, String serviceInstanceId, String vnfInstanceId) {
+ super(requestId);
+ this.serviceInstanceId = serviceInstanceId;
+ this.vnfInstanceId = vnfInstanceId;
+ }
+
+ @Override
+ public boolean isStrictMatch() {
+ return true;
+ }
+
+ @Override
+ public String getReqPath() {
+ return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/vnfs/" + vnfInstanceId + "/vfModules";
+ }
+}
diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteE2E.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteE2E.java
new file mode 100644
index 000000000..dba42f32f
--- /dev/null
+++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteE2E.java
@@ -0,0 +1,67 @@
+package org.onap.simulator.presetGenerator.presets.mso;
+
+import vid.automation.test.infra.ModelInfo;
+
+public class PresetMSOCreateVnfALaCarteE2E extends PresetMSOCreateVnfBase {
+
+ private final String requestorId;
+ protected String lineOfBusinessName;
+ protected final ModelInfo serviceModelInfo;
+
+ public PresetMSOCreateVnfALaCarteE2E(
+ String overrideRequestId,
+ String serviceInstanceId,
+ String vnfInstanceId,
+ String lineOfBusinessName,
+ String requestorId,
+ ModelInfo serviceModelInfo) {
+ super(overrideRequestId, serviceInstanceId, vnfInstanceId);
+ this.lineOfBusinessName = lineOfBusinessName;
+ this.requestorId = requestorId;
+ this.serviceModelInfo = serviceModelInfo;
+ }
+
+ @Override
+ public Object getRequestBody() {
+ return "{"
+ + " \"requestDetails\": {"
+ + " \"modelInfo\": {"
+ + " \"modelCustomizationName\": \"vOCG_1804_VF 0\","
+ + " \"modelCustomizationId\": \"e9ed1da0-c078-426a-8e84-6f4e85eace59\","
+ + " \"modelInvariantId\": \"db23d71a-4cb4-4030-9c9b-e3f886c2b35c\","
+ + " \"modelVersionId\": \"aca3f7b1-15f9-45a5-b182-b8b5aca84a76\","
+ + " \"modelName\": \"vOCG_1804_VF\","
+ + " \"modelType\": \"vnf\","
+ + " \"modelVersion\": \"4.0\""
+ + " },"
+ + " \"cloudConfiguration\": {"
+ + " \"lcpCloudRegionId\": \"some legacy region\","
+ + addCloudOwnerIfNeeded()
+ + " \"tenantId\": \"092eb9e8e4b7412e8787dd091bc58e86\""
+ + " },"
+ + " \"requestInfo\": {"
+ + " \"source\": \"VID\","
+ + " \"suppressRollback\": false,"
+ + " \"requestorId\": \""+requestorId+"\""
+ + " },"
+ + " \"platform\": {"
+ + " \"platformName\": \"platform\""
+ + " },"
+ + " \"lineOfBusiness\": {"
+ + " \"lineOfBusinessName\": \""+lineOfBusinessName+"\""
+ + " },"
+ + " \"relatedInstanceList\": [{"
+ + " \"relatedInstance\": {"
+ + serviceModelInfo.createMsoModelInfo()
+ + " \"instanceId\": \""+serviceInstanceId+"\""
+ + " }"
+ + " }"
+ + " ],"
+ + " \"requestParameters\": {"
+ + " \"userParams\": [],"
+ + " \"testApi\": \"VNF_API\""
+ + " }"
+ + " }"
+ + "}";
+ }
+}
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 84b2cd922..9aa44fa56 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
@@ -6,6 +6,8 @@ public class ModelInfo {
public final String modelVersionId; //aka model uuid
public final String modelInvariantId;
public final String zipFileName;
+ public String modelName;
+ public String modelVersion;
public static class ModelInfoWithMultipleVersions {
public final String modelInvariantId;
@@ -37,6 +39,14 @@ public class ModelInfo {
this.zipFileName = zipFileName;
}
+ public ModelInfo(String modelVersionId, String modelInvariantId, String zipFileName, String modelName, String modelVersion) {
+ this.modelVersionId = modelVersionId;
+ this.modelInvariantId = modelInvariantId;
+ this.zipFileName = zipFileName;
+ this.modelName = modelName;
+ this.modelVersion = modelVersion;
+ }
+
public ModelInfo(String modelVersionId, String modelInvariantId) {
this(modelVersionId, modelInvariantId, "fakeCsarName.zip");
}
@@ -50,10 +60,11 @@ public class ModelInfo {
public static final ModelInfo macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetails = new ModelInfo ("1a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd", "cdb90b57-ed78-4d44-a5b4-7f43a02ec632", "csar-noDynamicFields-ecompNamingFalse-fullModelDetails-1a80c596.zip");
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 aLaCarteNetworkProvider5G = new ModelInfo("4659e8bd-0920-4eed-8ec5-550b4c8dceeb", "16e56d12-40b3-4db1-a40e-d48c36679e2e", "service-SrIovProvider1-csar.zip", "SR-IOV Provider-1", "1.0");
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 aLaCarteServiceCreationNewUI = new ModelInfo("f3862254-8df2-4a0a-8137-0a9fe985860c", "d1068db8-b933-4919-8972-8bc1aed366c8", "service-Vocg1804Svc.zip", "vOCG_1804_SVC", "1.0");
public static final ModelInfo aLaCarteServiceOldVersionTest = new ModelInfo("04743c62-ab58-41a0-bc53-1052ef1c094a", "5d353b28-e5b7-419b-98e8-cad5d258be13", "serviceCreationTest04743c62-ab58-41a0-bc53-1052ef1c094a.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");
@@ -86,9 +97,21 @@ public class ModelInfo {
.add(transportWithPnfsService)
.add(collectionResourceService)
.add(collectionResourceForResume)
+ .add(aLaCarteServiceCreationNewUI)
.add(serviceWithInstantiationTypeMacro)
.build();
}
+
+ public String createMsoModelInfo() {
+ return
+ " \"modelInfo\": {" +
+ " \"modelInvariantId\": \""+modelInvariantId+"\"," +
+ " \"modelVersionId\": \""+modelVersionId+"\"," +
+ " \"modelName\": \""+modelName+"\"," +
+ " \"modelType\": \"service\"," +
+ " \"modelVersion\": \""+modelVersion+"\"" +
+ " },";
+ }
}
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 1d668877d..1a9315fdd 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,12 +1,12 @@
package vid.automation.test.test;
-//import com.automation.common.report_portal_integration.annotations.Step;
-
+import static java.util.Collections.emptyList;
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_MTN6_TO_ATT_AIC;
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;
@@ -17,6 +17,7 @@ import static vid.automation.test.infra.Features.FLAG_1908_COLLECTION_RESOURCE_N
import static vid.automation.test.infra.Features.FLAG_1908_INFRASTRUCTURE_VPN;
import static vid.automation.test.infra.Features.FLAG_1908_MACRO_NOT_TRANSPORT_NEW_VIEW_EDIT;
import static vid.automation.test.infra.Features.FLAG_1908_TRANSPORT_SERVICE_NEW_INSTANTIATION_UI;
+import static vid.automation.test.infra.Features.FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI;
import static vid.automation.test.infra.Features.FLAG_5G_IN_NEW_INSTANTIATION_UI;
import static vid.automation.test.infra.Features.FLAG_ENABLE_WEBPACK_MODERN_UI;
import static vid.automation.test.infra.ModelInfo.aLaCarteNetworkProvider5G;
@@ -55,16 +56,17 @@ 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.PresetAAIGetL3NetworksByCloudRegionSpecificState;
import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetTenants;
import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetVpnsByType;
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.PresetMSOCreateServiceInstanceAlacarte;
import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateServiceInstanceGen2WithNamesAlacarteGroupingService;
import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse;
+import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateVfModuleALaCarteE2E;
+import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateVnfALaCarteE2E;
import org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet;
import org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork;
import org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork.ResponseDetails;
@@ -229,7 +231,8 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
new ArrayList<>(),
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", false);
prepareServicePreset(macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetails, false);
@@ -277,7 +280,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
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"),
- "25284168-24bb-4698-8cb4-3f509146eca5");
+ "25284168-24bb-4698-8cb4-3f509146eca5", false);
// this is the instance-name that createMacroService is going to use
String serviceInstanceName = randomAlphabetic + "instancename";
@@ -329,7 +332,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
.build();
registerExpectationFromPresets(ImmutableList.of(
// although "some legacy region" is provided for vnf, Service's region "hvf6" overrides it
- PresetAAIGetCloudOwnersByCloudRegionId.PRESET_MTN6_TO_ATT_AIC,
+ PRESET_MTN6_TO_ATT_AIC,
new PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse(vars, 0, request1),
new PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse(vars, 1, request2)
), SimulatorApi.RegistrationStrategy.APPEND);
@@ -351,7 +354,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
prepareServicePreset(infrastructureVpnService, false);
SimulatorApi.registerExpectationFromPresets(ImmutableList.of(
- PresetAAIGetCloudOwnersByCloudRegionId.PRESET_MTN6_TO_ATT_AIC,
+ PRESET_MTN6_TO_ATT_AIC,
new PresetAAIGetL3NetworksByCloudRegionSpecificState("irma-aic", "hvf6", "bae71557c5bb4d5aac6743a4e5f1d054"),
new PresetAAIGetVpnsByType()
), APPEND);
@@ -361,7 +364,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
new ArrayList<>(),
IS_GENERATED_NAMING.TRUE_BUT_GIVE_NAME_EITHER_WAY, true, true, false,
null,
- null, 0, 1, new ArrayList<>(), null);
+ null, 0, 1, new ArrayList<>(), null, false);
final String serviceInstanceName = createMacroService(serviceData, false);
SimulatorApi.registerExpectationFromPresets(ImmutableList.of(
@@ -392,7 +395,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
String instanceId = UUID.randomUUID().toString();
SimulatorApi.registerExpectationFromPresets(ImmutableList.of(
- PresetAAIGetCloudOwnersByCloudRegionId.PRESET_MTN6_TO_ATT_AIC,
+ PRESET_MTN6_TO_ATT_AIC,
PresetMsoCreateMacroCommonPre1806.ofCollectionResource(requestId, instanceId),
new PresetMSOOrchestrationRequestGet(COMPLETE, requestId)
), APPEND);
@@ -402,7 +405,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
new ArrayList<>(),
IS_GENERATED_NAMING.TRUE, true, true, false,
null,
- null, 0, 1, new ArrayList<>(), null);
+ null, 0, 1, new ArrayList<>(), null, false);
createMacroService(serviceData, false, randomAlphabetic(5), true, 1);
drawingBoardPage.deploy();
@@ -426,7 +429,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
new ArrayList<>(),
IS_GENERATED_NAMING.TRUE, true, true, false,
null,
- null, 0, 1, new ArrayList<>(), null);
+ null, 0, 1, new ArrayList<>(), null, false);
createMacroService(serviceData, false, randomAlphabetic(5), false, 1);
drawingBoardPage.deploy();
@@ -443,7 +446,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
aLaCarteVnfGroupingService.modelVersionId,
ImmutableList.of(),
IS_GENERATED_NAMING.FALSE, false, true, false,
- null, null, 0, 1, ImmutableList.of(), null);
+ null, null, 0, 1, ImmutableList.of(), null, false);
prepareServicePreset(aLaCarteVnfGroupingService, false);
createALaCarteService(serviceData, randomAlphabetic);
@@ -545,7 +548,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
new ArrayList<>(),
IS_GENERATED_NAMING.FALSE, true, false, true,
"2017-488_PASQUALE-vPE 0",
- vfModule0Name, 1, 1, new ArrayList<>(), vfModule0UUID);
+ vfModule0Name, 1, 1, new ArrayList<>(), vfModule0UUID, false);
prepareServicePreset(macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetails, false);
@@ -562,7 +565,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
new ArrayList<>(),
IS_GENERATED_NAMING.FALSE, false, false, false,
"2017-488_PASQUALE-vPE 0",
- vfModule0Name, 1, 1, new ArrayList<>(), vfModule0UUID);
+ vfModule0Name, 1, 1, new ArrayList<>(), vfModule0UUID, false);
prepareServicePreset(macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetailsVnfEcompNamingFalse, false);
@@ -579,7 +582,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
new ArrayList<>(),
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", false);
prepareServicePreset(macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetailsVnfEcompNamingFalse, false);
@@ -590,24 +593,70 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
}
+ @Test
+ @FeatureTogglingTest(FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI)
+ public void createNewServiceInstance_aLaCarte_WithVnf() {
+ final ModelInfo serviceModelInfo = ModelInfo.aLaCarteServiceCreationNewUI;
+ String serviceInstanceName = "ALaCarteWithVnf"+randomAlphabetic(5);
+ String vnfInstanceName= "VnfForALaCarte"+randomAlphabetic(5);
+ VnfData vnfData = new VnfData("vOCG_1804_VF 0", "aca3f7b1-15f9-45a5-b182-b8b5aca84a76", vnfInstanceName, true);
+ VfData vfmData = new VfData("vocg_1804_vf0..Vocg1804Vf..base_ocg..module-0", false, 1, 1, emptyList(), "815db6e5-bdfd-4cb6-9575-82c36df8747a");
+ ServiceData serviceData = new ServiceData(IS_GENERATED_NAMING.TRUE, vnfData, vfmData, true);
+
+ resetGetServicesCache();
+
+ prepareServicePreset(serviceModelInfo, true);
+
+ String serviceRequestId = UUID.randomUUID().toString();
+ String vnfRequestId = UUID.randomUUID().toString();
+ String requestorID = getUserCredentials().getUserId();
+ String serviceInstanceId = UUID.randomUUID().toString();
+ String vnfInstanceId = UUID.randomUUID().toString();
+ String vfModuleRequestId = UUID.randomUUID().toString();
+
+ registerExpectationFromPresets(
+ ImmutableList.of(
+ new PresetMSOCreateServiceInstanceAlacarte(
+ ImmutableMap.of(Keys.SERVICE_NAME, serviceInstanceName),
+ serviceRequestId, serviceInstanceId,
+ requestorID, serviceModelInfo),
+ PRESET_SOME_LEGACY_REGION_TO_ATT_AIC,
+ new PresetMSOOrchestrationRequestGet(COMPLETE, serviceRequestId),
+ new PresetMSOCreateVnfALaCarteE2E(vnfRequestId, serviceInstanceId, vnfInstanceId, "ONAP", requestorID, serviceModelInfo),
+ new PresetMSOOrchestrationRequestGet(COMPLETE, vnfRequestId),
+ PRESET_MTN6_TO_ATT_AIC,
+ new PresetMSOCreateVfModuleALaCarteE2E(vfModuleRequestId, serviceInstanceId, vnfInstanceId, requestorID, serviceModelInfo),
+ new PresetMSOOrchestrationRequestGet(COMPLETE, vfModuleRequestId)
+ ),
+ APPEND
+ );
+
+ loadServicePopup(serviceModelInfo.modelVersionId);
+ fillALaCarteServicePopup(serviceInstanceName);
+
+ createVnf(vnfData, false, true, serviceInstanceName);
+ createVfModule(serviceData, serviceInstanceName, true, false);
+ drawingBoardPage.deploy();
+ drawingBoardPage.verifyServiceCompletedOnTime(serviceInstanceName, "service "+serviceInstanceName);
+ }
@Test
@FeatureTogglingTest(FLAG_5G_IN_NEW_INSTANTIATION_UI)
- public void createNewServiceInstance_aLaCarte_validPopupDataAndUI() {
+ public void createNewServiceInstance_aLaCarte_withNetwork_validPopupDataAndUI() {
String serviceInstanceName = "NcService"+randomAlphabetic(5);
String networkInstanceName= "NcNetowrk"+randomAlphabetic(5);
String defactoNetworkInstanceName = "ExtVL"+networkInstanceName;
- BrowseASDCPage browseASDCPage = new BrowseASDCPage();
+
prepareServicePreset(aLaCarteNetworkProvider5G, true);
String serviceRequestId = UUID.randomUUID().toString();
String networkRequestId = UUID.randomUUID().toString();
String requestorID = getUserCredentials().getUserId();
registerExpectationFromPresets(
ImmutableList.of(
- new PresetMSOCreateServiceInstanceAlacarte5GServiceWithNetwork(
+ new PresetMSOCreateServiceInstanceAlacarte(
ImmutableMap.of(Keys.SERVICE_NAME, serviceInstanceName),
- serviceRequestId,
- requestorID),
+ serviceRequestId, DEFAULT_SERVICE_INSTANCE_ID,
+ requestorID, aLaCarteNetworkProvider5G),
new PresetMSOOrchestrationRequestGet(COMPLETE, serviceRequestId),
PRESET_SOME_LEGACY_REGION_TO_ATT_AIC,
new PresetMSOCreateNetworkALaCarte5G(networkRequestId, DEFAULT_SERVICE_INSTANCE_ID, defactoNetworkInstanceName, requestorID),
@@ -620,6 +669,16 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
APPEND
);
loadServicePopup(aLaCarteNetworkProvider5G.modelVersionId);
+ fillALaCarteServicePopup(serviceInstanceName);
+ VnfData networkData = new VnfData("SR-IOV Provider-1", "840ffc47-e4cf-46de-8e23-525fd8c6fdc3", defactoNetworkInstanceName, false);
+ createNetwork(networkData, false, false, serviceInstanceName);
+
+ drawingBoardPage.deploy();
+ drawingBoardPage.verifyServiceCompletedOnTime(serviceInstanceName, "service "+serviceInstanceName);
+ }
+
+ private void fillALaCarteServicePopup(String serviceInstanceName) {
+ BrowseASDCPage browseASDCPage = new BrowseASDCPage();
WebElement instanceNameInput = Get.byId("instanceName");
instanceNameInput.sendKeys(serviceInstanceName);
VidBasePage.selectSubscriberById("e433710f-9217-458d-a79d-1c7aff376d89");
@@ -631,11 +690,6 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
Click.byTestId("form-set");
VidBasePage.goOutFromIframe();
browseASDCPage.goToIframe();
- VnfData networkData = new VnfData("SR-IOV Provider-1", "840ffc47-e4cf-46de-8e23-525fd8c6fdc3", defactoNetworkInstanceName, false);
- createNetwork(networkData, false, false, serviceInstanceName);
-
- drawingBoardPage.deploy();
- drawingBoardPage.verifyServiceCompletedOnTime(serviceInstanceName, "service "+serviceInstanceName);
}
@Test
@@ -647,7 +701,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
serviceDynamicFields,
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", false);
prepareServicePreset(macroSriovWithDynamicFieldsEcompNamingTruePartialModelDetails, false);
@@ -1184,10 +1238,18 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
Assert.assertEquals(Get.byTestId("model-item-value-subscriberName").getText(), "SILVIA ROBBINS", "Subscriber name should be shown in vf module");
Assert.assertEquals(Get.byTestId("model-item-value-min").getText(), Integer.toString(serviceData.vfData.vfMin), "Min should be shown");
Assert.assertEquals(Get.byTestId("model-item-value-max").getText(), Integer.toString(serviceData.vfData.vfMax), "Max should be shown");
- if (!serviceData.vnfData.isGeneratedNaming) {
+ if (serviceData.isGeneratedNaming!=IS_GENERATED_NAMING.TRUE) {
Wait.byText(serviceInstanceName);
Assert.assertEquals(Get.byTestId("model-item-value-serviceName").getText(), serviceInstanceName, "Service name should be shown in vf module");
}
+
+ if (serviceData.isALaCarte) {
+ String lcpRegion = "hvf6";
+ Wait.waitByClassAndText("lcpRegionOption", lcpRegion, 30);
+ viewEditPage.selectLcpRegion(lcpRegion, AIC);
+ browseASDCPage.selectTenant("bae71557c5bb4d5aac6743a4e5f1d054");
+ }
+
validateDynamicFields(serviceData.vfData.dynamicFields);
uploadSupplementaryFile("invalid-file.json", false, browseASDCPage, setButtonTestId);
@@ -1263,21 +1325,33 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
}
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) {
+
+ 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, boolean isALaCarte) {
this.modelUuid = modelUuid;
this.dynamicFields = dynamicFields;
this.isGeneratedNaming = isServiceGeneratedNaming;
this.multiStageDesign = multiStageDesign;
+ this.isALaCarte = isALaCarte;
this.vnfData = new VnfData(vnfName, "69e09f68-8b63-4cc9-b9ff-860960b5db09", "VNF instance name", isVnfGeneratedNaming);
this.vfData = new VfData(vfName, isVgEnabled, vfMin, vfMax, vfModuleDynamicFields, vfVersionId);
}
- final String modelUuid;
- final List<String> dynamicFields;
- final IS_GENERATED_NAMING isGeneratedNaming;
- final boolean multiStageDesign;
- final VnfData vnfData;
- final VfData vfData;
+ public ServiceData(IS_GENERATED_NAMING isGeneratedNaming, VnfData vnfData, VfData vfData, boolean isALaCarte) {
+ this.isGeneratedNaming = isGeneratedNaming;
+ this.vnfData = vnfData;
+ this.vfData = vfData;
+ this.isALaCarte = isALaCarte;
+ }
+
+ String modelUuid;
+ List<String> dynamicFields;
+ IS_GENERATED_NAMING isGeneratedNaming;
+ boolean multiStageDesign;
+ VnfData vnfData;
+ VfData vfData;
+ boolean isALaCarte;
enum IS_GENERATED_NAMING { TRUE, FALSE, TRUE_BUT_GIVE_NAME_EITHER_WAY}
}