mirror of
https://github.com/jlengrand/github-api.git
synced 2026-04-04 08:21:23 +00:00
Add convenience method to authenticate with app installation tokens;
Convert existing markdown doc to APT due to formatting features; Replace occurrences of kohsuke user to github-api org where applicable; Fix repositoryIds method on GHAppCreateTokenBuilder; Signed-off-by: PauloMigAlmeida <paulo.miguel.almeida.rodenas@gmail.com>
This commit is contained in:
committed by
PauloMigAlmeida
parent
efb87c5a9e
commit
8a88c14b13
@@ -46,7 +46,6 @@ public class GitHubConnectionTest extends AbstractGitHubWireMockTest {
|
||||
GitHub hub = GitHub.connectUsingPassword("kohsuke", "bogus");
|
||||
assertEquals("https://api.github.com/test", hub.getApiURL("/test").toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGitHubBuilderFromEnvironment() throws IOException {
|
||||
|
||||
@@ -86,6 +85,17 @@ public class GitHubConnectionTest extends AbstractGitHubWireMockTest {
|
||||
assertEquals("bogusPassword", builder.password);
|
||||
assertEquals("bogusEndpoint", builder.endpoint);
|
||||
}
|
||||
@Test
|
||||
public void testGithubBuilderWithAppInstallationToken() throws Exception{
|
||||
GitHubBuilder builder = new GitHubBuilder().withAppInstallationToken("bogus");
|
||||
assertEquals("bogus", builder.oauthToken);
|
||||
assertEquals("", builder.user);
|
||||
|
||||
// test authorization header is set as in the RFC6749
|
||||
GitHub github = builder.build();
|
||||
assertEquals("token bogus",github.encodedAuthorization);
|
||||
assertEquals("",github.login);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGitHubRateLimit() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user