@Test public void unzipExecutions_should_propagate_ioexception_from_archiveservice() throws IOException { File target = new File(System.getProperty("java.io.tmpdir"),"ara-unzipExecutions-" + new Date().getTime()); MultipartFile file = new MockMultipartFile("zip", "test.zip", "application/zip", new byte[0]); doThrow(new IOException("Unable to write")).when(archiveService).unzip(file, target); try { assertThrows(IOException.class, () -> this.cut.unzipExecutions(target, file, "buildInformation.json")); } finally { FileUtils.deleteQuietly(target); } }
List<File> unzipExecutions(File destinationDirectory, MultipartFile zipFile, String buildInformationFilePath) throws IOException { Files.createDirectories(destinationDirectory.toPath()); this.archiveService.unzip(zipFile, destinationDirectory); return retrieveAllExecutionDirectories(destinationDirectory, buildInformationFilePath); }
ExecutionService { List<File> unzipExecutions(File destinationDirectory, MultipartFile zipFile, String buildInformationFilePath) throws IOException { Files.createDirectories(destinationDirectory.toPath()); this.archiveService.unzip(zipFile, destinationDirectory); return retrieveAllExecutionDirectories(destinationDirectory, buildInformationFilePath); } }
ExecutionService { List<File> unzipExecutions(File destinationDirectory, MultipartFile zipFile, String buildInformationFilePath) throws IOException { Files.createDirectories(destinationDirectory.toPath()); this.archiveService.unzip(zipFile, destinationDirectory); return retrieveAllExecutionDirectories(destinationDirectory, buildInformationFilePath); }  }
ExecutionService { List<File> unzipExecutions(File destinationDirectory, MultipartFile zipFile, String buildInformationFilePath) throws IOException { Files.createDirectories(destinationDirectory.toPath()); this.archiveService.unzip(zipFile, destinationDirectory); return retrieveAllExecutionDirectories(destinationDirectory, buildInformationFilePath); }  @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); }
ExecutionService { List<File> unzipExecutions(File destinationDirectory, MultipartFile zipFile, String buildInformationFilePath) throws IOException { Files.createDirectories(destinationDirectory.toPath()); this.archiveService.unzip(zipFile, destinationDirectory); return retrieveAllExecutionDirectories(destinationDirectory, buildInformationFilePath); }  @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);  }