diff options
author | Alexey Sandler <alexey.sandler@intl.att.com> | 2020-04-07 09:26:14 +0300 |
---|---|---|
committer | Alexey Sandler <alexey.sandler@intl.att.com> | 2020-04-16 13:11:21 +0300 |
commit | 98353ac591a001812ae0c331611e9a8dfc7288ed (patch) | |
tree | 639b3422309e3c6313a36b8db9f02bd350dcc6b3 /vid-app-common/src | |
parent | 20f99e58b7db96c4f467ac4f7ccc0bc2a1db03ee (diff) |
add network: create test to verify payload to MSO
Issue-ID: VID-802
Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
Change-Id: Ib150b9d67f7ba50eb619b5483b99eb4ae906b9d8
Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
Diffstat (limited to 'vid-app-common/src')
-rw-r--r-- | vid-app-common/src/test/java/org/onap/vid/job/impl/AsyncInstantiationIntegrationTest.java | 28 |
1 files changed, 28 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 c165c865d..dfacf57a3 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 @@ -1287,6 +1287,30 @@ public class AsyncInstantiationIntegrationTest extends AsyncInstantiationBaseTes } @Test + public void viewEdit_oneNetworkExistsAddAnotherNetwork() { + String currentServiceInstanceId = "ce2821fc-3b28-4759-9613-1e514d7563c0"; + String addNetworkRequestId = randomUuid(); + String userId = "az2016"; + + + String expectedMsoAddNetworkPath = + "/serviceInstantiation/v7/serviceInstances/" + currentServiceInstanceId + "/networks"; + + when(restMso.restCall(eq(HttpMethod.POST),eq(RequestReferencesContainer.class),any(), eq(expectedMsoAddNetworkPath), any())) + .thenReturn(createResponse(202, currentServiceInstanceId, addNetworkRequestId)); + + when(restMso.GetForObject(eq("/orchestrationRequests/v7/" + addNetworkRequestId),eq(AsyncRequestStatus.class))) + .thenReturn(asyncRequestStatusResponseAsRestObject(COMPLETE_STR)); + + List<UUID> uuids= asyncInstantiationBL.pushBulkJob(addNetworkBulkPayload(), userId); + assertThat(uuids, hasSize(1)); + processJobsCountTimesAndAssertStatus(uuids.get(0), 200, COMPLETED); + + verify(restMso, times(1)).restCall(eq(HttpMethod.POST), any(), any(), eq(expectedMsoAddNetworkPath),any()); + verify(restMso, times(1)).GetForObject(any(),any()); + } + + @Test public void whenDeletingVfModule_thenExpectedDeleteRequestSent() { String currentServiceInstanceId = "6196ab1f-2349-4b32-9b6c-cffeb0ccc79c"; @@ -1334,6 +1358,10 @@ public class AsyncInstantiationIntegrationTest extends AsyncInstantiationBaseTes return readJsonResourceFileAsObject("/payload_jsons/vfmodule/delete_1_vfmodule_expected_bulk.json", ServiceInstantiation.class); } + private ServiceInstantiation addNetworkBulkPayload() { + return readJsonResourceFileAsObject("/payload_jsons/Network/one_network_exists_add_another_network_expected_bulk.json", ServiceInstantiation.class); + } + private String getDeleteVfModulePayloadToMso() { return "{ " + " \"requestDetails\": { " + |