FileLimitMaintainerTask implements MaintainerTask { @Override public void run() { File messagesFolder = logFilePath.getLogFilePath().toFile(); deleteFilesAboveFileLimit(messagesFolder); }  @Override void run(); @Override void logParameters();  }
@Test public void testRunShouldNotDoAnythingWhenThereAreNoFilesInTheFolder() { File[] messageFiles = null; given(logFilePath.getLogFilePath()).willReturn(path); given(path.toFile()).willReturn(logFolder); given(logFolder.listFiles(fileFilter)).willReturn(messageFiles); underTest.run(); }