Search in sources :

Example 1 with ResumeTrafficOutput

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);
}
Also used : Status(org.onap.appc.client.lcm.model.Status) ResumeTrafficOutput(org.onap.appc.client.lcm.model.ResumeTrafficOutput) Test(org.junit.Test)

Example 2 with ResumeTrafficOutput

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);
}
Also used : Status(org.onap.appc.client.lcm.model.Status) ResumeTrafficOutput(org.onap.appc.client.lcm.model.ResumeTrafficOutput) Test(org.junit.Test)

Example 3 with ResumeTrafficOutput

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);
}
Also used : Status(org.onap.appc.client.lcm.model.Status) ResumeTrafficOutput(org.onap.appc.client.lcm.model.ResumeTrafficOutput) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 ResumeTrafficOutput (org.onap.appc.client.lcm.model.ResumeTrafficOutput)3 Status (org.onap.appc.client.lcm.model.Status)3