use of org.onap.appc.client.lcm.model.ResumeTrafficOutput in project so by onap.
the class ApplicationControllerCallbackTest method onResponse_appcCallback_intermediateResponse_Test.
@Test
public void onResponse_appcCallback_intermediateResponse_Test() throws Exception {
Status status = new Status();
status.setCode(100);
ResumeTrafficOutput response = new ResumeTrafficOutput();
response.setStatus(status);
doReturn(status).when(applicationControllerSupport).getStatusFromGenericResponse(response);
appcTaskCallback.onResponse(response);
Mockito.verifyZeroInteractions(mockExternalTaskService);
}
use of org.onap.appc.client.lcm.model.ResumeTrafficOutput in project so by onap.
the class ApplicationControllerCallbackTest method onResponse_appcCallback_success_Test.
@Test
public void onResponse_appcCallback_success_Test() throws Exception {
Status status = new Status();
status.setCode(400);
ResumeTrafficOutput response = new ResumeTrafficOutput();
response.setStatus(status);
doReturn(status).when(applicationControllerSupport).getStatusFromGenericResponse(response);
doReturn(true).when(applicationControllerSupport).getFinalityOf(status);
doReturn(StatusCategory.NORMAL).when(applicationControllerSupport).getCategoryOf(status);
appcTaskCallback.onResponse(response);
Mockito.verify(mockExternalTaskService).complete(mockExternalTask);
}
use of org.onap.appc.client.lcm.model.ResumeTrafficOutput in project so by onap.
the class ApplicationControllerCallbackTest method onResponse_appcCallback_failure_Test.
@Test
public void onResponse_appcCallback_failure_Test() throws Exception {
String testFailure = "test failure";
Status status = new Status();
status.setCode(200);
status.setMessage(testFailure);
ResumeTrafficOutput response = new ResumeTrafficOutput();
response.setStatus(status);
doReturn(status).when(applicationControllerSupport).getStatusFromGenericResponse(response);
doReturn(true).when(applicationControllerSupport).getFinalityOf(status);
doReturn(StatusCategory.ERROR).when(applicationControllerSupport).getCategoryOf(status);
appcTaskCallback.onResponse(response);
Mockito.verify(mockExternalTaskService).handleBpmnError(mockExternalTask, "MSOWorkflowException", testFailure);
}
Aggregations