diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 000000000..8e0d7410c --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,19 @@ +name-template: 'v$NEXT_PATCH_VERSION 🌈' +tag-template: 'v$NEXT_PATCH_VERSION' +categories: + - title: '🚀 Features' + labels: + - 'feature' + - 'enhancement' + - title: '🐛 Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: '🧰 Maintenance' + label: 'chore' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +template: | + ## Changes + + $CHANGES diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..ff50d0a6c --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at bitwiseman@gmail.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/pom.xml b/pom.xml index e1b62de1c..4f1be9cf7 100644 --- a/pom.xml +++ b/pom.xml @@ -14,8 +14,8 @@ GitHub API for Java - scm:git:git@github.com/kohsuke/${project.artifactId}.git - scm:git:ssh://git@github.com/kohsuke/${project.artifactId}.git + scm:git:git@github.com/github-api/${project.artifactId}.git + scm:git:ssh://git@github.com/github-api/${project.artifactId}.git https://${project.artifactId}.kohsuke.org/ HEAD @@ -23,7 +23,7 @@ github-pages - gitsite:git@github.com/kohsuke/${project.artifactId}.git + gitsite:git@github.com/github-api/${project.artifactId}.git diff --git a/src/main/java/org/kohsuke/github/GHAppCreateTokenBuilder.java b/src/main/java/org/kohsuke/github/GHAppCreateTokenBuilder.java index cf19dd99a..807ebcf10 100644 --- a/src/main/java/org/kohsuke/github/GHAppCreateTokenBuilder.java +++ b/src/main/java/org/kohsuke/github/GHAppCreateTokenBuilder.java @@ -35,7 +35,7 @@ public class GHAppCreateTokenBuilder { * */ @Preview @Deprecated - public GHAppCreateTokenBuilder repositoryIds(List repositoryIds) { + public GHAppCreateTokenBuilder repositoryIds(List repositoryIds) { this.builder.with("repository_ids",repositoryIds); return this; } diff --git a/src/main/java/org/kohsuke/github/GHMilestone.java b/src/main/java/org/kohsuke/github/GHMilestone.java index 50ad549e8..3ed54636c 100644 --- a/src/main/java/org/kohsuke/github/GHMilestone.java +++ b/src/main/java/org/kohsuke/github/GHMilestone.java @@ -85,10 +85,29 @@ public class GHMilestone extends GHObject { edit("state", "open"); } + /** + * Deletes this milestone. + */ + public void delete() throws IOException { + root.retrieve().method("DELETE").to(getApiRoute()); + } + private void edit(String key, Object value) throws IOException { new Requester(root)._with(key, value).method("PATCH").to(getApiRoute()); } + public void setTitle(String title) throws IOException { + edit("title", title); + } + + public void setDescription(String description) throws IOException { + edit("description", description); + } + + public void setDueOn(Date dueOn) throws IOException { + edit("due_on", GitHub.printDate(dueOn)); + } + protected String getApiRoute() { return "/repos/"+owner.getOwnerName()+"/"+owner.getName()+"/milestones/"+number; } diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index 6b57206a3..becbd5f85 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -129,7 +129,7 @@ public class GHRepository extends GHObject { * Obtains a single {@link GHDeployment} by its ID. */ public GHDeployment getDeployment(long id) throws IOException { - return root.retrieve().to("deployments/" + id, GHDeployment.class).wrap(this); + return root.retrieve().to(getApiTailUrl("deployments/" + id), GHDeployment.class).wrap(this); } private String join(List params, String joinStr) { diff --git a/src/main/java/org/kohsuke/github/GitHub.java b/src/main/java/org/kohsuke/github/GitHub.java index 9fbcac916..0cbf42597 100644 --- a/src/main/java/org/kohsuke/github/GitHub.java +++ b/src/main/java/org/kohsuke/github/GitHub.java @@ -956,7 +956,9 @@ public class GitHub { } /*package*/ static String printDate(Date dt) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(dt); + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); + df.setTimeZone(TimeZone.getTimeZone("GMT")); + return df.format(dt); } /*package*/ static final ObjectMapper MAPPER = new ObjectMapper(); diff --git a/src/main/java/org/kohsuke/github/GitHubBuilder.java b/src/main/java/org/kohsuke/github/GitHubBuilder.java index e299e7340..f5e640c1a 100644 --- a/src/main/java/org/kohsuke/github/GitHubBuilder.java +++ b/src/main/java/org/kohsuke/github/GitHubBuilder.java @@ -180,6 +180,18 @@ public class GitHubBuilder implements Cloneable { this.user = user; return this; } + + /** + * Configures {@link GitHubBuilder} with Installation Token generated by the GitHub Application + * + * @param appInstallationToken A string containing the GitHub App installation token + * @return the configured Builder from given GitHub App installation token. + * @see GHAppInstallation#createToken(java.util.Map) + */ + public GitHubBuilder withAppInstallationToken(String appInstallationToken){ + return withOAuthToken(appInstallationToken, ""); + } + public GitHubBuilder withJwtToken(String jwtToken){ this.jwtToken = jwtToken; return this; diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt new file mode 100644 index 000000000..e76dd4710 --- /dev/null +++ b/src/site/apt/index.apt @@ -0,0 +1,154 @@ +What is this? + + This library defines an object oriented representation of the GitHub API. By "object oriented" we mean + there are classes that correspond to the domain model of GitHub (such as <<>> and <<>>), + operations that act on them as defined as methods (such as <<>>), and those object references + are used in favor of using string handle (such as <<>> instead of + <<>>) + + The library supports both github.com and GitHub Enterprise. + + Most of the GitHub APIs are covered, although there are some corners that are still not yet implemented. + +Sample Usage + ++-----+ +GitHub github = GitHub.connect(); + +GHRepository repo = github.createRepository( + "new-repository","this is my new repository", + "http://www.kohsuke.org/",true/*public*/); +repo.addCollaborators(github.getUser("abayer"),github.getUser("rtyler")); +repo.delete(); ++-----+ + +Authentication + + The library allows connecting to GitHub via several different authentication mechanisms. + +* Programmatically + + To connect via Username and Password (not recommended): + ++-----+ +GitHub github = new GitHubBuilder().withPassword("my_user", "my_passwd").build(); ++-----+ + + To connect via Personal access token: + ++-----+ +// If you don't specify the GitHub user id then the sdk will retrieve it via /user endpoint +GitHub github = new GitHubBuilder().withOAuthToken("my_personal_token").build(); + +// If the token has access to an organization, you can specify it here. +GitHub github = new GitHubBuilder().withOAuthToken("my_personal_token","user_id_OR_org_name").build(); ++-----+ + + To connect via JWT token as a GitHub App: + ++-----+ +GitHub github = new GitHubBuilder().withJwtToken("my_jwt_token").build(); ++-----+ + + To connect via GitHub App installation token on behalf of a user or organization: + ++-----+ +GitHub github = new GitHubBuilder().withAppInstallationToken("my_installation_token").build(); ++-----+ + +* Property file + + This library defines a common convention so that applications using this library will look at a consistent location. + In this convention, the library looks at <<<~/.github>>> property file. The content of the files depends on the way + you want this library to authenticate as shown below: + + + To connect via Username and Password (not recommended): + ++-----+ +login=kohsuke +password=012345678 ++-----+ + + To connect via Personal access token: + ++-----+ +oauth=4d98173f7c075527cb64878561d1fe70 ++-----+ + + To connect via Personal access token as a user or organization: + ++-----+ +login=my_org +oauth=4d98173f7c075527cb64878561d1fe70 ++-----+ + + To connect via JWT token as a GitHub App: + ++-----+ +jwt=my_jwt_token ++-----+ + + Once your <<<~/.github>>> property file is properly configured, you can obtain a <<>> instance using: + ++-----+ +// if you are using the default configuration file +GitHub github = new GitHubBuilder().fromPropertyFile().build(); + +// if you need to use a separate configuration file +GitHub github = new GitHubBuilder().fromPropertyFile("location/my_custom_github.properties").build(); ++-----+ + +* Environmental variables + + This library also allows developers to authenticate GitHub with environmental variables. + + To connect via Username and Password (not recommended): + ++-----+ +export GITHUB_LOGIN=kohsuke +export GITHUB_PASSWORD=012345678 ++-----+ + + To connect via Personal access token: + ++-----+ +export GITHUB_OAUTH=4d98173f7c075527cb64878561d1fe70 ++-----+ + + To connect via Personal access token as a user or organization: + ++-----+ +export GITHUB_LOGIN=my_org +export GITHUB_OAUTH=4d98173f7c075527cb64878561d1fe70 ++-----+ + + To connect via JWT token as a GitHub App: + ++-----+ +export GITHUB_JWT=my_jwt_token ++-----+ + + Once exported, you can obtain a <<>> instance using: + ++-----+ +GitHub github = new GitHubBuilder().fromEnvironment().build(); ++-----+ + + +Pluggable HTTP client + + This library comes with a pluggable connector to use different HTTP client implementations + through <<>>. In particular, this means you can use {{{http://square.github.io/okhttp/}OkHttp}}, + so we can make use of it's HTTP response cache. + Making a conditional request against the GitHub API and receiving a 304 response + {{{http://developer.github.com/v3/#conditional-requests}does not count against the rate limit}}. + + The following code shows an example of how to set up persistent cache on the disk: + ++-----+ +Cache cache = new Cache(cacheDirectory, 10 * 1024 * 1024); // 10MB cache +GitHub gitHub = GitHubBuilder.fromCredentials() + .withConnector(new OkHttpConnector(new OkUrlFactory(new OkHttpClient().setCache(cache)))) + .build(); ++-----+ diff --git a/src/site/markdown/index.md b/src/site/markdown/index.md deleted file mode 100644 index ccd0c9cf3..000000000 --- a/src/site/markdown/index.md +++ /dev/null @@ -1,51 +0,0 @@ -What is this? -===== - -This library defines an object oriented representation of the GitHub API. By "object oriented" we mean -there are classes that correspond to the domain model of GitHub (such as `GHUser` and `GHRepository`), -operations that act on them as defined as methods (such as `GHUser.follow()`), and those object references -are used in favor of using string handle (such as `GHUser.isMemberOf(GHOrganization)` instead of -`GHUser.isMemberOf(String)`) - -The library supports both github.com and GitHub Enterprise. - -Most of the GitHub APIs are covered, although there are some corners that are still not yet implemented. - -Sample Usage ------ - - GitHub github = GitHub.connect(); - GHRepository repo = github.createRepository( - "new-repository","this is my new repository", - "http://www.kohsuke.org/",true/*public*/); - repo.addCollaborators(github.getUser("abayer"),github.getUser("rtyler")); - repo.delete(); - -Credential ----- - -This library allows the caller to supply the credential as parameters, but it also defines a common convention -so that applications using this library will look at the consistent location. In this convention, the library -looks at `~/.github` property file, which should have the following two values: - - login=kohsuke - password=012345678 - -Alternatively, you can have just the OAuth token in this file: - - oauth=4d98173f7c075527cb64878561d1fe70 - -OkHttp ----- -This library comes with a pluggable connector to use different HTTP client implementations -through `HttpConnector`. In particular, this means you can use [OkHttp](http://square.github.io/okhttp/), -so we can make use of it's HTTP response cache. -Making a conditional request against the GitHub API and receiving a 304 response -[does not count against the rate limit](http://developer.github.com/v3/#conditional-requests). - -The following code shows an example of how to set up persistent cache on the disk: - - Cache cache = new Cache(cacheDirectory, 10 * 1024 * 1024); // 10MB cache - GitHub gitHub = GitHubBuilder.fromCredentials() - .withConnector(new OkHttpConnector(new OkUrlFactory(new OkHttpClient().setCache(cache)))) - .build(); diff --git a/src/site/site.xml b/src/site/site.xml index 01eda5ec1..3553fd23b 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -9,12 +9,13 @@ maven-skin 1.2 + - + diff --git a/src/test/java/org/kohsuke/github/GHAppTest.java b/src/test/java/org/kohsuke/github/GHAppTest.java index baf5a12cf..3c9bd0ff0 100644 --- a/src/test/java/org/kohsuke/github/GHAppTest.java +++ b/src/test/java/org/kohsuke/github/GHAppTest.java @@ -103,7 +103,7 @@ public class GHAppTest extends AbstractGitHubWireMockTest { permissions.put("metadata", GHPermissionType.READ); GHAppInstallationToken installationToken = installation.createToken(permissions) - .repositoryIds(Arrays.asList(111111111)) + .repositoryIds(Arrays.asList((long)111111111)) .create(); assertThat(installationToken.getToken(), is("bogus")); diff --git a/src/test/java/org/kohsuke/github/GHDeploymentTest.java b/src/test/java/org/kohsuke/github/GHDeploymentTest.java new file mode 100644 index 000000000..1c228c7aa --- /dev/null +++ b/src/test/java/org/kohsuke/github/GHDeploymentTest.java @@ -0,0 +1,27 @@ +package org.kohsuke.github; + +import org.junit.Test; + +import java.io.IOException; +import static org.junit.Assert.assertNotNull; + +/** + * @author Martin van Zijl + */ +public class GHDeploymentTest extends AbstractGitHubWireMockTest { + + @Test + public void testGetDeploymentById() throws IOException { + GHRepository repo = getRepository(); + GHDeployment deployment = repo.getDeployment(178653229); + assertNotNull(deployment); + } + + 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"); + } +} diff --git a/src/test/java/org/kohsuke/github/GHMilestoneTest.java b/src/test/java/org/kohsuke/github/GHMilestoneTest.java new file mode 100644 index 000000000..c0ab88674 --- /dev/null +++ b/src/test/java/org/kohsuke/github/GHMilestoneTest.java @@ -0,0 +1,64 @@ +package org.kohsuke.github; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; +import java.util.Date; + +/** + * @author Martin van Zijl + */ +public class GHMilestoneTest extends AbstractGitHubWireMockTest { + + @Before + @After + public void cleanUp() throws Exception { + // Cleanup is only needed when proxying + if (!mockGitHub.isUseProxy()) { + return; + } + + for (GHMilestone milestone : getRepository(gitHubBeforeAfter).listMilestones(GHIssueState.ALL)) { + if ("Original Title".equals(milestone.getTitle()) || + "Updated Title".equals(milestone.getTitle())) { + milestone.delete(); + } + } + } + + @Test + public void testUpdateMilestone() throws Exception { + GHRepository repo = getRepository(); + GHMilestone milestone = repo.createMilestone("Original Title", + "To test the update methods"); + + String NEW_TITLE = "Updated Title"; + String NEW_DESCRIPTION = "Updated Description"; + Date NEW_DUE_DATE = GitHub.parseDate("2020-10-05T13:00:00Z"); + Date OUTPUT_DUE_DATE = GitHub.parseDate("2020-10-05T07:00:00Z"); + + milestone.setTitle(NEW_TITLE); + milestone.setDescription(NEW_DESCRIPTION); + milestone.setDueOn(NEW_DUE_DATE); + + // Force reload. + milestone = repo.getMilestone(milestone.getNumber()); + + assertEquals(NEW_TITLE, milestone.getTitle()); + assertEquals(NEW_DESCRIPTION, milestone.getDescription()); + + // The time is truncated when sent to the server, but still part of the returned value + // 07:00 midnight PDT + assertEquals(OUTPUT_DUE_DATE, milestone.getDueOn()); + } + + 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"); + } +} diff --git a/src/test/java/org/kohsuke/github/GitHubConnectionTest.java b/src/test/java/org/kohsuke/github/GitHubConnectionTest.java index 61753e94d..5db75f650 100644 --- a/src/test/java/org/kohsuke/github/GitHubConnectionTest.java +++ b/src/test/java/org/kohsuke/github/GitHubConnectionTest.java @@ -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 { diff --git a/src/test/java/org/kohsuke/github/GitHubStaticTest.java b/src/test/java/org/kohsuke/github/GitHubStaticTest.java new file mode 100644 index 000000000..793f23cc7 --- /dev/null +++ b/src/test/java/org/kohsuke/github/GitHubStaticTest.java @@ -0,0 +1,72 @@ +package org.kohsuke.github; + +import org.junit.Assert; +import org.junit.Test; + +import java.text.SimpleDateFormat; +import java.time.Instant; +import java.time.temporal.ChronoUnit; +import java.util.Date; +import java.util.TimeZone; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.not; + +/** + * Unit test for {@link GitHub} static helpers. + * + * @author Liam Newman + */ +public class GitHubStaticTest extends Assert { + + @Test + public void timeRoundTrip() throws Exception { + Instant instantNow = Instant.now(); + + Date instantSeconds = Date.from(instantNow.truncatedTo(ChronoUnit.SECONDS)); + Date instantMillis = Date.from(instantNow.truncatedTo(ChronoUnit.MILLIS)); + + // TODO: other formats + String instantFormatSlash = formatDate(instantMillis, "yyyy/MM/dd HH:mm:ss ZZZZ"); + String instantFormatDash = formatDate(instantMillis, "yyyy-MM-dd'T'HH:mm:ss'Z'"); + String instantFormatMillis = formatDate(instantMillis, "yyyy-MM-dd'T'HH:mm:ss.S'Z'"); + String instantSecondsFormatMillis = formatDate(instantSeconds, "yyyy-MM-dd'T'HH:mm:ss.S'Z'"); + String instantBadFormat = formatDate(instantMillis, "yy-MM-dd'T'HH:mm'Z'"); + + + assertThat(GitHub.parseDate(GitHub.printDate(instantSeconds)), + equalTo(GitHub.parseDate(GitHub.printDate(instantMillis)))); + + assertThat(instantSeconds, + equalTo(GitHub.parseDate(GitHub.printDate(instantSeconds)))); + + assertThat(instantMillis, + not(equalTo(GitHub.parseDate(GitHub.printDate(instantMillis))))); + + assertThat(instantSeconds, + equalTo(GitHub.parseDate(instantFormatSlash))); + + assertThat(instantSeconds, + equalTo(GitHub.parseDate(instantFormatDash))); + + assertThat(instantMillis, + equalTo(GitHub.parseDate(instantFormatMillis))); + + assertThat(instantSeconds, + equalTo(GitHub.parseDate(instantSecondsFormatMillis))); + + try { + GitHub.parseDate(instantBadFormat); + fail("Bad time format should throw."); + } catch (IllegalStateException e) { + assertThat(e.getMessage(), equalTo("Unable to parse the timestamp: " + instantBadFormat)); + } + } + + static String formatDate(Date dt, String format) { + SimpleDateFormat df = new SimpleDateFormat(format); + df.setTimeZone(TimeZone.getTimeZone("GMT")); + return df.format(dt); + } + +} diff --git a/src/test/resources/org/kohsuke/github/GHDeploymentTest/wiremock/testGetDeploymentById/__files/orgs_github-api-test-org-4def936c-47fd-43aa-851a-f9dd06f236b5.json b/src/test/resources/org/kohsuke/github/GHDeploymentTest/wiremock/testGetDeploymentById/__files/orgs_github-api-test-org-4def936c-47fd-43aa-851a-f9dd06f236b5.json new file mode 100644 index 000000000..99b5920cc --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHDeploymentTest/wiremock/testGetDeploymentById/__files/orgs_github-api-test-org-4def936c-47fd-43aa-851a-f9dd06f236b5.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/github-api-test-org", + "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", + "events_url": "https://api.github.com/orgs/github-api-test-org/events", + "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", + "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", + "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 10, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/github-api-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 132, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 7, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHDeploymentTest/wiremock/testGetDeploymentById/__files/repos_github-api-test-org_github-api-a1a9ff0a-2e37-4803-a9de-fb8fffd45f41.json b/src/test/resources/org/kohsuke/github/GHDeploymentTest/wiremock/testGetDeploymentById/__files/repos_github-api-test-org_github-api-a1a9ff0a-2e37-4803-a9de-fb8fffd45f41.json new file mode 100644 index 000000000..d2b06356d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHDeploymentTest/wiremock/testGetDeploymentById/__files/repos_github-api-test-org_github-api-a1a9ff0a-2e37-4803-a9de-fb8fffd45f41.json @@ -0,0 +1,330 @@ +{ + "id": 206888201, + "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", + "name": "github-api", + "full_name": "github-api-test-org/github-api", + "private": false, + "owner": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api-test-org", + "html_url": "https://github.com/github-api-test-org", + "followers_url": "https://api.github.com/users/github-api-test-org/followers", + "following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/github-api-test-org/orgs", + "repos_url": "https://api.github.com/users/github-api-test-org/repos", + "events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/github-api-test-org/github-api", + "description": "Tricky", + "fork": true, + "url": "https://api.github.com/repos/github-api-test-org/github-api", + "forks_url": "https://api.github.com/repos/github-api-test-org/github-api/forks", + "keys_url": "https://api.github.com/repos/github-api-test-org/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api-test-org/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api-test-org/github-api/teams", + "hooks_url": "https://api.github.com/repos/github-api-test-org/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/github-api-test-org/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api-test-org/github-api/events", + "assignees_url": "https://api.github.com/repos/github-api-test-org/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api-test-org/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api-test-org/github-api/tags", + "blobs_url": "https://api.github.com/repos/github-api-test-org/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api-test-org/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api-test-org/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api-test-org/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api-test-org/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api-test-org/github-api/languages", + "stargazers_url": "https://api.github.com/repos/github-api-test-org/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/github-api-test-org/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/github-api-test-org/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/github-api-test-org/github-api/subscription", + "commits_url": "https://api.github.com/repos/github-api-test-org/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api-test-org/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api-test-org/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api-test-org/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api-test-org/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api-test-org/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api-test-org/github-api/merges", + "archive_url": "https://api.github.com/repos/github-api-test-org/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api-test-org/github-api/downloads", + "issues_url": "https://api.github.com/repos/github-api-test-org/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api-test-org/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api-test-org/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api-test-org/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api-test-org/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api-test-org/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api-test-org/github-api/deployments", + "created_at": "2019-09-06T23:26:04Z", + "updated_at": "2019-09-30T22:36:47Z", + "pushed_at": "2019-10-21T22:34:49Z", + "git_url": "git://github.com/github-api-test-org/github-api.git", + "ssh_url": "git@github.com:github-api-test-org/github-api.git", + "clone_url": "https://github.com/github-api-test-org/github-api.git", + "svn_url": "https://github.com/github-api-test-org/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 11391, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 1, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "master", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api-test-org", + "html_url": "https://github.com/github-api-test-org", + "followers_url": "https://api.github.com/users/github-api-test-org/followers", + "following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/github-api-test-org/orgs", + "repos_url": "https://api.github.com/users/github-api-test-org/repos", + "events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "parent": { + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "github-api/github-api", + "private": false, + "owner": { + "login": "github-api", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api", + "html_url": "https://github.com/github-api", + "followers_url": "https://api.github.com/users/github-api/followers", + "following_url": "https://api.github.com/users/github-api/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api/subscriptions", + "organizations_url": "https://api.github.com/users/github-api/orgs", + "repos_url": "https://api.github.com/users/github-api/repos", + "events_url": "https://api.github.com/users/github-api/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/github-api/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/github-api/github-api", + "forks_url": "https://api.github.com/repos/github-api/github-api/forks", + "keys_url": "https://api.github.com/repos/github-api/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api/github-api/teams", + "hooks_url": "https://api.github.com/repos/github-api/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/github-api/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api/github-api/events", + "assignees_url": "https://api.github.com/repos/github-api/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api/github-api/tags", + "blobs_url": "https://api.github.com/repos/github-api/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api/github-api/languages", + "stargazers_url": "https://api.github.com/repos/github-api/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/github-api/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/github-api/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/github-api/github-api/subscription", + "commits_url": "https://api.github.com/repos/github-api/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api/github-api/merges", + "archive_url": "https://api.github.com/repos/github-api/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api/github-api/downloads", + "issues_url": "https://api.github.com/repos/github-api/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2019-10-28T06:11:20Z", + "pushed_at": "2019-10-29T23:24:04Z", + "git_url": "git://github.com/github-api/github-api.git", + "ssh_url": "git@github.com:github-api/github-api.git", + "clone_url": "https://github.com/github-api/github-api.git", + "svn_url": "https://github.com/github-api/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 14742, + "stargazers_count": 568, + "watchers_count": 568, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 433, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 66, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 433, + "open_issues": 66, + "watchers": 568, + "default_branch": "master" + }, + "source": { + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "github-api/github-api", + "private": false, + "owner": { + "login": "github-api", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api", + "html_url": "https://github.com/github-api", + "followers_url": "https://api.github.com/users/github-api/followers", + "following_url": "https://api.github.com/users/github-api/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api/subscriptions", + "organizations_url": "https://api.github.com/users/github-api/orgs", + "repos_url": "https://api.github.com/users/github-api/repos", + "events_url": "https://api.github.com/users/github-api/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/github-api/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/github-api/github-api", + "forks_url": "https://api.github.com/repos/github-api/github-api/forks", + "keys_url": "https://api.github.com/repos/github-api/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api/github-api/teams", + "hooks_url": "https://api.github.com/repos/github-api/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/github-api/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api/github-api/events", + "assignees_url": "https://api.github.com/repos/github-api/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api/github-api/tags", + "blobs_url": "https://api.github.com/repos/github-api/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api/github-api/languages", + "stargazers_url": "https://api.github.com/repos/github-api/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/github-api/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/github-api/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/github-api/github-api/subscription", + "commits_url": "https://api.github.com/repos/github-api/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api/github-api/merges", + "archive_url": "https://api.github.com/repos/github-api/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api/github-api/downloads", + "issues_url": "https://api.github.com/repos/github-api/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2019-10-28T06:11:20Z", + "pushed_at": "2019-10-29T23:24:04Z", + "git_url": "git://github.com/github-api/github-api.git", + "ssh_url": "git@github.com:github-api/github-api.git", + "clone_url": "https://github.com/github-api/github-api.git", + "svn_url": "https://github.com/github-api/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 14742, + "stargazers_count": 568, + "watchers_count": 568, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 433, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 66, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 433, + "open_issues": 66, + "watchers": 568, + "default_branch": "master" + }, + "network_count": 433, + "subscribers_count": 0 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHDeploymentTest/wiremock/testGetDeploymentById/__files/repos_github-api-test-org_github-api_deployments_178653229-d1d9d992-25e4-4a4b-8710-5b0c57e99a64.json b/src/test/resources/org/kohsuke/github/GHDeploymentTest/wiremock/testGetDeploymentById/__files/repos_github-api-test-org_github-api_deployments_178653229-d1d9d992-25e4-4a4b-8710-5b0c57e99a64.json new file mode 100644 index 000000000..1eea36725 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHDeploymentTest/wiremock/testGetDeploymentById/__files/repos_github-api-test-org_github-api_deployments_178653229-d1d9d992-25e4-4a4b-8710-5b0c57e99a64.json @@ -0,0 +1,36 @@ +{ + "url": "https://api.github.com/repos/github-api-test-org/github-api/deployments/178653229", + "id": 178653229, + "node_id": "MDEwOkRlcGxveW1lbnQxNzg2NTMyMjk=", + "sha": "3a09d2de4a9a1322a0ba2c3e2f54a919ca8fe353", + "ref": "master", + "task": "deploy", + "payload": {}, + "original_environment": "production", + "environment": "production", + "description": null, + "creator": { + "login": "martinvanzijl", + "id": 24422213, + "node_id": "MDQ6VXNlcjI0NDIyMjEz", + "avatar_url": "https://avatars0.githubusercontent.com/u/24422213?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/martinvanzijl", + "html_url": "https://github.com/martinvanzijl", + "followers_url": "https://api.github.com/users/martinvanzijl/followers", + "following_url": "https://api.github.com/users/martinvanzijl/following{/other_user}", + "gists_url": "https://api.github.com/users/martinvanzijl/gists{/gist_id}", + "starred_url": "https://api.github.com/users/martinvanzijl/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/martinvanzijl/subscriptions", + "organizations_url": "https://api.github.com/users/martinvanzijl/orgs", + "repos_url": "https://api.github.com/users/martinvanzijl/repos", + "events_url": "https://api.github.com/users/martinvanzijl/events{/privacy}", + "received_events_url": "https://api.github.com/users/martinvanzijl/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-30T00:03:34Z", + "updated_at": "2019-10-30T00:03:34Z", + "statuses_url": "https://api.github.com/repos/github-api-test-org/github-api/deployments/178653229/statuses", + "repository_url": "https://api.github.com/repos/github-api-test-org/github-api" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHDeploymentTest/wiremock/testGetDeploymentById/mappings/orgs_github-api-test-org-1-4def93.json b/src/test/resources/org/kohsuke/github/GHDeploymentTest/wiremock/testGetDeploymentById/mappings/orgs_github-api-test-org-1-4def93.json new file mode 100644 index 000000000..a1f19b6ef --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHDeploymentTest/wiremock/testGetDeploymentById/mappings/orgs_github-api-test-org-1-4def93.json @@ -0,0 +1,41 @@ +{ + "id": "4def936c-47fd-43aa-851a-f9dd06f236b5", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-4def936c-47fd-43aa-851a-f9dd06f236b5.json", + "headers": { + "Date": "Wed, 30 Oct 2019 00:11:46 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4980", + "X-RateLimit-Reset": "1572397284", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"4342e0e7004c1a50986c767513fe857d\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "DFCA:4866:E50AD:103D70:5DB8D541" + } + }, + "uuid": "4def936c-47fd-43aa-851a-f9dd06f236b5", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHDeploymentTest/wiremock/testGetDeploymentById/mappings/repos_github-api-test-org_github-api-2-a1a9ff.json b/src/test/resources/org/kohsuke/github/GHDeploymentTest/wiremock/testGetDeploymentById/mappings/repos_github-api-test-org_github-api-2-a1a9ff.json new file mode 100644 index 000000000..8a1f12ec4 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHDeploymentTest/wiremock/testGetDeploymentById/mappings/repos_github-api-test-org_github-api-2-a1a9ff.json @@ -0,0 +1,41 @@ +{ + "id": "a1a9ff0a-2e37-4803-a9de-fb8fffd45f41", + "name": "repos_github-api-test-org_github-api", + "request": { + "url": "/repos/github-api-test-org/github-api", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api-test-org_github-api-a1a9ff0a-2e37-4803-a9de-fb8fffd45f41.json", + "headers": { + "Date": "Wed, 30 Oct 2019 00:11:47 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4979", + "X-RateLimit-Reset": "1572397284", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"4ef7d9ee7bc7f4f32000eb0720da5bf1\"", + "Last-Modified": "Mon, 30 Sep 2019 22:36:47 GMT", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "DFCA:4866:E50D8:103D81:5DB8D542" + } + }, + "uuid": "a1a9ff0a-2e37-4803-a9de-fb8fffd45f41", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHDeploymentTest/wiremock/testGetDeploymentById/mappings/repos_github-api-test-org_github-api_deployments_178653229-3-d1d9d9.json b/src/test/resources/org/kohsuke/github/GHDeploymentTest/wiremock/testGetDeploymentById/mappings/repos_github-api-test-org_github-api_deployments_178653229-3-d1d9d9.json new file mode 100644 index 000000000..0686b5e78 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHDeploymentTest/wiremock/testGetDeploymentById/mappings/repos_github-api-test-org_github-api_deployments_178653229-3-d1d9d9.json @@ -0,0 +1,41 @@ +{ + "id": "d1d9d992-25e4-4a4b-8710-5b0c57e99a64", + "name": "repos_github-api-test-org_github-api_deployments_178653229", + "request": { + "url": "/repos/github-api-test-org/github-api/deployments/178653229", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api-test-org_github-api_deployments_178653229-d1d9d992-25e4-4a4b-8710-5b0c57e99a64.json", + "headers": { + "Date": "Wed, 30 Oct 2019 00:11:48 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4978", + "X-RateLimit-Reset": "1572397284", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"e1b3c1f524645e959b25405131fba656\"", + "Last-Modified": "Wed, 30 Oct 2019 00:03:34 GMT", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "DFCA:4866:E50EA:103DAF:5DB8D543" + } + }, + "uuid": "d1d9d992-25e4-4a4b-8710-5b0c57e99a64", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/orgs_github-api-test-org-fdbcaf38-478b-440a-851a-b5913757f6f3.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/orgs_github-api-test-org-fdbcaf38-478b-440a-851a-b5913757f6f3.json new file mode 100644 index 000000000..99b5920cc --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/orgs_github-api-test-org-fdbcaf38-478b-440a-851a-b5913757f6f3.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/github-api-test-org", + "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", + "events_url": "https://api.github.com/orgs/github-api-test-org/events", + "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", + "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", + "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 10, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/github-api-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 132, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 7, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/repos_github-api-test-org_github-api-701999a2-14ad-4078-ab89-b0f722cbc52f.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/repos_github-api-test-org_github-api-701999a2-14ad-4078-ab89-b0f722cbc52f.json new file mode 100644 index 000000000..0f9bc22b6 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/repos_github-api-test-org_github-api-701999a2-14ad-4078-ab89-b0f722cbc52f.json @@ -0,0 +1,330 @@ +{ + "id": 206888201, + "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", + "name": "github-api", + "full_name": "github-api-test-org/github-api", + "private": false, + "owner": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api-test-org", + "html_url": "https://github.com/github-api-test-org", + "followers_url": "https://api.github.com/users/github-api-test-org/followers", + "following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/github-api-test-org/orgs", + "repos_url": "https://api.github.com/users/github-api-test-org/repos", + "events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/github-api-test-org/github-api", + "description": "Tricky", + "fork": true, + "url": "https://api.github.com/repos/github-api-test-org/github-api", + "forks_url": "https://api.github.com/repos/github-api-test-org/github-api/forks", + "keys_url": "https://api.github.com/repos/github-api-test-org/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api-test-org/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api-test-org/github-api/teams", + "hooks_url": "https://api.github.com/repos/github-api-test-org/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/github-api-test-org/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api-test-org/github-api/events", + "assignees_url": "https://api.github.com/repos/github-api-test-org/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api-test-org/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api-test-org/github-api/tags", + "blobs_url": "https://api.github.com/repos/github-api-test-org/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api-test-org/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api-test-org/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api-test-org/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api-test-org/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api-test-org/github-api/languages", + "stargazers_url": "https://api.github.com/repos/github-api-test-org/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/github-api-test-org/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/github-api-test-org/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/github-api-test-org/github-api/subscription", + "commits_url": "https://api.github.com/repos/github-api-test-org/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api-test-org/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api-test-org/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api-test-org/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api-test-org/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api-test-org/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api-test-org/github-api/merges", + "archive_url": "https://api.github.com/repos/github-api-test-org/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api-test-org/github-api/downloads", + "issues_url": "https://api.github.com/repos/github-api-test-org/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api-test-org/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api-test-org/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api-test-org/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api-test-org/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api-test-org/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api-test-org/github-api/deployments", + "created_at": "2019-09-06T23:26:04Z", + "updated_at": "2019-10-30T01:54:39Z", + "pushed_at": "2019-10-21T22:34:49Z", + "git_url": "git://github.com/github-api-test-org/github-api.git", + "ssh_url": "git@github.com:github-api-test-org/github-api.git", + "clone_url": "https://github.com/github-api-test-org/github-api.git", + "svn_url": "https://github.com/github-api-test-org/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 11391, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api-test-org", + "html_url": "https://github.com/github-api-test-org", + "followers_url": "https://api.github.com/users/github-api-test-org/followers", + "following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/github-api-test-org/orgs", + "repos_url": "https://api.github.com/users/github-api-test-org/repos", + "events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "parent": { + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "github-api/github-api", + "private": false, + "owner": { + "login": "github-api", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api", + "html_url": "https://github.com/github-api", + "followers_url": "https://api.github.com/users/github-api/followers", + "following_url": "https://api.github.com/users/github-api/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api/subscriptions", + "organizations_url": "https://api.github.com/users/github-api/orgs", + "repos_url": "https://api.github.com/users/github-api/repos", + "events_url": "https://api.github.com/users/github-api/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/github-api/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/github-api/github-api", + "forks_url": "https://api.github.com/repos/github-api/github-api/forks", + "keys_url": "https://api.github.com/repos/github-api/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api/github-api/teams", + "hooks_url": "https://api.github.com/repos/github-api/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/github-api/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api/github-api/events", + "assignees_url": "https://api.github.com/repos/github-api/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api/github-api/tags", + "blobs_url": "https://api.github.com/repos/github-api/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api/github-api/languages", + "stargazers_url": "https://api.github.com/repos/github-api/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/github-api/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/github-api/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/github-api/github-api/subscription", + "commits_url": "https://api.github.com/repos/github-api/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api/github-api/merges", + "archive_url": "https://api.github.com/repos/github-api/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api/github-api/downloads", + "issues_url": "https://api.github.com/repos/github-api/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2019-10-30T19:56:01Z", + "pushed_at": "2019-10-30T19:57:20Z", + "git_url": "git://github.com/github-api/github-api.git", + "ssh_url": "git@github.com:github-api/github-api.git", + "clone_url": "https://github.com/github-api/github-api.git", + "svn_url": "https://github.com/github-api/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 14762, + "stargazers_count": 568, + "watchers_count": 568, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 433, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 66, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 433, + "open_issues": 66, + "watchers": 568, + "default_branch": "master" + }, + "source": { + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "github-api/github-api", + "private": false, + "owner": { + "login": "github-api", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api", + "html_url": "https://github.com/github-api", + "followers_url": "https://api.github.com/users/github-api/followers", + "following_url": "https://api.github.com/users/github-api/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api/subscriptions", + "organizations_url": "https://api.github.com/users/github-api/orgs", + "repos_url": "https://api.github.com/users/github-api/repos", + "events_url": "https://api.github.com/users/github-api/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/github-api/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/github-api/github-api", + "forks_url": "https://api.github.com/repos/github-api/github-api/forks", + "keys_url": "https://api.github.com/repos/github-api/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api/github-api/teams", + "hooks_url": "https://api.github.com/repos/github-api/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/github-api/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api/github-api/events", + "assignees_url": "https://api.github.com/repos/github-api/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api/github-api/tags", + "blobs_url": "https://api.github.com/repos/github-api/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api/github-api/languages", + "stargazers_url": "https://api.github.com/repos/github-api/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/github-api/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/github-api/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/github-api/github-api/subscription", + "commits_url": "https://api.github.com/repos/github-api/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api/github-api/merges", + "archive_url": "https://api.github.com/repos/github-api/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api/github-api/downloads", + "issues_url": "https://api.github.com/repos/github-api/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2019-10-30T19:56:01Z", + "pushed_at": "2019-10-30T19:57:20Z", + "git_url": "git://github.com/github-api/github-api.git", + "ssh_url": "git@github.com:github-api/github-api.git", + "clone_url": "https://github.com/github-api/github-api.git", + "svn_url": "https://github.com/github-api/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 14762, + "stargazers_count": 568, + "watchers_count": 568, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 433, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 66, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 433, + "open_issues": 66, + "watchers": 568, + "default_branch": "master" + }, + "network_count": 433, + "subscribers_count": 0 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/repos_github-api-test-org_github-api_milestones-a7ebf1ae-cbbb-4c59-8844-6888ad2493ba.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/repos_github-api-test-org_github-api_milestones-a7ebf1ae-cbbb-4c59-8844-6888ad2493ba.json new file mode 100644 index 000000000..bdc4076cb --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/repos_github-api-test-org_github-api_milestones-a7ebf1ae-cbbb-4c59-8844-6888ad2493ba.json @@ -0,0 +1,37 @@ +{ + "url": "https://api.github.com/repos/github-api-test-org/github-api/milestones/2", + "html_url": "https://github.com/github-api-test-org/github-api/milestone/2", + "labels_url": "https://api.github.com/repos/github-api-test-org/github-api/milestones/2/labels", + "id": 4800108, + "node_id": "MDk6TWlsZXN0b25lNDgwMDEwOA==", + "number": 2, + "title": "Original Title", + "description": "To test the update methods", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "open_issues": 0, + "closed_issues": 0, + "state": "open", + "created_at": "2019-10-30T22:04:20Z", + "updated_at": "2019-10-30T22:04:20Z", + "due_on": null, + "closed_at": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/repos_github-api-test-org_github-api_milestones_2-80930c65-6614-40e9-8cfb-51244eb49764.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/repos_github-api-test-org_github-api_milestones_2-80930c65-6614-40e9-8cfb-51244eb49764.json new file mode 100644 index 000000000..12e70dbbd --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/repos_github-api-test-org_github-api_milestones_2-80930c65-6614-40e9-8cfb-51244eb49764.json @@ -0,0 +1,37 @@ +{ + "url": "https://api.github.com/repos/github-api-test-org/github-api/milestones/2", + "html_url": "https://github.com/github-api-test-org/github-api/milestone/2", + "labels_url": "https://api.github.com/repos/github-api-test-org/github-api/milestones/2/labels", + "id": 4800108, + "node_id": "MDk6TWlsZXN0b25lNDgwMDEwOA==", + "number": 2, + "title": "Updated Title", + "description": "To test the update methods", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "open_issues": 0, + "closed_issues": 0, + "state": "open", + "created_at": "2019-10-30T22:04:20Z", + "updated_at": "2019-10-30T22:04:21Z", + "due_on": null, + "closed_at": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/repos_github-api-test-org_github-api_milestones_2-865125bf-0f31-4650-b668-9d5d72c47680.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/repos_github-api-test-org_github-api_milestones_2-865125bf-0f31-4650-b668-9d5d72c47680.json new file mode 100644 index 000000000..d1d89fe99 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/repos_github-api-test-org_github-api_milestones_2-865125bf-0f31-4650-b668-9d5d72c47680.json @@ -0,0 +1,37 @@ +{ + "url": "https://api.github.com/repos/github-api-test-org/github-api/milestones/2", + "html_url": "https://github.com/github-api-test-org/github-api/milestone/2", + "labels_url": "https://api.github.com/repos/github-api-test-org/github-api/milestones/2/labels", + "id": 4800108, + "node_id": "MDk6TWlsZXN0b25lNDgwMDEwOA==", + "number": 2, + "title": "Updated Title", + "description": "Updated Description", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "open_issues": 0, + "closed_issues": 0, + "state": "open", + "created_at": "2019-10-30T22:04:20Z", + "updated_at": "2019-10-30T22:04:21Z", + "due_on": null, + "closed_at": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/repos_github-api-test-org_github-api_milestones_2-b24a5b3a-76c0-44f6-950b-d0fdec878349.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/repos_github-api-test-org_github-api_milestones_2-b24a5b3a-76c0-44f6-950b-d0fdec878349.json new file mode 100644 index 000000000..a388cf456 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/repos_github-api-test-org_github-api_milestones_2-b24a5b3a-76c0-44f6-950b-d0fdec878349.json @@ -0,0 +1,37 @@ +{ + "url": "https://api.github.com/repos/github-api-test-org/github-api/milestones/2", + "html_url": "https://github.com/github-api-test-org/github-api/milestone/2", + "labels_url": "https://api.github.com/repos/github-api-test-org/github-api/milestones/2/labels", + "id": 4800108, + "node_id": "MDk6TWlsZXN0b25lNDgwMDEwOA==", + "number": 2, + "title": "Updated Title", + "description": "Updated Description", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "open_issues": 0, + "closed_issues": 0, + "state": "open", + "created_at": "2019-10-30T22:04:20Z", + "updated_at": "2019-10-30T22:04:21Z", + "due_on": "2020-10-05T07:00:00Z", + "closed_at": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/repos_github-api-test-org_github-api_milestones_2-fffe46e8-0b2e-4195-8e42-857e3127cd0b.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/repos_github-api-test-org_github-api_milestones_2-fffe46e8-0b2e-4195-8e42-857e3127cd0b.json new file mode 100644 index 000000000..a388cf456 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/repos_github-api-test-org_github-api_milestones_2-fffe46e8-0b2e-4195-8e42-857e3127cd0b.json @@ -0,0 +1,37 @@ +{ + "url": "https://api.github.com/repos/github-api-test-org/github-api/milestones/2", + "html_url": "https://github.com/github-api-test-org/github-api/milestone/2", + "labels_url": "https://api.github.com/repos/github-api-test-org/github-api/milestones/2/labels", + "id": 4800108, + "node_id": "MDk6TWlsZXN0b25lNDgwMDEwOA==", + "number": 2, + "title": "Updated Title", + "description": "Updated Description", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "open_issues": 0, + "closed_issues": 0, + "state": "open", + "created_at": "2019-10-30T22:04:20Z", + "updated_at": "2019-10-30T22:04:21Z", + "due_on": "2020-10-05T07:00:00Z", + "closed_at": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/user-7feb269c-7db0-4c3f-8c58-f99bdf1cafe8.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/user-7feb269c-7db0-4c3f-8c58-f99bdf1cafe8.json new file mode 100644 index 000000000..a4b576e8a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/__files/user-7feb269c-7db0-4c3f-8c58-f99bdf1cafe8.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 169, + "public_gists": 7, + "followers": 139, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/orgs_github-api-test-org-2-fdbcaf.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/orgs_github-api-test-org-2-fdbcaf.json new file mode 100644 index 000000000..e42826ff1 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/orgs_github-api-test-org-2-fdbcaf.json @@ -0,0 +1,43 @@ +{ + "id": "fdbcaf38-478b-440a-851a-b5913757f6f3", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-fdbcaf38-478b-440a-851a-b5913757f6f3.json", + "headers": { + "Date": "Wed, 30 Oct 2019 22:04:20 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4950", + "X-RateLimit-Reset": "1572476616", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"bbee0a14a82ca84871298052e1bcb545\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F2AC:26CD:64AA4:B171A:5DBA08E2" + } + }, + "uuid": "fdbcaf38-478b-440a-851a-b5913757f6f3", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/repos_github-api-test-org_github-api-3-701999.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/repos_github-api-test-org_github-api-3-701999.json new file mode 100644 index 000000000..277082678 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/repos_github-api-test-org_github-api-3-701999.json @@ -0,0 +1,43 @@ +{ + "id": "701999a2-14ad-4078-ab89-b0f722cbc52f", + "name": "repos_github-api-test-org_github-api", + "request": { + "url": "/repos/github-api-test-org/github-api", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api-test-org_github-api-701999a2-14ad-4078-ab89-b0f722cbc52f.json", + "headers": { + "Date": "Wed, 30 Oct 2019 22:04:20 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4949", + "X-RateLimit-Reset": "1572476616", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"50590b38f0a75703e69533e84bda5c10\"", + "Last-Modified": "Wed, 30 Oct 2019 01:54:39 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F2AC:26CD:64AA6:B173A:5DBA08E4" + } + }, + "uuid": "701999a2-14ad-4078-ab89-b0f722cbc52f", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/repos_github-api-test-org_github-api_milestones-4-a7ebf1.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/repos_github-api-test-org_github-api_milestones-4-a7ebf1.json new file mode 100644 index 000000000..6cccf5506 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/repos_github-api-test-org_github-api_milestones-4-a7ebf1.json @@ -0,0 +1,47 @@ +{ + "id": "a7ebf1ae-cbbb-4c59-8844-6888ad2493ba", + "name": "repos_github-api-test-org_github-api_milestones", + "request": { + "url": "/repos/github-api-test-org/github-api/milestones", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"description\":\"To test the update methods\",\"title\":\"Original Title\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_github-api-test-org_github-api_milestones-a7ebf1ae-cbbb-4c59-8844-6888ad2493ba.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 30 Oct 2019 22:04:20 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4948", + "X-RateLimit-Reset": "1572476616", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", + "ETag": "\"ce66f12f4b019a623862f9099dd8ac06\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "Location": "https://api.github.com/repos/github-api-test-org/github-api/milestones/2", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F2AC:26CD:64AA9:B173C:5DBA08E4" + } + }, + "uuid": "a7ebf1ae-cbbb-4c59-8844-6888ad2493ba", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/repos_github-api-test-org_github-api_milestones_2-5-80930c.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/repos_github-api-test-org_github-api_milestones_2-5-80930c.json new file mode 100644 index 000000000..031df1abd --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/repos_github-api-test-org_github-api_milestones_2-5-80930c.json @@ -0,0 +1,49 @@ +{ + "id": "80930c65-6614-40e9-8cfb-51244eb49764", + "name": "repos_github-api-test-org_github-api_milestones_2", + "request": { + "url": "/repos/github-api-test-org/github-api/milestones/2", + "method": "PATCH", + "bodyPatterns": [ + { + "equalToJson": "{\"title\":\"Updated Title\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api-test-org_github-api_milestones_2-80930c65-6614-40e9-8cfb-51244eb49764.json", + "headers": { + "Date": "Wed, 30 Oct 2019 22:04:21 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4947", + "X-RateLimit-Reset": "1572476616", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"870c796ce201b8d104442df63f095b43\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F2AC:26CD:64AAB:B1740:5DBA08E4" + } + }, + "uuid": "80930c65-6614-40e9-8cfb-51244eb49764", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/repos_github-api-test-org_github-api_milestones_2-6-865125.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/repos_github-api-test-org_github-api_milestones_2-6-865125.json new file mode 100644 index 000000000..6f622186a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/repos_github-api-test-org_github-api_milestones_2-6-865125.json @@ -0,0 +1,46 @@ +{ + "id": "865125bf-0f31-4650-b668-9d5d72c47680", + "name": "repos_github-api-test-org_github-api_milestones_2", + "request": { + "url": "/repos/github-api-test-org/github-api/milestones/2", + "method": "PATCH", + "bodyPatterns": [ + { + "equalToJson": "{\"description\":\"Updated Description\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api-test-org_github-api_milestones_2-865125bf-0f31-4650-b668-9d5d72c47680.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 30 Oct 2019 22:04:21 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4946", + "X-RateLimit-Reset": "1572476616", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", + "ETag": "W/\"d4dd5030d06a729043f3d03079e9fe3d\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F2AC:26CD:64AAE:B1744:5DBA08E5" + } + }, + "uuid": "865125bf-0f31-4650-b668-9d5d72c47680", + "persistent": true, + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/repos_github-api-test-org_github-api_milestones_2-7-b24a5b.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/repos_github-api-test-org_github-api_milestones_2-7-b24a5b.json new file mode 100644 index 000000000..c34ee3e36 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/repos_github-api-test-org_github-api_milestones_2-7-b24a5b.json @@ -0,0 +1,49 @@ +{ + "id": "b24a5b3a-76c0-44f6-950b-d0fdec878349", + "name": "repos_github-api-test-org_github-api_milestones_2", + "request": { + "url": "/repos/github-api-test-org/github-api/milestones/2", + "method": "PATCH", + "bodyPatterns": [ + { + "equalToJson": "{\"due_on\":\"2020-10-05T13:00:00Z\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api-test-org_github-api_milestones_2-b24a5b3a-76c0-44f6-950b-d0fdec878349.json", + "headers": { + "Date": "Wed, 30 Oct 2019 22:04:21 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4945", + "X-RateLimit-Reset": "1572476616", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"f6b5158570f599d271e8d001b807457e\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F2AC:26CD:64AB1:B1749:5DBA08E5" + } + }, + "uuid": "b24a5b3a-76c0-44f6-950b-d0fdec878349", + "persistent": true, + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/repos_github-api-test-org_github-api_milestones_2-8-fffe46.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/repos_github-api-test-org_github-api_milestones_2-8-fffe46.json new file mode 100644 index 000000000..8261347b9 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/repos_github-api-test-org_github-api_milestones_2-8-fffe46.json @@ -0,0 +1,43 @@ +{ + "id": "fffe46e8-0b2e-4195-8e42-857e3127cd0b", + "name": "repos_github-api-test-org_github-api_milestones_2", + "request": { + "url": "/repos/github-api-test-org/github-api/milestones/2", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api-test-org_github-api_milestones_2-fffe46e8-0b2e-4195-8e42-857e3127cd0b.json", + "headers": { + "Date": "Wed, 30 Oct 2019 22:04:21 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4944", + "X-RateLimit-Reset": "1572476616", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"f6b5158570f599d271e8d001b807457e\"", + "Last-Modified": "Wed, 30 Oct 2019 22:04:21 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F2AC:26CD:64AB3:B174F:5DBA08E5" + } + }, + "uuid": "fffe46e8-0b2e-4195-8e42-857e3127cd0b", + "persistent": true, + "insertionIndex": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/user-1-7feb26.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/user-1-7feb26.json new file mode 100644 index 000000000..9d8543b24 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUpdateMilestone/mappings/user-1-7feb26.json @@ -0,0 +1,40 @@ +{ + "id": "7feb269c-7db0-4c3f-8c58-f99bdf1cafe8", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-7feb269c-7db0-4c3f-8c58-f99bdf1cafe8.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 30 Oct 2019 22:04:18 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4955", + "X-RateLimit-Reset": "1572476616", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", + "ETag": "W/\"8c3d3dcf6fc5f9edaf26c902295396e5\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F2AC:26CD:64A8F:B1718:5DBA08E2" + } + }, + "uuid": "7feb269c-7db0-4c3f-8c58-f99bdf1cafe8", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file