PeopleAssignmentHelper { @SuppressWarnings("unchecked") protected void assignExcludedOwners(WorkItem workItem, InternalPeopleAssignments peopleAssignments) { List<OrganizationalEntity> excludedOwners = peopleAssignments.getExcludedOwners(); Object excludedOwnerIds = adjustParam(workItem.getParameter(EXCLUDED_OWNER_ID), userFilter); if (excludedOwnerIds instanceof Collection) { processPeopleAssignments((Collection<OrganizationalEntity>)excludedOwnerIds, excludedOwners); } else { processPeopleAssignments((String)excludedOwnerIds, excludedOwners, 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 testAssignExcludedOwners() { String excludedOwnerId = "espiegelberg"; Task task = TaskModelProvider.getFactory().newTask(); InternalPeopleAssignments peopleAssignments = peopleAssignmentHelper.getNullSafePeopleAssignments(task); WorkItem workItem = new WorkItemImpl(); workItem.setParameter(PeopleAssignmentHelper.EXCLUDED_OWNER_ID, excludedOwnerId); peopleAssignmentHelper.assignExcludedOwners(workItem, peopleAssignments); assertEquals(1, peopleAssignments.getExcludedOwners().size()); OrganizationalEntity organizationalEntity1 = peopleAssignments.getExcludedOwners().get(0); assertTrue(organizationalEntity1 instanceof User); assertEquals(excludedOwnerId, organizationalEntity1.getId()); }