AbstractTaskListPresenter extends AbstractMultiGridPresenter<TaskSummary, V> { public void bulkReassign(List<TaskSummary> taskSummaries) { if (taskSummaries == null || taskSummaries.isEmpty()) { return; } String taskIdsParam = taskSummaries.stream().map(s -> s.getId().toString()).collect(Collectors.joining(",")); String deploymentIdsParam = taskSummaries.stream().map(s -> s.getDeploymentId()).collect(Collectors.joining(",")); if (taskIdsParam.isEmpty()) { return; } PlaceRequest placeRequestImpl = new DefaultPlaceRequest(TasksReassignmentPresenter.TASKS_REASSIGNMENT_POPUP); placeRequestImpl.addParameter("taskIds", taskIdsParam); placeRequestImpl.addParameter("deploymentIds", deploymentIdsParam); placeRequestImpl.addParameter("serverTemplateId", getSelectedServerTemplate()); placeManager.goTo(placeRequestImpl); }  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);  }
@Test public void bulkReassignTasksTest() { List<TaskSummary> taskSummaries = new ArrayList<>(); taskSummaries.add(createTestTaskSummary(TASK_ID, TASK_STATUS_RESERVED, identity.getIdentifier())); taskSummaries.add(createTestTaskSummary(TASK_ID + 1, TASK_STATUS_IN_PROGRESS, "")); taskSummaries.add(createTestTaskSummary(TASK_ID + 2, TASK_STATUS_SUSPENDED, "")); final List<Long> tIds = new ArrayList(); final List<String> deploymentIds = new ArrayList(); for (TaskSummary summary : taskSummaries) { tIds.add(summary.getId()); deploymentIds.add(summary.getDeploymentId()); } getPresenter().bulkReassign(taskSummaries); final ArgumentCaptor<PlaceRequest> placeRequest = ArgumentCaptor.forClass(PlaceRequest.class); verify(placeManager).goTo(placeRequest.capture()); assertEquals(TasksReassignmentPresenter.TASKS_REASSIGNMENT_POPUP, placeRequest.getValue().getIdentifier()); assertEquals(StringUtils.join(tIds, ","), placeRequest.getValue().getParameter("taskIds", null)); assertEquals(StringUtils.join(deploymentIds, ","), placeRequest.getValue().getParameter("deploymentIds", null)); }