@Test
public void testGetAll() {

    List<Task> expectedTasks = Collections.singletonList(task1);
    when(taskService.getAll()).thenReturn(expectedTasks);
    
    Collection<Task> tasks = taskRes.getTasks();
    assertThat(tasks, contains(task1));
}