This repository was archived by the owner on Jul 31, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
src/test/java/org/kohsuke/github Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package org .kohsuke .github ;
22
3- import org .apache .commons .io .IOUtils ;
43import org .junit .Assert ;
54import org .junit .Before ;
65import 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 }
You can’t perform that action at this time.
0 commit comments