summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2020-02-10 11:52:25 +0200
committerIttay Stern <ittay.stern@att.com>2020-02-10 12:18:06 +0200
commit5189376a3ee9729a0f418a136a39e0dfe2db72dd (patch)
tree881ea87c1541019553fd5fa0496206ff69f05504
parent5f441ea7520e585dd53f118b799626d53eb2d924 (diff)
AsyncInstantiationIntegrationTest: cleanup and enable TENANT_AND_REGION_FROM_VNF
Issue-ID: VID-758 Change-Id: Ie040e7fb3da031cd48b04eb2543a6209b7215f07 Signed-off-by: Ittay Stern <ittay.stern@att.com>
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/job/impl/AsyncInstantiationIntegrationTest.java20
-rw-r--r--vid-app-common/src/test/resources/payload_jsons/vfModuleDelete1Create1None1Request.json3
2 files changed, 9 insertions, 14 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/job/impl/AsyncInstantiationIntegrationTest.java b/vid-app-common/src/test/java/org/onap/vid/job/impl/AsyncInstantiationIntegrationTest.java
index fe6cfafb4..642adb307 100644
--- a/vid-app-common/src/test/java/org/onap/vid/job/impl/AsyncInstantiationIntegrationTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/job/impl/AsyncInstantiationIntegrationTest.java
@@ -194,7 +194,12 @@ public class AsyncInstantiationIntegrationTest extends AsyncInstantiationBaseTes
void defineMocks() {
Mockito.reset(restMso);
Mockito.reset(aaiClient);
+ Mockito.reset(commandUtils);
mockAaiClientAnyNameFree();
+
+ when(featureManager.isActive(Features.FLAG_ASYNC_ALACARTE_VNF)).thenReturn(true);
+ when(featureManager.isActive(Features.FLAG_ASYNC_ALACARTE_VFMODULE)).thenReturn(true);
+ when(featureManager.isActive(Features.FLAG_2006_VFMODULE_TAKES_TENANT_AND_REGION_FROM_VNF)).thenReturn(true);
}
@Test
@@ -376,9 +381,7 @@ public class AsyncInstantiationIntegrationTest extends AsyncInstantiationBaseTes
* not looking on audit (yet)
*/
- reset(restMso);
- when(featureManager.isActive(Features.FLAG_ASYNC_ALACARTE_VNF)).thenReturn(true);
- when(featureManager.isActive(Features.FLAG_ASYNC_ALACARTE_VFMODULE)).thenReturn(false);
+ when(featureManager.isActive(Features.FLAG_ASYNC_ALACARTE_VFMODULE)).thenReturn(false); // this makes the test pass without mocking the vfModules
final String SERVICE_REQUEST_ID = UUID.randomUUID().toString();
final String SERVICE_INSTANCE_ID = UUID.randomUUID().toString();
final String VNF_REQUEST_ID = UUID.randomUUID().toString();
@@ -421,8 +424,6 @@ public class AsyncInstantiationIntegrationTest extends AsyncInstantiationBaseTes
String msoVnfStatus = COMPLETE_STR;
- when(featureManager.isActive(Features.FLAG_ASYNC_ALACARTE_VNF)).thenReturn(true);
- when(featureManager.isActive(Features.FLAG_ASYNC_ALACARTE_VFMODULE)).thenReturn(true);
final String SERVICE_REQUEST_ID = UUID.randomUUID().toString();
final String SERVICE_INSTANCE_ID = UUID.randomUUID().toString();
final String VNF_REQUEST_ID = UUID.randomUUID().toString();
@@ -436,7 +437,6 @@ public class AsyncInstantiationIntegrationTest extends AsyncInstantiationBaseTes
//push alacarte with 1 vnf, verify STATUS pending
UUID uuid = pushALaCarteWithVnf();
singleServicesAndAssertStatus(JobStatus.PENDING, uuid);
- reset(restMso);
/*---------- service -----------*/
@@ -519,8 +519,6 @@ public class AsyncInstantiationIntegrationTest extends AsyncInstantiationBaseTes
NetworkDetails networkDetails1 = new NetworkDetails("LukaDoncic", "1");
NetworkDetails networkDetails2 = new NetworkDetails("KevinDurant", "2");
- reset(restMso);
-
/*---------- service -----------*/
//mock mso to answer 200 of create service instance request, verify STATUS in progress
@@ -1019,8 +1017,6 @@ public class AsyncInstantiationIntegrationTest extends AsyncInstantiationBaseTes
JobStatus expectedJobStatus,
int getStatusCounter) throws IOException, AsdcCatalogException {
- when(featureManager.isActive(Features.FLAG_ASYNC_ALACARTE_VFMODULE)).thenReturn(true);
- reset(commandUtils);
when(commandUtils.isVfModuleBaseModule("6b528779-44a3-4472-bdff-9cd15ec93450", "f8360508-3f17-4414-a2ed-6bc71161e8db")).thenReturn(true);
when(commandUtils.isVfModuleBaseModule("6b528779-44a3-4472-bdff-9cd15ec93450", "25284168-24bb-4698-8cb4-3f509146eca5")).thenReturn(false);
@@ -1271,7 +1267,6 @@ public class AsyncInstantiationIntegrationTest extends AsyncInstantiationBaseTes
asyncRequestStatusResponseAsRestObject(IN_PROGRESS_STR),
asyncRequestStatusResponseAsRestObject(COMPLETE_STR));
- when(featureManager.isActive(Features.FLAG_ASYNC_ALACARTE_VFMODULE)).thenReturn(true);
enableAddCloudOwnerOnMsoRequest();
@@ -1318,14 +1313,11 @@ public class AsyncInstantiationIntegrationTest extends AsyncInstantiationBaseTes
public void deployService_failIt_retryDeploy_getRetryAsTemplate_makeSureFalsyIsFailedInTemplate() {
final String SERVICE_REQUEST_ID = UUID.randomUUID().toString();
- when(featureManager.isActive(Features.FLAG_ASYNC_ALACARTE_VNF)).thenReturn(true);
- when(featureManager.isActive(Features.FLAG_ASYNC_ALACARTE_VFMODULE)).thenReturn(true);
//push alacarte with 1 vnf, verify STATUS pending
UUID uuid = pushALaCarteWithVnf();
singleServicesAndAssertStatus(JobStatus.PENDING, uuid);
- reset(restMso);
//mock mso to answer 200 of create service instance request, verify STATUS in progress
when(restMso.restCall(eq(HttpMethod.POST), eq(RequestReferencesContainer.class), any(), endsWith("serviceInstances"), any())).thenReturn(
createResponse(200, SERVICE_INSTANCE_ID, SERVICE_REQUEST_ID));
diff --git a/vid-app-common/src/test/resources/payload_jsons/vfModuleDelete1Create1None1Request.json b/vid-app-common/src/test/resources/payload_jsons/vfModuleDelete1Create1None1Request.json
index 642c2aac9..a4f609a28 100644
--- a/vid-app-common/src/test/resources/payload_jsons/vfModuleDelete1Create1None1Request.json
+++ b/vid-app-common/src/test/resources/payload_jsons/vfModuleDelete1Create1None1Request.json
@@ -10,6 +10,7 @@
"instanceId": "VF_MODULE_INSTANCE_ID",
"action": "Create",
"lcpCloudRegionId": "AAIAIC25",
+ "legacyRegion": "some legacy region",
"tenantId": "092eb9e8e4b7412e8787dd091bc58e86",
"modelInfo": {
"modelInvariantId": "b34833bb-6aa9-4ad6-a831-70b06367a091",
@@ -36,6 +37,7 @@
"provStatus": "Prov Status",
"inMaint": false,
"lcpCloudRegionId": "AAIAIC25",
+ "legacyRegion": "some legacy region",
"tenantId": "092eb9e8e4b7412e8787dd091bc58e86",
"modelInfo": {
"modelInvariantId": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1",
@@ -59,6 +61,7 @@
"provStatus": "Prov Status",
"inMaint": false,
"lcpCloudRegionId": "AAIAIC25",
+ "legacyRegion": "some legacy region",
"tenantId": "092eb9e8e4b7412e8787dd091bc58e86",
"modelInfo": {
"modelInvariantId": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1",