### Question:
ApplicationControllerTask extends ExternalTaskUtils { protected void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) { mdcSetup.setupMDC(externalTask); ApplicationControllerTaskRequest request = externalTask.getVariable("appcOrchestratorRequest"); String msoRequestId = externalTask.getVariable("mso-request-id"); logger.debug("Starting External Task for RequestId: {} ", msoRequestId); Status status = null; ApplicationControllerCallback listener = new ApplicationControllerCallback(externalTask, externalTaskService, applicationControllerSupport); try { status = applicationControllerTaskImpl.execute(msoRequestId, request, listener); if (status != null && status.getCode() != 0 && !applicationControllerSupport.getCategoryOf(status).equals(StatusCategory.NORMAL)) { logger.error("The External Task Id: {} Failed locally with status {}", externalTask.getId(), status.getMessage()); externalTaskService.handleBpmnError(externalTask, "MSOWorkflowException", status.getMessage()); } } catch (Exception e) { logger.error("The External Task Id: {} Failed while calling appc with exception", externalTask.getId(), e.getMessage()); externalTaskService.handleBpmnError(externalTask, "MSOWorkflowException", e.getMessage()); } }   @Autowired
    public Environment env; @Autowired
    public ApplicationControllerTaskImpl applicationControllerTaskImpl; @Autowired
    public ApplicationControllerSupport applicationControllerSupport; }### Answer:
@Test public void executeExternalTask_appc_success_Test() throws Exception { Status status = new Status(); doReturn(status).when(applicationControllerTaskImpl).execute(any(String.class), any(ApplicationControllerTaskRequest.class), any(ApplicationControllerCallback.class)); appcTaskService.executeExternalTask(mockExternalTask, mockExternalTaskService); Mockito.verify(applicationControllerTaskImpl).execute(any(String.class), any(ApplicationControllerTaskRequest.class), any(ApplicationControllerCallback.class)); }