@Test
public void testCommitWitDetails() throws Exception {

    GitRename notJavaRename = new GitRename("old", "new", 97);
    GitRename actualRename = new GitRename("another.java", "anotherNew.java", 100);
    GitRename renameB = new GitRename("oldB.java", "newB.java", 50);
    CommitDetails details = new CommitDetails(
            new GitDiff(1, 2, 4), Arrays.asList(notJavaRename, actualRename));
    CommitDetails otherDetails = new CommitDetails(
            new GitDiff(0, 135, 20), Collections.singletonList(renameB));
    addCommitInPaprika(A);
    addCommitInRepository(A, details);
    addCommitInPaprika(B);
    addCommitInRepository(B, otherDetails);
    prepareGitLog(A, B);
    getCommitsAnalysis().query();
    verify(commitQueries).commitInsertionStatement(projectId, A, details.diff);
    verify(commitQueries, times(0)).fileRenameInsertionStatement(projectId, A.sha, notJavaRename);
    verify(commitQueries).fileRenameInsertionStatement(projectId, A.sha, actualRename);
    verify(commitQueries).commitInsertionStatement(projectId, B, otherDetails.diff);
    verify(commitQueries).fileRenameInsertionStatement(projectId, B.sha, renameB);
    // A and B share the same author.
    verify(developerQueries, times(2)).developerInsertStatement(A.authorEmail);
    verify(developerQueries, times(2)).projectDeveloperInsertStatement(projectId, A.authorEmail);
}