Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 10238db

Browse filesBrowse files
committed
Explaining why this code is the way it is.
1 parent 6229e09 commit 10238db
Copy full SHA for 10238db

File tree

Expand file treeCollapse file tree

1 file changed

+5
-12
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-12
lines changed

‎src/test/java/org/kohsuke/github/AbstractGitHubApiTestBase.java

Copy file name to clipboardExpand all lines: src/test/java/org/kohsuke/github/AbstractGitHubApiTestBase.java
+5-12Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
package org.kohsuke.github;
22

3-
import org.apache.commons.io.IOUtils;
43
import org.junit.Assert;
54
import org.junit.Before;
65
import org.kohsuke.randname.RandomNameGenerator;
76

8-
import java.io.FileInputStream;
9-
import java.util.Properties;
7+
import java.io.File;
108

119
/**
1210
* @author Kohsuke Kawaguchi
@@ -17,16 +15,11 @@ public abstract class AbstractGitHubApiTestBase extends Assert {
1715

1816
@Before
1917
public void setUp() throws Exception {
20-
Properties props = new Properties();
21-
java.io.File f = new java.io.File(System.getProperty("user.home"), ".github.kohsuke2");
18+
File f = new File(System.getProperty("user.home"), ".github.kohsuke2");
2219
if (f.exists()) {
23-
FileInputStream in = new FileInputStream(f);
24-
try {
25-
props.load(in);
26-
gitHub = GitHub.connect(props.getProperty("login"),props.getProperty("oauth"));
27-
} finally {
28-
IOUtils.closeQuietly(in);
29-
}
20+
// use the non-standard credential preferentially, so that developers of this library do not have
21+
// to clutter their event stream.
22+
gitHub = GitHubBuilder.fromPropertyFile(f.getPath()).build();
3023
} else {
3124
gitHub = GitHub.connect();
3225
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.