@Test
public void should_pull_specific_branch_git_repo_and_use_tag() throws IOException {

    final Path path = Paths.get("/tmp");
    when(gitOperations.isValidGitRepository(path)).thenReturn(true);
    when(gitOperations.openGitRepository(path)).thenReturn(git);
    when(gitOperations.hasAtLeastOneReference(repository)).thenReturn(true);
    when(gitOperations.pullFromRepository(git, "origin", "mybranch")).thenReturn(pullResult);
    ContractsGitLoader pactGitLoader =
        new ContractsGitLoader(TestWithPactRepositoryDirectoryAndTag.class.getAnnotation(ContractsGit.class));
    pactGitLoader.gitOperations = gitOperations;
    final Path pactsFromGitRepo = pactGitLoader.getContractsFolderFromGitRepo();
    verify(gitOperations).pullFromRepository(git, "origin", "mybranch");
    verify(gitOperations).checkoutTag(git, "mytag");
    assertThat(pactsFromGitRepo.toString()).isEqualTo("/tmp");
}