@Test
public void testBlame() throws IOException {

  File projectDir = temp.newFolder();
  javaUnzip(new File("test-repos/dummy-git.zip"), projectDir);
  JGitBlameCommand jGitBlameCommand = newJGitBlameCommand();
  File baseDir = new File(projectDir, "dummy-git");
  DefaultFileSystem fs = new DefaultFileSystem(baseDir);
  when(input.fileSystem()).thenReturn(fs);
  DefaultInputFile inputFile = new TestInputFileBuilder("foo", DUMMY_JAVA)
    .setModuleBaseDir(baseDir.toPath())
    .build();
  fs.add(inputFile);
  BlameOutput blameResult = mock(BlameOutput.class);
  when(input.filesToBlame()).thenReturn(Arrays.asList(inputFile));
  jGitBlameCommand.blame(input, blameResult);
  Date revisionDate1 = DateUtils.parseDateTime("2012-07-17T16:12:48+0200");
  String revision1 = "6b3aab35a3ea32c1636fee56f996e677653c48ea";
  String author1 = "david@gageot.net";
  // second commit, which has a commit date different than the author date
  Date revisionDate2 = DateUtils.parseDateTime("2015-05-19T13:31:09+0200");
  String revision2 = "0d269c1acfb8e6d4d33f3c43041eb87e0df0f5e7";
  String author2 = "duarte.meneses@sonarsource.com";
  List<BlameLine> expectedBlame = new LinkedList<>();
  for (int i = 0; i < 25; i++) {
    expectedBlame.add(new BlameLine().revision(revision1).date(revisionDate1).author(author1));
  }
  for (int i = 0; i < 3; i++) {
    expectedBlame.add(new BlameLine().revision(revision2).date(revisionDate2).author(author2));
  }
  for (int i = 0; i < 1; i++) {
    expectedBlame.add(new BlameLine().revision(revision1).date(revisionDate1).author(author1));
  }
  verify(blameResult).blameResult(inputFile, expectedBlame);
}