File gitDir = mock(File.class);
this.mojo.baseDir = baseDir;
this.mojo.gitDir = gitDir;
this.mojo.head = "HEAD";
JGitRepository repo = mock(JGitRepository.class);
whenNew(JGitRepository.class).withArguments(baseDir, gitDir).thenReturn(repo);
this.mojo.initRepository();
verify(repo).check();