TaskAdminPresenter extends AbstractTaskPresenter { public void forwardTask(final String entity) { taskService.call(nothing -> { displayNotification(constants.TaskWithIdWasForwarded(String.valueOf(getTaskId()), entity)); taskRefreshed.fire(new TaskRefreshedEvent(getServerTemplateId(), getContainerId(), getTaskId())); refreshTaskPotentialOwners(); }).forward(getServerTemplateId(), getContainerId(), getTaskId(), entity); }  @Inject void setTaskService(final Caller<TaskService> taskService); @PostConstruct void init(); IsWidget getView(); void forwardTask(final String entity); void reminder(); void refreshTaskPotentialOwners(); void onTaskSelectionEvent(@Observes final TaskSelectionEvent event); void onTaskRefreshedEvent(@Observes final TaskRefreshedEvent event);  }
@Test public void testForwardTask() { final String serverTemplateId = "serverTemplateId"; final String containerId = "containerId"; final Long taskId = 1L; final String entity = "user"; final TaskSelectionEvent event = new TaskSelectionEvent(serverTemplateId, containerId, taskId, "task", true, false); presenter.onTaskSelectionEvent(event); presenter.forwardTask(entity); verify(taskService).forward(serverTemplateId, containerId, taskId, entity); verify(notification).fire(any()); verify(taskRefreshed).fire(any()); }