use of org.onap.so.apihandler.common.RequestClientParameter in project so by onap.
the class ResumeOrchestrationRequestTest method setRequestClientParameterVfModuleTest.
@Test
public void setRequestClientParameterVfModuleTest() throws ApiException, IOException {
when(requestHandler.mapJSONtoMSOStyle(anyString(), any(ServiceInstancesRequest.class), anyBoolean(), any(Action.class))).thenReturn(requestBody);
doReturn(ModelType.vfModule).when(requestHandler).getModelType(action, modelInfo);
RequestClientParameter result = resumeReq.setRequestClientParameter(lookupResult, version, infraActiveRequestVfModule, currentActiveRequest, "pnfCorrelationId", aLaCarte, sir);
assertThat(requestClientParameterVfModule, sameBeanAs(result));
}
use of org.onap.so.apihandler.common.RequestClientParameter in project so by onap.
the class ResumeOrchestrationRequestTest method resumeRequestTestALaCarteNull.
@Test
public void resumeRequestTestALaCarteNull() throws ApiException, IOException {
Response response = null;
doReturn(instanceIdMap).when(resumeReq).setInstanceIdMap(infraActiveRequest, ModelType.service.toString());
doReturn(SERVICE_INSTANCE_NAME).when(resumeReq).getInstanceName(infraActiveRequest, ModelType.service.toString(), currentActiveRequest);
when(requestHandler.convertJsonToServiceInstanceRequest(anyString(), any(Actions.class), anyString(), anyString())).thenReturn(sirNullALaCarte);
when(serviceInstances.getPnfCorrelationId(any(ServiceInstancesRequest.class))).thenReturn("pnfCorrelationId");
doReturn(false).when(msoRequest).getAlacarteFlag(sirNullALaCarte);
doReturn(lookupResult).when(requestHandler).getServiceInstanceOrchestrationURI(sirNullALaCarte, action, false, currentActiveRequest);
doReturn(requestClientParameter).when(resumeReq).setRequestClientParameter(lookupResult, version, infraActiveRequest, currentActiveRequest, "pnfCorrelationId", aLaCarte, sirNullALaCarte);
doReturn(false).when(resumeReq).setALaCarteFlagIfNull(SERVICE, action);
doNothing().when(resumeReq).requestDbSave(currentActiveRequest);
when(requestHandler.postBPELRequest(any(InfraActiveRequests.class), any(RequestClientParameter.class), anyString(), anyString())).thenReturn(response);
doNothing().when(resumeReq).checkForInProgressRequest(currentActiveRequest, instanceIdMap, SERVICE, SERVICE_INSTANCE_NAME, action);
resumeReq.resumeRequest(infraActiveRequest, currentActiveRequest, version, "/onap/so/infra/orchestrationRequests/v7/requests/00032ab7-na18-42e5-965d-8ea592502018/resume");
verify(requestHandler).postBPELRequest(currentActiveRequest, requestClientParameter, lookupResult.getOrchestrationURI(), infraActiveRequest.getRequestScope());
}
use of org.onap.so.apihandler.common.RequestClientParameter in project so by onap.
the class NetworkRestHandlerTest method test_buildRequestParams.
@Test
public void test_buildRequestParams() throws Exception {
RequestClientParameter expected = new RequestClientParameter.Builder().setRequestId("requestId").setServiceInstanceId("serviceInstanceId").setNetworkId("networkId").setALaCarte(true).setRequestDetails(mapper.writeValueAsString(createTestRequest())).setRequestAction(Action.deleteInstance.toString()).setRequestUri("http://localhost:8080/serviceInstances").setApiVersion("v8").build();
RequestClientParameter actual = restHandler.buildRequestParams(createTestRequest(), "http://localhost:8080/serviceInstances", "requestId", "serviceInstanceId", "networkId");
assertThat(actual, sameBeanAs(expected));
}
use of org.onap.so.apihandler.common.RequestClientParameter in project so by onap.
the class VnfRestHandlerTest method test_buildRequestParams.
@Test
public void test_buildRequestParams() throws Exception {
RequestClientParameter expected = new RequestClientParameter.Builder().setRequestId("requestId").setServiceInstanceId("serviceInstanceId").setVnfId("vnfId").setALaCarte(true).setRequestDetails(mapper.writeValueAsString(createTestRequest())).setRequestAction(Action.deleteInstance.toString()).setRequestUri("http://localhost:8080/serviceInstances").setApiVersion("v8").build();
RequestClientParameter actual = restHandler.buildRequestParams(createTestRequest(), "http://localhost:8080/serviceInstances", "requestId", "serviceInstanceId", "vnfId");
assertThat(actual, sameBeanAs(expected));
}
use of org.onap.so.apihandler.common.RequestClientParameter in project so by onap.
the class VolumeRestHandlerTest method test_buildRequestParams.
@Test
public void test_buildRequestParams() throws Exception {
RequestClientParameter expected = new RequestClientParameter.Builder().setRequestId("requestId").setServiceInstanceId("serviceInstanceId").setVnfId("vnfId").setVolumeGroupId("volumeGroupId").setALaCarte(true).setRequestDetails(mapper.writeValueAsString(createTestRequest())).setRequestAction(Action.deleteInstance.toString()).setRequestUri("http://localhost:8080/serviceInstances").setApiVersion("v8").build();
RequestClientParameter actual = restHandler.buildRequestParams(createTestRequest(), "http://localhost:8080/serviceInstances", "requestId", "serviceInstanceId", "vnfId", "volumeGroupId");
assertThat(actual, sameBeanAs(expected));
}
Aggregations