private static Map<String, FileData> constructFileDataMap(Map<String, WsProjectResponse.FileData> content) { Map<String, FileData> fileDataMap = new HashMap<>(); content.forEach((key, value) -> { FileData fd = new FileData(value.getHash(), value.getRevision()); fileDataMap.put(key, fd); }); return fileDataMap; } }
@Before public void setUp() { Date lastAnalysisDate = new Date(); repository = new SingleProjectRepository(Maps.newHashMap("/Abc.java", new FileData("123", "456")), lastAnalysisDate); }
@Before public void setUp() { Date lastAnalysisDate = new Date(); SingleProjectRepository repository1 = new SingleProjectRepository(Maps.newHashMap("/Abc.java", new FileData("123", "456")), lastAnalysisDate); SingleProjectRepository repository2 = new SingleProjectRepository(Maps.newHashMap("/Def.java", new FileData("567", "321")), lastAnalysisDate); Map<String, SingleProjectRepository> moduleRepositories = Maps.newHashMap("module1", repository1); moduleRepositories.put("module2", repository2); repository = new MultiModuleProjectRepository(moduleRepositories, lastAnalysisDate); }
@Before public void prepare() throws IOException { baseDir = temp.newFolder(); Path filepath = baseDir.toPath().resolve(FILE_PATH); Files.write(filepath, FILE_CONTENT.getBytes()); String md5sum = new FileMetadata() .readMetadata(Files.newInputStream(filepath), StandardCharsets.UTF_8, FILE_PATH) .hash(); tester.addFileData(FILE_PATH, new FileData(md5sum, "1.1")); }
.addFileData(filePath, new FileData(md5sum, null)) .setPreviousAnalysisDate(new Date())
private static Map<String, FileData> constructFileDataMap(Map<String, WsProjectResponse.FileData> content) { Map<String, FileData> fileDataMap = new HashMap<>(); content.forEach((key, value) -> { FileData fd = new FileData(value.getHash(), value.getRevision()); fileDataMap.put(key, fd); }); return fileDataMap; } }