aboutsummaryrefslogtreecommitdiffstats
path: root/vid-automation/src/test
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2020-02-10 12:27:15 +0200
committerIttay Stern <ittay.stern@att.com>2020-02-12 10:04:13 +0200
commit9b2482888c7ac3da22ef9eb41ffc5b7ac864f672 (patch)
treec89e63cab2fa1477d6388a509a53d0123bd499a1 /vid-automation/src/test
parent947262d4f624ef0a8a9e933fbb5c2636f26f837e (diff)
API tests: support TENANT_AND_REGION_FROM_VNF flag
Input file redux-a-la-carte-no-testapi.json left intact, expectations differ. Issue-ID: VID-758 Change-Id: I3f073517a844bb2f002ff7375b5e3ed836462582 Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-automation/src/test')
-rw-r--r--vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationALaCarteApiTest.java28
1 files changed, 20 insertions, 8 deletions
diff --git a/vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationALaCarteApiTest.java b/vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationALaCarteApiTest.java
index 4d2f06983..20fce4012 100644
--- a/vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationALaCarteApiTest.java
+++ b/vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationALaCarteApiTest.java
@@ -41,6 +41,7 @@ import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateNetworkALaC
import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateServiceInstanceGen2WithNamesAlacarteService;
import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateServiceInstanceGen2WithNamesAlacarteServiceCypress;
import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateVfModuleALaCarteCypress;
+import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateVfModuleALaCarteCypress.Keys;
import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress;
import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateVnfALaCarteCypress2;
import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateVnfGroup;
@@ -538,10 +539,14 @@ public class AsyncInstantiationALaCarteApiTest extends AsyncInstantiationBase {
String vfModule1RequestId = UUID.randomUUID().toString();
String vfModule2RequestId = UUID.randomUUID().toString();
String volumeGroupRequestId = UUID.randomUUID().toString();
- List<PresetMSOBaseCreateInstancePost> createPresets = ImmutableList.of(
- new PresetMSOCreateServiceInstanceGen2WithNamesAlacarteServiceCypress(names, 0, DEFAULT_REQUEST_ID, Constants.GR_API, withTestApi),
- new PresetMSOCreateVnfALaCarteCypress2(vnfRequestId, DEFAULT_INSTANCE_ID, vnfRequestId, "2017-488_PASQUALE-vPE", Constants.GR_API, withTestApi),
- new PresetMSOCreateNetworkALaCarteCypress(networkRequestId, DEFAULT_INSTANCE_ID, networkRequestId, "ExtVL", Constants.GR_API, withTestApi)
+
+ PresetMSOCreateVnfALaCarteCypress2 vnfPreset =
+ new PresetMSOCreateVnfALaCarteCypress2(vnfRequestId, DEFAULT_INSTANCE_ID, vnfRequestId, "2017-488_PASQUALE-vPE", Constants.GR_API, withTestApi);
+
+ List<PresetMSOBaseCreateInstancePost> createPresets = ImmutableList.of(
+ new PresetMSOCreateServiceInstanceGen2WithNamesAlacarteServiceCypress(names, 0, DEFAULT_REQUEST_ID, Constants.GR_API, withTestApi),
+ vnfPreset,
+ new PresetMSOCreateNetworkALaCarteCypress(networkRequestId, DEFAULT_INSTANCE_ID, networkRequestId, "ExtVL", Constants.GR_API, withTestApi)
);
List<PresetMSOOrchestrationRequestGet> inProgressPresets = ImmutableList.of(
new PresetMSOOrchestrationRequestGet("instance".equals(whatToFail) ? MSO_FAILED_STATUS : COMPLETE),
@@ -554,18 +559,25 @@ public class AsyncInstantiationALaCarteApiTest extends AsyncInstantiationBase {
);
List<BasePreset> presetsWithoutVfModule = getPresets(createPresets, inProgressPresets);
+ String vfModule1CloudRegionId = Features.FLAG_2006_VFMODULE_TAKES_TENANT_AND_REGION_FROM_VNF.isActive() ? vnfPreset.getLcpCloudRegionId() : "my region";
+
+ Map<Keys, String> vfModule0And2LcpCloudRegionIdAndTenantIdNames =
+ PresetMSOCreateVfModuleALaCarteCypress.lcpCloudRegionIdAndTenantIdNames(
+ Features.FLAG_2006_VFMODULE_TAKES_TENANT_AND_REGION_FROM_VNF.isActive() ? vnfPreset.getLcpCloudRegionId() : "hvf6",
+ Features.FLAG_2006_VFMODULE_TAKES_TENANT_AND_REGION_FROM_VNF.isActive() ? vnfPreset.getTenantId() : "624eb554b0d147c19ff8885341760481");
+
ImmutableList<BasePreset> presets = new ImmutableList.Builder<BasePreset>()
.addAll(presetsWithoutVfModule)
.add(new PresetSDCGetServiceToscaModelGet("2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd", "csar-noDynamicFields-ecompNamingFalse-fullModelDetails.zip"))
.add(new PresetSDCGetServiceMetadataGet("2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd", "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", "csar-noDynamicFields-ecompNamingFalse-fullModelDetails.zip"))
- .add(new PresetMSOCreateVfModuleALaCarteCypress(vfModule0RequestId, DEFAULT_INSTANCE_ID, vnfRequestId, PresetMSOCreateVfModuleALaCarteCypress.module0Names, Constants.GR_API, withTestApi))
- .add(PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress.forVolumeGroup(volumeGroupRequestId, DEFAULT_INSTANCE_ID, vnfRequestId, Constants.GR_API, withTestApi))
- .add(PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress.forVfModule(vfModule1RequestId, DEFAULT_INSTANCE_ID, vnfRequestId, volumeGroupRequestId, Constants.GR_API, withTestApi))
+ .add(new PresetMSOCreateVfModuleALaCarteCypress(vfModule0RequestId, DEFAULT_INSTANCE_ID, vnfRequestId, PresetMSOCreateVfModuleALaCarteCypress.module0Names, vfModule0And2LcpCloudRegionIdAndTenantIdNames, Constants.GR_API, withTestApi))
+ .add(PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress.forVolumeGroup(volumeGroupRequestId, DEFAULT_INSTANCE_ID, vnfRequestId, vfModule1CloudRegionId, Constants.GR_API, withTestApi))
+ .add(PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress.forVfModule(vfModule1RequestId, DEFAULT_INSTANCE_ID, vnfRequestId, volumeGroupRequestId, vfModule1CloudRegionId, Constants.GR_API, withTestApi))
.add(PresetAAIGetCloudOwnersByCloudRegionId.PRESET_JUST_ANOTHER_REGION_TO_ATT_AIC)
.add(PresetAAIGetCloudOwnersByCloudRegionId.PRESET_MTN6_TO_ATT_AIC)
.add(PresetAAIGetCloudOwnersByCloudRegionId.PRESET_MY_REGION_TO_ATT_AIC)
.add(PresetAAIGetCloudOwnersByCloudRegionId.PRESET_LCP_REGION_TEXT_TO_ATT_AIC)
- .add(new PresetMSOCreateVfModuleALaCarteCypress(vfModule2RequestId, DEFAULT_INSTANCE_ID, vnfRequestId, PresetMSOCreateVfModuleALaCarteCypress.module2Names, Constants.GR_API, withTestApi))
+ .add(new PresetMSOCreateVfModuleALaCarteCypress(vfModule2RequestId, DEFAULT_INSTANCE_ID, vnfRequestId, PresetMSOCreateVfModuleALaCarteCypress.module2Names, vfModule0And2LcpCloudRegionIdAndTenantIdNames, Constants.GR_API, withTestApi))
.build();
registerExpectationFromPresets(