use of com.google.copybara.checks.ApiChecker in project copybara by google.
the class GitHubOptions method newGitHubApi.
/**
* Returns a new {@link GitHubApi} instance for the given project enforcing the given
* {@link Checker}.
*
* <p>The project for 'https://github.com/foo/bar' is 'foo/bar'.
*/
public GitHubApi newGitHubApi(String gitHubProject, @Nullable Checker checker, Console console) throws RepoException {
GitRepository repo = getCredentialsRepo();
String storePath = gitOptions.getCredentialHelperStorePath();
if (storePath == null) {
storePath = "~/.git-credentials";
}
GitHubApiTransport transport = newTransport(repo, storePath, console);
if (checker != null) {
transport = new GitHubApiTransportWithChecker(transport, new ApiChecker(checker, console));
}
return new GitHubApi(transport, generalOptions.profiler());
}
use of com.google.copybara.checks.ApiChecker in project copybara by google.
the class GerritApiTransportWithCheckerTest method setup.
@Before
public void setup() throws Exception {
console = new TestingConsole();
delegate = Mockito.mock(GerritApiTransport.class);
checker = Mockito.mock(Checker.class);
transport = new GerritApiTransportWithChecker(delegate, new ApiChecker(checker, console));
}
Aggregations