@Test
public void should_return_all_order_ids_sorted_by_date_ascending() throws Exception {

    Incident[] orders = new Incident[]{new Incident(1), new Incident(2), new Incident(3)};
    List<Incident> orderList = Arrays.asList(orders);
    when(incidentDao.getAllIncidentsOrderByDate(true, PrimeroAppConfiguration.getCurrentUser().getUsername(),
            TextUtils.lintUrl(url))).thenReturn(orderList);
    assertThat("When call getAllOrdersByDateAsc() should return orders sorted by date.",
            incidentService.getAllOrderByDateASC(), is(Arrays.asList(new Long[]{1L, 2L, 3L})));
    verify(incidentDao, times(1)).getAllIncidentsOrderByDate(true, PrimeroAppConfiguration.getCurrentUser()
            .getUsername(), TextUtils.lintUrl(url));
}