mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-25 08:21:18 +00:00
30 lines
941 B
Java
30 lines
941 B
Java
package org.kohsuke.github;
|
|
|
|
import org.junit.Assert;
|
|
import org.junit.Before;
|
|
import org.kohsuke.randname.RandomNameGenerator;
|
|
|
|
import java.io.File;
|
|
|
|
/**
|
|
* @author Kohsuke Kawaguchi
|
|
*/
|
|
public abstract class AbstractGitHubApiTestBase extends Assert {
|
|
|
|
protected GitHub gitHub;
|
|
|
|
@Before
|
|
public void setUp() throws Exception {
|
|
File f = new File(System.getProperty("user.home"), ".github.kohsuke2");
|
|
if (f.exists()) {
|
|
// use the non-standard credential preferentially, so that developers of this library do not have
|
|
// to clutter their event stream.
|
|
gitHub = GitHubBuilder.fromPropertyFile(f.getPath()).withRateLimitHandler(RateLimitHandler.FAIL).build();
|
|
} else {
|
|
gitHub = GitHubBuilder.fromCredentials().withRateLimitHandler(RateLimitHandler.FAIL).build();
|
|
}
|
|
}
|
|
|
|
protected static final RandomNameGenerator rnd = new RandomNameGenerator();
|
|
}
|