### Question:
ApplicationControllerCallback implements ResponseHandler<T> { @Override public void onException(AppcClientException exception) { logger.info("ON EXCEPTION IN CALLBACK"); logger.info("Exception from APPC: " + exception.getMessage()); Status exceptionStatus = appCSupport.buildStatusFromAppcException(exception); completeExternalTask(externalTask, externalTaskService, exceptionStatus); } ApplicationControllerCallback(ExternalTask externalTask, ExternalTaskService externalTaskService,
            ApplicationControllerSupport appCSupport); @Override void onResponse(T response); @Override void onException(AppcClientException exception);  }### Answer:
@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); }