Search in sources :

Example 1 with AppcClientException

use of org.onap.appc.client.lcm.exceptions.AppcClientException in project so by onap.

the class ApplicationControllerCallbackTest method onException_appcCallback_failure_Test.

@Test
public void onException_appcCallback_failure_Test() throws Exception {
    String testFailure = "test failure";
    AppcClientException appcException = new AppcClientException(testFailure);
    Status status = new Status();
    status.setCode(200);
    String exceptionMessage = "Exception on APPC request: " + testFailure;
    status.setMessage(exceptionMessage);
    doReturn(status).when(applicationControllerSupport).buildStatusFromAppcException(appcException);
    doReturn(StatusCategory.ERROR).when(applicationControllerSupport).getCategoryOf(status);
    appcTaskCallback.onException(appcException);
    Mockito.verify(mockExternalTaskService).handleBpmnError(mockExternalTask, "MSOWorkflowException", exceptionMessage);
}
Also used : Status(org.onap.appc.client.lcm.model.Status) AppcClientException(org.onap.appc.client.lcm.exceptions.AppcClientException) Test(org.junit.Test)

Example 2 with AppcClientException

use of org.onap.appc.client.lcm.exceptions.AppcClientException in project so by onap.

the class ApplicationControllerSupportTest method buildStatusFromAppcException_Test.

@Test
public void buildStatusFromAppcException_Test() {
    String errorMessage = "errormessage";
    AppcClientException exception = new AppcClientException(errorMessage);
    Status status = applicationControllerSupport.buildStatusFromAppcException(exception);
    assertThat(status.getCode() == 200);
    assertThat((status.getMessage()).equals(("Exception on APPC request: " + errorMessage)));
}
Also used : Status(org.onap.appc.client.lcm.model.Status) AppcClientException(org.onap.appc.client.lcm.exceptions.AppcClientException) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 AppcClientException (org.onap.appc.client.lcm.exceptions.AppcClientException)2 Status (org.onap.appc.client.lcm.model.Status)2