-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into issue_425_projects_columns_cards
- Loading branch information
Showing
315 changed files
with
637 additions
and
34 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
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
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
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 |
---|---|---|
@@ -1,13 +1,40 @@ | ||
package org.kohsuke.github; | ||
|
||
/** | ||
* Provides the media type strings for GitHub API previews | ||
* | ||
* https://developer.github.com/v3/previews/ | ||
* | ||
* @author Kohsuke Kawaguchi | ||
*/ | ||
/*package*/ class Previews { | ||
|
||
/** | ||
* Require multiple approving reviews | ||
* | ||
* @see <a href="https://developer.github.com/v3/previews/#require-multiple-approving-reviews">GitHub API Previews</a> | ||
*/ | ||
static final String LUKE_CAGE = "application/vnd.github.luke-cage-preview+json"; | ||
static final String DRAX = "application/vnd.github.drax-preview+json"; | ||
|
||
/** | ||
* Reactions | ||
* | ||
* @see <a href="https://developer.github.com/v3/previews/#reactions">GitHub API Previews</a> | ||
*/ | ||
static final String SQUIRREL_GIRL = "application/vnd.github.squirrel-girl-preview"; | ||
static final String CLOAK = "application/vnd.github.cloak-preview"; | ||
|
||
/** | ||
* Commit Search | ||
* | ||
* @see <a href="https://developer.github.com/v3/previews/#commit-search">GitHub API Previews</a> | ||
*/ | ||
static final String CLOAK = "application/vnd.github.cloak-preview+json"; | ||
|
||
/** | ||
* Require signed commits | ||
* | ||
* @see <a href="https://developer.github.com/v3/previews/#require-signed-commits">GitHub API Previews</a> | ||
*/ | ||
static final String ZZZAX = "application/vnd.github.zzzax-preview+json"; | ||
static final String INERTIA = "application/vnd.github.inertia-preview+json"; | ||
} |
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
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,48 @@ | ||
package org.kohsuke.github; | ||
|
||
import org.junit.Test; | ||
|
||
import java.io.IOException; | ||
|
||
import static org.hamcrest.Matchers.is; | ||
import static org.junit.Assert.*; | ||
import static org.junit.Assume.assumeFalse; | ||
|
||
/** | ||
* @author Liam Newman | ||
*/ | ||
public class GHRepositoryTest extends AbstractGitHubApiWireMockTest { | ||
|
||
@Test | ||
public void archive() throws Exception { | ||
snapshotNotAllowed(); | ||
|
||
// Archive is a one-way action in the API. | ||
// We do thi this one | ||
GHRepository repo = getRepository(); | ||
|
||
assertThat(repo.isArchived(), is(false)); | ||
|
||
repo.archive(); | ||
|
||
assertThat(repo.isArchived(), is(true)); | ||
assertThat(getRepository().isArchived(), is(true)); | ||
} | ||
|
||
@Test | ||
public void getBranch_URLEncoded() throws Exception { | ||
GHRepository repo = getRepository(); | ||
GHBranch branch = repo.getBranch("test/#UrlEncode"); | ||
assertThat(branch.getName(), is("test/#UrlEncode")); | ||
} | ||
|
||
|
||
|
||
protected GHRepository getRepository() throws IOException { | ||
return getRepository(gitHub); | ||
} | ||
|
||
private GHRepository getRepository(GitHub gitHub) throws IOException { | ||
return gitHub.getOrganization("github-api-test-org").getRepository("github-api"); | ||
} | ||
} |
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
Oops, something went wrong.