@Test
public final void testRunShouldSaveDeleteFilesCountWhenItDeleteFiles() {

    // GIVEN
    Whitebox.setInternalState(underTest, "timeLimitInSeconds", 10);
    Whitebox.setInternalState(underTest, "simpleDateFormat", new SimpleDateFormat("yyyyMMddHHmmss"));
    DeletedFileProvider deletedFileProvider = new DeletedFileProvider();
    Whitebox.setInternalState(underTest, "deletedFileProvider", deletedFileProvider);
    File file1 = Mockito.mock(File.class);
    given(file1.getName()).willReturn("20130701151510.0000resp.txt");
    File file2 = Mockito.mock(File.class);
    given(file2.getName()).willReturn("20130701151510.0000req.txt");
    File file3 = Mockito.mock(File.class);
    given(file3.getName()).willReturn("20130701151513.0000req.txt");
    File file4 = Mockito.mock(File.class);
    given(file4.getName()).willReturn("20130701151513.0000resp.txt");
    File[] messageFiles = new File[4];
    messageFiles[0] = file1;
    messageFiles[1] = file2;
    messageFiles[2] = file3;
    messageFiles[3] = file4;
    given(logFilePath.getLogFilePath()).willReturn(path);
    given(path.toFile()).willReturn(logFolder);
    given(logFolder.listFiles(fileFilter)).willReturn(messageFiles);
    Calendar cal = Calendar.getInstance();
    cal.set(2013, 6, 1, 15, 15, 21);
    Date date = cal.getTime();
    given(currentDateProvider.getCurrentDate()).willReturn(date);
    // WHEN
    underTest.run();
    // THEN
    int actual = ((DeletedFileProvider) Whitebox.getInternalState(underTest, "deletedFileProvider")).getDeletedFilesCount();
    Assert.assertEquals(actual, 2);
}