PeopleAssignmentHelper { @SuppressWarnings("unchecked") protected void assignRecipients(WorkItem workItem, InternalPeopleAssignments peopleAssignments) { List<OrganizationalEntity> recipients = peopleAssignments.getRecipients(); Object recipientIds = adjustParam(workItem.getParameter(RECIPIENT_ID), noFilter); if (recipientIds instanceof Collection) { processPeopleAssignments((Collection<OrganizationalEntity>)recipientIds, recipients); } else { processPeopleAssignments((String)recipientIds, recipients, 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 testAssignRecipients() { String recipientId = "espiegelberg"; Task task = TaskModelProvider.getFactory().newTask(); InternalPeopleAssignments peopleAssignments = peopleAssignmentHelper.getNullSafePeopleAssignments(task); WorkItem workItem = new WorkItemImpl(); workItem.setParameter(PeopleAssignmentHelper.RECIPIENT_ID, recipientId); peopleAssignmentHelper.assignRecipients(workItem, peopleAssignments); assertEquals(1, peopleAssignments.getRecipients().size()); OrganizationalEntity organizationalEntity1 = peopleAssignments.getRecipients().get(0); assertTrue(organizationalEntity1 instanceof User); assertEquals(recipientId, organizationalEntity1.getId()); }