Search in sources :

Example 26 with RequestClientParameter

use of org.onap.so.apihandler.common.RequestClientParameter in project so by onap.

the class ResumeOrchestrationRequestTest method resumeRequestTest.

@Test
public void resumeRequestTest() 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(sir);
    when(serviceInstances.getPnfCorrelationId(any(ServiceInstancesRequest.class))).thenReturn("pnfCorrelationId");
    doReturn(lookupResult).when(requestHandler).getServiceInstanceOrchestrationURI(sir, action, aLaCarte, currentActiveRequest);
    doReturn(requestClientParameter).when(resumeReq).setRequestClientParameter(lookupResult, version, infraActiveRequest, currentActiveRequest, "pnfCorrelationId", aLaCarte, sir);
    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());
}
Also used : Response(javax.ws.rs.core.Response) InfraActiveRequests(org.onap.so.db.request.beans.InfraActiveRequests) ServiceInstancesRequest(org.onap.so.serviceinstancebeans.ServiceInstancesRequest) RequestClientParameter(org.onap.so.apihandler.common.RequestClientParameter) Test(org.junit.Test)

Aggregations

RequestClientParameter (org.onap.so.apihandler.common.RequestClientParameter)26 ValidateException (org.onap.so.apihandlerinfra.exceptions.ValidateException)16 IOException (java.io.IOException)15 ApiException (org.onap.so.apihandlerinfra.exceptions.ApiException)14 Response (javax.ws.rs.core.Response)13 ApiResponse (io.swagger.v3.oas.annotations.responses.ApiResponse)11 CamundaResponse (org.onap.so.apihandler.camundabeans.CamundaResponse)11 BPMNFailureException (org.onap.so.apihandlerinfra.exceptions.BPMNFailureException)11 InfraActiveRequests (org.onap.so.db.request.beans.InfraActiveRequests)11 ServiceInstancesRequest (org.onap.so.serviceinstancebeans.ServiceInstancesRequest)11 ErrorLoggerInfo (org.onap.so.apihandlerinfra.logging.ErrorLoggerInfo)10 Test (org.junit.Test)9 ResponseBuilder (org.onap.so.apihandler.common.ResponseBuilder)8 RequestDbFailureException (org.onap.so.apihandlerinfra.exceptions.RequestDbFailureException)8 GetE2EServiceInstanceResponse (org.onap.so.apihandlerinfra.e2eserviceinstancebeans.GetE2EServiceInstanceResponse)6 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)5 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)5 JSONObject (org.json.JSONObject)4 ValidationException (org.onap.so.exceptions.ValidationException)4 AAIFluentTypeBuilder (org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder)3