@Test
public void search() {

    Task task = new Task();
    task.setTaskType("SIMPLE");
    task.setWorkerId("123");
    task.setDomain("test");
    task.setStatus(Task.Status.IN_PROGRESS);
    TaskSummary taskSummary = new TaskSummary(task);
    ArrayList<TaskSummary> listOfTaskSummary = new ArrayList<TaskSummary>() {{
        add(taskSummary);
    }};
    SearchResult<TaskSummary> searchResult = new SearchResult<TaskSummary>(100, listOfTaskSummary);
    listOfTaskSummary.add(taskSummary);
    when(mockTaskService.search(anyInt(), anyInt(), anyString(), anyString(), anyString())).thenReturn(searchResult);
    assertEquals(searchResult, taskResource.search(0,100,"asc", "*", "*"));
}