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);
}
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)));
}
Aggregations