PeopleAssignmentHelper { @SuppressWarnings("unchecked") protected void assignTaskStakeholders(WorkItem workItem, InternalPeopleAssignments peopleAssignments) { List<OrganizationalEntity> taskStakeholders = peopleAssignments.getTaskStakeholders(); Object taskStakehodlerIds = adjustParam(workItem.getParameter(TASKSTAKEHOLDER_ID), noFilter); if (taskStakehodlerIds instanceof Collection) { processPeopleAssignments((Collection<OrganizationalEntity>)taskStakehodlerIds, taskStakeholders); } else { processPeopleAssignments((String)taskStakehodlerIds, taskStakeholders, true); } } PeopleAssignmentHelper();  PeopleAssignmentHelper(String separator);  PeopleAssignmentHelper(String adminUser, String adminGroup);  PeopleAssignmentHelper(CaseData caseFile); void handlePeopleAssignments(WorkItem workItem, InternalTask task, InternalTaskData taskData); static final String ACTOR_ID; static final String GROUP_ID; static final String BUSINESSADMINISTRATOR_ID; static final String BUSINESSADMINISTRATOR_GROUP_ID; static final String TASKSTAKEHOLDER_ID; static final String EXCLUDED_OWNER_ID; static final String RECIPIENT_ID; static final String DEFAULT_ADMIN_USER; static final String DEFAULT_ADMIN_GROUP; }
@Test public void testAssignTaskstakeholders() { String taskStakeholderId = "espiegelberg"; Task task = TaskModelProvider.getFactory().newTask(); InternalPeopleAssignments peopleAssignments = peopleAssignmentHelper.getNullSafePeopleAssignments(task); WorkItem workItem = new WorkItemImpl(); workItem.setParameter(PeopleAssignmentHelper.TASKSTAKEHOLDER_ID, taskStakeholderId); peopleAssignmentHelper.assignTaskStakeholders(workItem, peopleAssignments); assertEquals(1, peopleAssignments.getTaskStakeholders().size()); OrganizationalEntity organizationalEntity1 = peopleAssignments.getTaskStakeholders().get(0); assertTrue(organizationalEntity1 instanceof User); assertEquals(taskStakeholderId, organizationalEntity1.getId()); }