StatsService { public Collection<UserStatusStat> getDayline() { Date today = new Date(); return getDayline(today); }  Collection<UserStatusStat> getDayline(); Collection<UserStatusStat> getDayline(Date date);  }
@Test public void shouldGetDayline() throws Exception { mockAuthenticationOnStatsServiceWithACurrentUser("userWithStatus@ippon.fr"); Calendar cal = Calendar.getInstance(); cal.set(2012, 04, 19); Collection<UserStatusStat> stats = statsService.getDayline(cal.getTime()); assertThat(stats, notNullValue()); assertThat(stats.size(), is(1)); UserStatusStat userStat = (UserStatusStat) stats.toArray()[0]; assertThat(userStat.getUsername(), is("userWithStatus")); assertThat(userStat.getStatusCount(), is(1L)); }