@Test public void claimAndWorkTaskTest() { final TaskSummary task = TaskSummary.builder().id(TASK_ID).deploymentId(TASK_DEPLOYMENT_ID).status("Ready").build(); getPresenter().claimAndWorkTask(task); verify(taskService).claimTask("", TASK_DEPLOYMENT_ID, TASK_ID); verify(placeManager).goTo(PerspectiveIds.TASK_DETAILS_SCREEN); verify(viewMock).displayNotification(any()); }
public void claimAndWorkTask(final TaskSummary task) { taskService.call((Void nothing) -> { view.displayNotification(constants.TaskWasClaimed(String.valueOf(task.getId()), task.getName())); selectSummaryItem(task); refreshGrid(); }, (Message message, Throwable throwable) -> { view.displayNotification(constants.UnableToClaimTask(String.valueOf(task.getId()), task.getName(), throwable.getMessage())); return true; } ).claimTask(getSelectedServerTemplate(), task.getDeploymentId(), task.getId()); }
AbstractTaskListPresenter extends AbstractMultiGridPresenter<TaskSummary, V> { public void claimAndWorkTask(final TaskSummary task) { taskService.call((Void nothing) -> { view.displayNotification(constants.TaskWasClaimed(String.valueOf(task.getId()), task.getName())); selectSummaryItem(task); refreshGrid(); }, (Message message, Throwable throwable) -> { view.displayNotification(constants.UnableToClaimTask(String.valueOf(task.getId()), task.getName(), throwable.getMessage())); return true; } ).claimTask(getSelectedServerTemplate(), task.getDeploymentId(), task.getId()); } }
AbstractTaskListPresenter extends AbstractMultiGridPresenter<TaskSummary, V> { public void claimAndWorkTask(final TaskSummary task) { taskService.call((Void nothing) -> { view.displayNotification(constants.TaskWasClaimed(String.valueOf(task.getId()), task.getName())); selectSummaryItem(task); refreshGrid(); }, (Message message, Throwable throwable) -> { view.displayNotification(constants.UnableToClaimTask(String.valueOf(task.getId()), task.getName(), throwable.getMessage())); return true; } ).claimTask(getSelectedServerTemplate(), task.getDeploymentId(), task.getId()); }  }
AbstractTaskListPresenter extends AbstractMultiGridPresenter<TaskSummary, V> { public void claimAndWorkTask(final TaskSummary task) { taskService.call((Void nothing) -> { view.displayNotification(constants.TaskWasClaimed(String.valueOf(task.getId()), task.getName())); selectSummaryItem(task); refreshGrid(); }, (Message message, Throwable throwable) -> { view.displayNotification(constants.UnableToClaimTask(String.valueOf(task.getId()), task.getName(), throwable.getMessage())); return true; } ).claimTask(getSelectedServerTemplate(), task.getDeploymentId(), task.getId()); }  abstract void setupDetailBreadcrumb(String detailLabel); @Override void openErrorView(final String tId); @Override Predicate<TaskSummary> getViewErrorsActionCondition(); void getDomainSpecifDataForTasks(final Integer startRange,
                                            final List<TaskSummary> tasksFromDataSet,
                                            final Boolean lastPageExactCount); void releaseTask(final TaskSummary task); void claimTask(final TaskSummary task); void claimAndWorkTask(final TaskSummary task); void resumeTask(final TaskSummary task); void suspendTask(final TaskSummary task); void getMenus(final Consumer<Menus> menusConsumer); @Override void selectSummaryItem(final TaskSummary summary); void onTaskRefreshedEvent(@Observes TaskRefreshedEvent event); void onTaskDetailsClosed(@Observes BeforeClosePlaceEvent closed); void onTaskCompletedEvent(@Observes TaskCompletedEvent event); @Inject void setDataSetQueryHelperDomainSpecific(final DataSetQueryHelper dataSetQueryHelperDomainSpecific); @Inject void setTaskService(final Caller<TaskService> taskService); @Override void setupActiveSearchFilters(); @Override boolean existActiveSearchFilters(); @Override ActiveFilterItem getActiveFilterFromColumnFilter(ColumnFilter columnFilter); String getStatusColumnFilterDescription(ColumnFilter columnFilter); void openProcessInstanceView(final String processInstanceId); void bulkClaim(List<TaskSummary> taskSummaries); void bulkRelease(List<TaskSummary> taskSummaries); void bulkResume(List<TaskSummary> taskSummaries); void bulkSuspend(List<TaskSummary> taskSummaries); void bulkReassign(List<TaskSummary> taskSummaries); @Inject void setTranslationService(TranslationService translationService); }
AbstractTaskListPresenter extends AbstractMultiGridPresenter<TaskSummary, V> { public void claimAndWorkTask(final TaskSummary task) { taskService.call((Void nothing) -> { view.displayNotification(constants.TaskWasClaimed(String.valueOf(task.getId()), task.getName())); selectSummaryItem(task); refreshGrid(); }, (Message message, Throwable throwable) -> { view.displayNotification(constants.UnableToClaimTask(String.valueOf(task.getId()), task.getName(), throwable.getMessage())); return true; } ).claimTask(getSelectedServerTemplate(), task.getDeploymentId(), task.getId()); }  abstract void setupDetailBreadcrumb(String detailLabel); @Override void openErrorView(final String tId); @Override Predicate<TaskSummary> getViewErrorsActionCondition(); void getDomainSpecifDataForTasks(final Integer startRange,
                                            final List<TaskSummary> tasksFromDataSet,
                                            final Boolean lastPageExactCount); void releaseTask(final TaskSummary task); void claimTask(final TaskSummary task); void claimAndWorkTask(final TaskSummary task); void resumeTask(final TaskSummary task); void suspendTask(final TaskSummary task); void getMenus(final Consumer<Menus> menusConsumer); @Override void selectSummaryItem(final TaskSummary summary); void onTaskRefreshedEvent(@Observes TaskRefreshedEvent event); void onTaskDetailsClosed(@Observes BeforeClosePlaceEvent closed); void onTaskCompletedEvent(@Observes TaskCompletedEvent event); @Inject void setDataSetQueryHelperDomainSpecific(final DataSetQueryHelper dataSetQueryHelperDomainSpecific); @Inject void setTaskService(final Caller<TaskService> taskService); @Override void setupActiveSearchFilters(); @Override boolean existActiveSearchFilters(); @Override ActiveFilterItem getActiveFilterFromColumnFilter(ColumnFilter columnFilter); String getStatusColumnFilterDescription(ColumnFilter columnFilter); void openProcessInstanceView(final String processInstanceId); void bulkClaim(List<TaskSummary> taskSummaries); void bulkRelease(List<TaskSummary> taskSummaries); void bulkResume(List<TaskSummary> taskSummaries); void bulkSuspend(List<TaskSummary> taskSummaries); void bulkReassign(List<TaskSummary> taskSummaries); @Inject void setTranslationService(TranslationService translationService);  }