@Test
public void serviceReturnsTenEvents() {

    final Slice<Event> mockSlice = this.mockSliceOfEvents(10);
    final PageRequest pageRequest = PageRequest.of(0, 10, Sort.Direction.DESC, "id");
    Mockito.when(this.eventRepository.findByDateTimeBefore(this.now, pageRequest)).thenReturn(mockSlice);
    final List<Event> events = this.transactionalEventService.getEventsBeforeDate(this.now, 10);
    assertThat(events.size()).isEqualTo(10);
}