PeopleAssignmentHelper { @SuppressWarnings("unchecked") protected void assignGroups(WorkItem workItem, PeopleAssignments peopleAssignments) { List<OrganizationalEntity> potentialOwners = peopleAssignments.getPotentialOwners(); Object groupIds = adjustParam(workItem.getParameter(GROUP_ID), groupFilter); if (groupIds instanceof Collection) { processPeopleAssignments((Collection<OrganizationalEntity>)groupIds, potentialOwners); } else { processPeopleAssignments((String)groupIds, potentialOwners, false); } } 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 testAssignGroups() { String groupId = "Software Developers, Project Managers"; Task task = TaskModelProvider.getFactory().newTask(); PeopleAssignments peopleAssignments = peopleAssignmentHelper.getNullSafePeopleAssignments(task); WorkItem workItem = new WorkItemImpl(); workItem.setParameter(PeopleAssignmentHelper.GROUP_ID, groupId); peopleAssignmentHelper.assignGroups(workItem, peopleAssignments); OrganizationalEntity organizationalEntity1 = peopleAssignments.getPotentialOwners().get(0); assertTrue(organizationalEntity1 instanceof Group); assertEquals("Software Developers", organizationalEntity1.getId()); OrganizationalEntity organizationalEntity2 = peopleAssignments.getPotentialOwners().get(1); assertTrue(organizationalEntity2 instanceof Group); assertEquals("Project Managers", organizationalEntity2.getId()); }