@Test
public void serviceReturnsOneDeviceLogItem() {

    final Slice<DeviceLogItem> mockSlice = this.mockSliceOfDeviceLogItems(1);
    final PageRequest pageRequest = PageRequest.of(0, 10, Sort.Direction.DESC, "id");
    Mockito.when(this.deviceLogItemSlicingRepository.findByCreationTimeBefore(this.now, pageRequest))
            .thenReturn(mockSlice);
    final List<DeviceLogItem> deviceLogItems = this.transactionalDeviceLogItemService
            .findDeviceLogItemsBeforeDate(this.now, 10);
    assertThat(deviceLogItems.size()).isEqualTo(1);
}