@Test
public void testBlameOnNestedModule() throws IOException {

  File projectDir = temp.newFolder();
  javaUnzip(new File("test-repos/dummy-git-nested.zip"), projectDir);
  JGitBlameCommand jGitBlameCommand = newJGitBlameCommand();
  File baseDir = new File(projectDir, "dummy-git-nested/dummy-project");
  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 revisionDate = DateUtils.parseDateTime("2012-07-17T16:12:48+0200");
  String revision = "6b3aab35a3ea32c1636fee56f996e677653c48ea";
  String author = "david@gageot.net";
  verify(blameResult).blameResult(inputFile,
    Arrays.asList(
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author),
      new BlameLine().revision(revision).date(revisionDate).author(author)));
}