// OK
}
}
public void testQueryByDelegationState() {
TaskQuery query = taskService.createTaskQuery().taskDelegationState(null);
assertEquals(12, query.count());
assertEquals(12, query.list().size());
query = taskService.createTaskQuery().taskDelegationState(DelegationState.PENDING);
assertEquals(0, query.count());
assertEquals(0, query.list().size());
query = taskService.createTaskQuery().taskDelegationState(DelegationState.RESOLVED);
assertEquals(0, query.count());
assertEquals(0, query.list().size());
String taskId= taskService.createTaskQuery().taskAssignee("gonzo").singleResult().getId();
taskService.delegateTask(taskId, "kermit");
query = taskService.createTaskQuery().taskDelegationState(null);
assertEquals(11, query.count());
assertEquals(11, query.list().size());
query = taskService.createTaskQuery().taskDelegationState(DelegationState.PENDING);
assertEquals(1, query.count());
assertEquals(1, query.list().size());
query = taskService.createTaskQuery().taskDelegationState(DelegationState.RESOLVED);
assertEquals(0, query.count());
assertEquals(0, query.list().size());
taskService.resolveTask(taskId);
query = taskService.createTaskQuery().taskDelegationState(null);
assertEquals(11, query.count());
assertEquals(11, query.list().size());
query = taskService.createTaskQuery().taskDelegationState(DelegationState.PENDING);
assertEquals(0, query.count());
assertEquals(0, query.list().size());
query = taskService.createTaskQuery().taskDelegationState(DelegationState.RESOLVED);
assertEquals(1, query.count());
assertEquals(1, query.list().size());
}