### Question:
ExecutionService { Boolean isExecutionDirectory(File file, String buildInformationFilePath) { return file.isDirectory() && file.getName().matches("[0-9]+") && new File(file, buildInformationFilePath).exists(); }  @Transactional(readOnly = true) Page<ExecutionWithHandlingCountsDTO> findAll(long projectId, Pageable pageable); @Transactional(readOnly = true) ExecutionWithCountryDeploymentsAndRunsAndExecutedScenariosAndTeamIdsAndErrorsAndProblemsDTO findOneWithRuns(long projectId, long id, ExecutionCriteriaDTO criteria); ExecutionDTO discard(long projectId, long id, String discardReason); ExecutionDTO unDiscard(long projectId, long id); void requestCompletion(long projectId, String jobUrl); String getQualityStatus(long projectId, String jobUrl); List<ExecutionDTO> getLatestEligibleVersions(long projectId); void uploadExecutionReport(long projectId, String projectCode, String branch, String cycle, MultipartFile zipFile); void processSpecificDirectory(CycleDefinition cycleDefinition, File executionDirectory);  }### Answer:
@Test public void isExecutionDirectory_should_return_true() throws IOException { String timestamp = String.valueOf(new Date().getTime()); File directory = new File(System.getProperty("java.io.tmpdir"), timestamp); directory.mkdirs(); try { new File(directory, "buildInformation.json").createNewFile(); boolean result = cut.isExecutionDirectory(directory, "buildInformation.json"); assertThat(result).isTrue(); } finally { FileUtils.deleteQuietly(directory); } }
@Test public void isExecutionDirectory_should_return_false_if_its_not_a_directory() throws IOException { File test = new File(System.getProperty("java.io.tmpdir"), "buildInformation.json"); try { test.createNewFile(); boolean result = cut.isExecutionDirectory(test, "buildInformation.json"); assertThat(result).isFalse(); } finally { FileUtils.deleteQuietly(test); } }
@Test public void isExecutionDirectory_should_return_false_if_name_is_not_a_timestamp() throws IOException { File directory = new File(System.getProperty("java.io.tmpdir"), "not_a_timestamp"); directory.mkdirs(); try { new File(directory, "buildInformation.json").createNewFile(); boolean result = cut.isExecutionDirectory(directory, "buildInformation.json"); assertThat(result).isFalse(); } finally { FileUtils.deleteQuietly(directory); } }
@Test public void isExecutionDirectory_should_return_false_if_dont_contains_buildInformation() { String timestamp = String.valueOf(new Date().getTime()); File directory = new File(System.getProperty("java.io.tmpdir"), timestamp); directory.mkdirs(); try { boolean result = cut.isExecutionDirectory(directory, "buildInformation.json"); assertThat(result).isFalse(); } finally { FileUtils.deleteQuietly(directory); } }