use of com.oxygenxml.git.view.event.GitController in project oxygen-git-client-addon by oxygenxml.
the class GitEditorVariables2Test method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
noOfShortBranchCalls = 0;
noOfFullBranchCalls = 0;
noOfWCCalls = 0;
Repository repo = createRepository(LOCAL_TEST_REPOSITORY);
GitAccess.getInstance().setRepositorySynchronously(LOCAL_TEST_REPOSITORY);
GitAccess gitAccessMock = Mockito.mock(GitAccess.class);
Mockito.doAnswer(new Answer<BranchInfo>() {
@Override
public BranchInfo answer(InvocationOnMock invocation) throws Throwable {
noOfShortBranchCalls++;
return new BranchInfo("main", false);
}
}).when(gitAccessMock).getBranchInfo();
Mockito.doAnswer(new Answer<Repository>() {
@Override
public Repository answer(InvocationOnMock invocation) throws Throwable {
noOfFullBranchCalls++;
return repo;
}
}).when(gitAccessMock).getRepository();
Mockito.doAnswer(new Answer<File>() {
@Override
public File answer(InvocationOnMock invocation) throws Throwable {
noOfWCCalls++;
return new File(LOCAL_TEST_REPOSITORY);
}
}).when(gitAccessMock).getWorkingCopy();
editorVariablesResolver = new GitEditorVariablesResolver(new GitController(gitAccessMock));
}
Aggregations