@Test
public void testAssignActors() {

	
	String actorId = "espiegelberg";
	
	Task task = TaskModelProvider.getFactory().newTask();
	InternalTaskData taskData = (InternalTaskData) TaskModelProvider.getFactory().newTaskData();
	PeopleAssignments peopleAssignments = peopleAssignmentHelper.getNullSafePeopleAssignments(task);
	
	WorkItem workItem = new WorkItemImpl();		
	workItem.setParameter(PeopleAssignmentHelper.ACTOR_ID, actorId);
	
	peopleAssignmentHelper.assignActors(workItem, peopleAssignments, taskData);
	OrganizationalEntity organizationalEntity1 = peopleAssignments.getPotentialOwners().get(0);
	assertTrue(organizationalEntity1 instanceof User);
	assertEquals(actorId, organizationalEntity1.getId());		
       assertNull(taskData.getCreatedBy());
	
	workItem = new WorkItemImpl();
	peopleAssignments = peopleAssignmentHelper.getNullSafePeopleAssignments(task);				
	workItem.setParameter(PeopleAssignmentHelper.ACTOR_ID, actorId + ", drbug  ");
	peopleAssignmentHelper.assignActors(workItem, peopleAssignments, taskData);
	assertEquals(2, peopleAssignments.getPotentialOwners().size());
	organizationalEntity1 = peopleAssignments.getPotentialOwners().get(0);
	assertEquals(actorId, organizationalEntity1.getId());		
       assertNull(taskData.getCreatedBy());
	OrganizationalEntity organizationalEntity2 = peopleAssignments.getPotentialOwners().get(1);
	assertEquals("drbug", organizationalEntity2.getId());
	workItem = new WorkItemImpl();
	peopleAssignments = peopleAssignmentHelper.getNullSafePeopleAssignments(task);				
	workItem.setParameter(PeopleAssignmentHelper.ACTOR_ID, "");
	peopleAssignmentHelper.assignActors(workItem, peopleAssignments, taskData);
	assertEquals(0, peopleAssignments.getPotentialOwners().size());
}