List<Long> statuses = new ArrayList<Long>();
statuses.add(procInstId);
List<Long> taskIds = ((InternalTaskService)taskService).getTasksByProcessInstanceId(procInstId);
assertEquals( "Task list size", 1, taskIds.size());
Task task = ((InternalTaskService)taskService).getTaskById(taskIds.get(0));
assertNotNull( "No people assignments!", task.getPeopleAssignments() );
assertNotNull( "No business adminstrators!", task.getPeopleAssignments().getBusinessAdministrators() );
assertFalse( "Empty business adminstrators!", task.getPeopleAssignments().getBusinessAdministrators().isEmpty() );
String busAdmin = task.getPeopleAssignments().getBusinessAdministrators().get(0).getId();
Map<String, List<?>> fieldVals = new HashMap<String, List<?>>();
fieldVals.put(PROCESS_INSTANCE_ID_LIST, statuses);
List<org.kie.api.task.model.TaskSummary> taskSumList = ((InternalTaskService)taskService).getTasksByVariousFields(busAdmin, fieldVals, true);
assertEquals( "Task summary list size", 1, taskSumList.size());