From f6204c8b0f9b4f778419c16400b8a431f5797beb Mon Sep 17 00:00:00 2001 From: Einat Vinouze Date: Mon, 6 Apr 2020 09:16:40 +0300 Subject: Add another VNF to the new view/edit screen - Integration test Issue-ID: VID-803 Signed-off-by: Einat Vinouze Change-Id: I9e2a58863855353b75edab44129c96b319511dde Signed-off-by: Einat Vinouze --- .../impl/AsyncInstantiationIntegrationTest.java | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'vid-app-common/src/test/java') 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 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()); + } + } -- cgit 1.2.3-korg