massaging this a bit to accept the full URL

This commit is contained in:
Kohsuke Kawaguchi
2013-01-05 16:08:42 -08:00
parent 5166202f67
commit cbaca87bbc
2 changed files with 17 additions and 17 deletions

View File

@@ -8,17 +8,17 @@ import junit.framework.TestCase;
public class GitHubTest extends TestCase {
public void testGitHubServerWithHttp() throws Exception {
GitHub hub = GitHub.connect("http://enterprise.kohsuke.org", "kohsuke", "token", "password");
GitHub hub = GitHub.connect("http://enterprise.kohsuke.org/api/v3", "kohsuke", "token", "password");
assertEquals("http://enterprise.kohsuke.org/api/v3/test", hub.getApiURL("/test").toString());
}
public void testGitHubServerWithHttps() throws Exception {
GitHub hub = GitHub.connect("https://enterprise.kohsuke.org", "kohsuke", "token", "password");
GitHub hub = GitHub.connect("https://enterprise.kohsuke.org/api/v3", "kohsuke", "token", "password");
assertEquals("https://enterprise.kohsuke.org/api/v3/test", hub.getApiURL("/test").toString());
}
public void testGitHubServerWithoutProtocol() throws Exception {
GitHub hub = GitHub.connect("enterprise.kohsuke.org", "kohsuke", "token", "password");
GitHub hub = GitHub.connect("https://enterprise.kohsuke.org/api/v3", "kohsuke", "token", "password");
assertEquals("https://enterprise.kohsuke.org/api/v3/test", hub.getApiURL("/test").toString());
}