aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/test/java/org
diff options
context:
space:
mode:
authorEinat Vinouze <einat.vinouze@intl.att.com>2020-04-06 09:16:40 +0300
committerEinat Vinouze <einat.vinouze@intl.att.com>2020-04-06 15:25:15 +0300
commitf6204c8b0f9b4f778419c16400b8a431f5797beb (patch)
tree9a28e46f631b204d9c8179c1c406580e2c921400 /vid-app-common/src/test/java/org
parentdf22976883c366960aa3e5003fc3002425ab7c98 (diff)
Add another VNF to the new view/edit screen - Integration test
Issue-ID: VID-803 Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com> Change-Id: I9e2a58863855353b75edab44129c96b319511dde Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com>
Diffstat (limited to 'vid-app-common/src/test/java/org')
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/job/impl/AsyncInstantiationIntegrationTest.java23
1 files changed, 23 insertions, 0 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 c70bbd76a..c165c865d 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
@@ -1418,4 +1418,27 @@ public class AsyncInstantiationIntegrationTest extends AsyncInstantiationBaseTes
assertNull(templateOfRetry.getStatusMessage());
}
+ @Test
+ public void oneVnfExistsAddAnotherVnf(){
+ final String VNF_REQUEST_ID = UUID.randomUUID().toString();
+ final String VNF_INSTANCE_ID = UUID.randomUUID().toString();
+
+ ServiceInstantiation serviceInstantiation = readJsonResourceFileAsObject("/payload_jsons/vnf/one_vnf_exists_add_another_vnf_expected_bulk.json",
+ ServiceInstantiation.class);
+ List<UUID> uuids = asyncInstantiationBL.pushBulkJob(serviceInstantiation, USER_ID);
+ assertThat(uuids, hasSize(1));
+
+ //mock mso to answer 200 of create vnf instance request
+ when(restMso.restCall(eq(HttpMethod.POST), eq(RequestReferencesContainer.class), any(), endsWith("e6cc1c4f-05f7-49bc-8e86-ac2eb92baaaa/vnfs"), any())).thenReturn(
+ createResponse(200, VNF_INSTANCE_ID, VNF_REQUEST_ID));
+
+ //mock mso to answer msoVnfStatus (COMPLETE) for vnf creation status,
+ when(restMso.GetForObject(endsWith(VNF_REQUEST_ID), eq(AsyncRequestStatus.class))).
+ thenReturn(asyncRequestStatusResponseAsRestObject(COMPLETE_STR));
+
+ processJobsCountTimesAndAssertStatus(uuids.get(0), 200, COMPLETED);
+ verify(restMso, times(1)).restCall(eq(HttpMethod.POST), any(), any(), endsWith("e6cc1c4f-05f7-49bc-8e86-ac2eb92baaaa/vnfs"), any());
+ verify(restMso, times(1)).GetForObject(any(), any());
+ }
+
}