assertThat(requestCaptor.getValue(), jsonEquals(expectedPayloadToMso).when(IGNORING_ARRAY_ORDER));
}
+ @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()
{
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\": { " +