@Test
public void test() throws IOException {

    // Arrange
    final List<Event> events = this.createEvents();
    Mockito.when(this.transactionalEventService.getEventsBeforeDate(any(Date.class), any(Integer.class)))
            .thenReturn(events);
    // Act
    this.eventCleanupJob.execute(null);
    // Assert
    // Example path:
    // /tmp/junit7318456469288690301/junit-mocked-csv-file-20190416-112237.csv.zip
    final String path = this.folder.resolve(JUST_A_FILE).getParent().toString();
    final File zipFile = FileUtils.findFileInFolderUsingFilePrefix(path, this.filePrefix);
    assertThat(zipFile.exists()).isTrue();
    assertThat(zipFile).hasExtension("zip");
    assertThat(zipFile.length()).isNotZero();
    ZipFileReader.extractZipFile(zipFile.getAbsolutePath(), path);
    zipFile.delete();
    final File csvFile = FileUtils.findFileInFolderUsingFilePrefix(path, this.filePrefix);
    assertThat(csvFile.exists()).isTrue();
    assertThat(csvFile).hasExtension("csv");
    assertThat(csvFile.length()).isNotZero();
    final long numberOfLines = FileUtils.countNumberOfLinesInFile(csvFile);
    assertThat(numberOfLines).isEqualTo(2l);
}