-
Notifications
You must be signed in to change notification settings - Fork 731
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JENKINS-13726: Github plugin should work with Guthub enterprise by al…
…lowing for overriding the github URL.
- Loading branch information
Showing
2 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.kohsuke.github; | ||
|
||
import junit.framework.TestCase; | ||
|
||
/** | ||
* Unit test for {@link GitHub}. | ||
*/ | ||
public class GitHubTest extends TestCase { | ||
|
||
public void testGitHubServerWithHttp() throws Exception { | ||
GitHub hub = GitHub.connect("http://enterprise.kohsuke.org", "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"); | ||
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"); | ||
assertEquals("https://enterprise.kohsuke.org/api/v3/test", hub.getApiURL("/test").toString()); | ||
} | ||
|
||
public void testGitHubServerWithoutServer() throws Exception { | ||
GitHub hub = GitHub.connect("kohsuke", "token", "password"); | ||
assertEquals("https://api.github.com/test", hub.getApiURL("/test").toString()); | ||
} | ||
} |