package org.kohsuke.github;

import org.apache.commons.io.IOUtils;
import org.junit.Assert;
import org.junit.Before;
import org.kohsuke.randname.RandomNameGenerator;

import java.io.FileInputStream;
import java.util.Properties;

/**
 * @author Kohsuke Kawaguchi
 */
public abstract class AbstractGitHubApiTestBase extends Assert {

    protected GitHub gitHub;

    @Before
    public void setUp() throws Exception {
        Properties props = new Properties();
        java.io.File f = new java.io.File(System.getProperty("user.home"), ".github");
        if (f.exists()) {
            FileInputStream in = new FileInputStream(f);
            try {
                props.load(in);
                gitHub = GitHub.connect(props.getProperty("login"),props.getProperty("oauth"));
            } finally {
                IOUtils.closeQuietly(in);
            }
        } else {
            gitHub = GitHub.connect();
        }
    }

    protected static final RandomNameGenerator rnd = new RandomNameGenerator();
}

package org.kohsuke.github;

import org.apache.commons.io.IOUtils;
import org.junit.Assert;
import org.junit.Before;
import org.kohsuke.randname.RandomNameGenerator;

import java.io.FileInputStream;
import java.util.Properties;

/**
 * @author Kohsuke Kawaguchi
 */
public abstract class AbstractGitHubApiTestBase extends Assert {

    protected GitHub gitHub;

    @Before
    public void setUp() throws Exception {
        Properties props = new Properties();
        java.io.File f = new java.io.File(System.getProperty("user.home"), ".github.kohsuke2");
        if (f.exists()) {
            FileInputStream in = new FileInputStream(f);
            try {
                props.load(in);
                gitHub = GitHub.connect(props.getProperty("login"),props.getProperty("oauth"));
            } finally {
                IOUtils.closeQuietly(in);
            }
        } else {
            gitHub = GitHub.connect();
        }
    }

    protected static final RandomNameGenerator rnd = new RandomNameGenerator();
}

Revert "Set credentials file according to documentation"
Revert "Set credentials file according to documentation"

This reverts commit 0bf81f4fb9d34633bea1e88877d67a9a2caf554e.

The point of this is to allow me to use a separate account to avoid
corrupting my event stream. GitHub.connect() does the standard handling
for those who are not me.
