@Test
public void mostImpacting() throws Exception {
RevCommit commit1 = add("test1.txt", "content2");
CommitFileImpactFilter filter = new CommitFileImpactFilter(1);
assertEquals(1, filter.getLimit());
CommitFinder finder = new CommitFinder(testRepo).setFilter(filter);
finder.find();
assertEquals(1, filter.getCommits().size());
assertEquals(commit1, filter.getCommits().first().getCommit());
assertEquals(1, filter.getCommits().first().getAdd());
filter.reset();
assertTrue(filter.getCommits().isEmpty());
RevCommit commit2 = add(testRepo,
Arrays.asList("test2.txt", "test3.txt"),
Arrays.asList("content2", "content3"), "second commit");
add("test1.txt", "new content");
delete("test3.txt");
finder.find();
assertEquals(1, filter.getCommits().size());
assertEquals(commit2, filter.getCommits().first().getCommit());
assertEquals(2, filter.getCommits().first().getAdd());
}