diff --git a/pom.xml b/pom.xml index de50af5b6..43d56b352 100644 --- a/pom.xml +++ b/pom.xml @@ -34,7 +34,7 @@ UTF-8 4.0.4 - 4.0.6 + 4.1.1 true 2.2 4.4.1 @@ -519,7 +519,7 @@ org.mockito mockito-core - 3.4.4 + 3.4.6 test diff --git a/src/main/java/org/kohsuke/github/GHBranch.java b/src/main/java/org/kohsuke/github/GHBranch.java index 72a7dd1c5..6788c9461 100644 --- a/src/main/java/org/kohsuke/github/GHBranch.java +++ b/src/main/java/org/kohsuke/github/GHBranch.java @@ -9,6 +9,8 @@ import java.net.URL; import java.util.Collection; import java.util.Objects; +import javax.annotation.CheckForNull; + /** * A branch in a repository. * @@ -165,6 +167,59 @@ public class GHBranch { } } + /** + * Merge a branch into this branch. + * + * @param headBranch + * the branch whose head will be merged + * + * @param commitMessage + * the commit message + * + * @return the merge {@link GHCommit} created, or {@code null} if the base already contains the head (nothing to + * merge). + * + * @throws IOException + * if merging fails + */ + @CheckForNull + public GHCommit merge(GHBranch headBranch, String commitMessage) throws IOException { + return merge(headBranch.getName(), commitMessage); + } + + /** + * Merge a ref into this branch. + * + * @param head + * the ref name that will be merged into this branch. Follows the usual ref naming rules, could be a + * branch name, tag, or commit sha. + * + * @param commitMessage + * the commit message + * + * @return the merge {@link GHCommit} created, or {@code null} if the base already contains the head (nothing to + * merge). + * + * @throws IOException + * if merging fails + */ + @CheckForNull + public GHCommit merge(String head, String commitMessage) throws IOException { + GHCommit result = root.createRequest() + .withUrlPath(owner.getApiTailUrl("merges")) + .method("POST") + .with("commit_message", commitMessage) + .with("base", this.name) + .with("head", head) + .fetch(GHCommit.class); + + if (result != null) { + result.wrapUp(owner); + } + + return result; + } + String getApiRoute() { return owner.getApiTailUrl("/branches/" + name); } diff --git a/src/main/java/org/kohsuke/github/GHCheckRun.java b/src/main/java/org/kohsuke/github/GHCheckRun.java index a615e942a..4f0bbe273 100644 --- a/src/main/java/org/kohsuke/github/GHCheckRun.java +++ b/src/main/java/org/kohsuke/github/GHCheckRun.java @@ -1,10 +1,14 @@ package org.kohsuke.github; +import com.fasterxml.jackson.annotation.JsonProperty; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.IOException; import java.net.URL; +import java.util.Arrays; +import java.util.Collections; import java.util.Date; +import java.util.List; /** * Represents a check run. @@ -14,6 +18,8 @@ import java.util.Date; @SuppressFBWarnings(value = { "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD", "URF_UNREAD_FIELD" }, justification = "JSON API") public class GHCheckRun extends GHObject { + + @JsonProperty("repository") GHRepository owner; GitHub root; @@ -34,7 +40,7 @@ public class GHCheckRun extends GHObject { GHCheckRun wrap(GHRepository owner) { this.owner = owner; - this.root = owner.root; + wrap(owner.root); return this; } @@ -42,7 +48,24 @@ public class GHCheckRun extends GHObject { this.root = root; if (owner != null) { owner.wrap(root); + if (pullRequests != null && pullRequests.length != 0) { + for (GHPullRequest singlePull : pullRequests) { + singlePull.wrap(owner); + } + } + } + if (checkSuite != null) { + if (owner != null) { + checkSuite.wrap(owner); + } else { + checkSuite.wrap(root); + } + } + if (app != null) { + app.wrapUp(root); + } + return this; } @@ -105,15 +128,22 @@ public class GHCheckRun extends GHObject { /** * Gets the pull requests participated in this check run. * - * @return Pull requests of this check run + * Note this field is only populated for events. When getting a {@link GHCheckRun} outside of an event, this is + * always empty. + * + * @return the list of {@link GHPullRequest}s for this check run. Only populated for events. + * @throws IOException + * the io exception */ - GHPullRequest[] getPullRequests() throws IOException { + public List getPullRequests() throws IOException { if (pullRequests != null && pullRequests.length != 0) { for (GHPullRequest singlePull : pullRequests) { - singlePull.refresh(); + // Only refresh if we haven't do so before + singlePull.refresh(singlePull.getTitle()); } + return Collections.unmodifiableList(Arrays.asList(pullRequests)); } - return pullRequests; + return Collections.emptyList(); } /** diff --git a/src/main/java/org/kohsuke/github/GHCheckSuite.java b/src/main/java/org/kohsuke/github/GHCheckSuite.java index 3a0a4bb98..2f4bf5543 100644 --- a/src/main/java/org/kohsuke/github/GHCheckSuite.java +++ b/src/main/java/org/kohsuke/github/GHCheckSuite.java @@ -1,10 +1,14 @@ package org.kohsuke.github; +import com.fasterxml.jackson.annotation.JsonProperty; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.IOException; import java.net.URL; +import java.util.Arrays; +import java.util.Collections; import java.util.Date; +import java.util.List; /** * Represents a check suite. @@ -14,6 +18,8 @@ import java.util.Date; @SuppressFBWarnings(value = { "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD", "URF_UNREAD_FIELD" }, justification = "JSON API") public class GHCheckSuite extends GHObject { + + @JsonProperty("repository") GHRepository owner; GitHub root; @@ -32,7 +38,7 @@ public class GHCheckSuite extends GHObject { GHCheckSuite wrap(GHRepository owner) { this.owner = owner; - this.root = owner.root; + this.wrap(owner.root); return this; } @@ -40,6 +46,14 @@ public class GHCheckSuite extends GHObject { this.root = root; if (owner != null) { owner.wrap(root); + if (pullRequests != null && pullRequests.length != 0) { + for (GHPullRequest singlePull : pullRequests) { + singlePull.wrap(owner); + } + } + } + if (app != null) { + app.wrapUp(root); } return this; } @@ -153,15 +167,22 @@ public class GHCheckSuite extends GHObject { /** * Gets the pull requests participated in this check suite. * - * @return Pull requests + * Note this field is only populated for events. When getting a {@link GHCheckSuite} outside of an event, this is + * always empty. + * + * @return the list of {@link GHPullRequest}s for this check suite. Only populated for events. + * @throws IOException + * the io exception */ - GHPullRequest[] getPullRequests() throws IOException { + public List getPullRequests() throws IOException { if (pullRequests != null && pullRequests.length != 0) { for (GHPullRequest singlePull : pullRequests) { - singlePull.refresh(); + // Only refresh if we haven't do so before + singlePull.refresh(singlePull.getTitle()); } + return Collections.unmodifiableList(Arrays.asList(pullRequests)); } - return pullRequests; + return Collections.emptyList(); } /** diff --git a/src/main/java/org/kohsuke/github/GHEvent.java b/src/main/java/org/kohsuke/github/GHEvent.java index d60115be9..0fb2834cb 100644 --- a/src/main/java/org/kohsuke/github/GHEvent.java +++ b/src/main/java/org/kohsuke/github/GHEvent.java @@ -63,6 +63,7 @@ public enum GHEvent { TEAM_ADD, WATCH, WORKFLOW_DISPATCH, + WORKFLOW_RUN, /** * Special event type that means "every possible event" diff --git a/src/main/java/org/kohsuke/github/GHIssue.java b/src/main/java/org/kohsuke/github/GHIssue.java index 274f89671..9251c5e32 100644 --- a/src/main/java/org/kohsuke/github/GHIssue.java +++ b/src/main/java/org/kohsuke/github/GHIssue.java @@ -239,7 +239,7 @@ public class GHIssue extends GHObject implements Reactable { } private void editIssue(String key, Object value) throws IOException { - root.createRequest().with(key, value).method("PATCH").withUrlPath(getIssuesApiRoute()).send(); + root.createRequest().withNullable(key, value).method("PATCH").withUrlPath(getIssuesApiRoute()).send(); } /** @@ -296,9 +296,9 @@ public class GHIssue extends GHObject implements Reactable { */ public void setMilestone(GHMilestone milestone) throws IOException { if (milestone == null) { - editNullable("milestone", null); + editIssue("milestone", null); } else { - edit("milestone", milestone.getNumber()); + editIssue("milestone", milestone.getNumber()); } } diff --git a/src/main/java/org/kohsuke/github/GHOrganization.java b/src/main/java/org/kohsuke/github/GHOrganization.java index dee08a4dc..c04f0805b 100644 --- a/src/main/java/org/kohsuke/github/GHOrganization.java +++ b/src/main/java/org/kohsuke/github/GHOrganization.java @@ -465,7 +465,7 @@ public class GHOrganization extends GHPerson { * The enum Permission. */ public enum Permission { - ADMIN, PUSH, PULL + ADMIN, MAINTAIN, PUSH, TRIAGE, PULL } /** diff --git a/src/main/java/org/kohsuke/github/GitHub.java b/src/main/java/org/kohsuke/github/GitHub.java index da29e0c53..d79c2929c 100644 --- a/src/main/java/org/kohsuke/github/GitHub.java +++ b/src/main/java/org/kohsuke/github/GitHub.java @@ -532,7 +532,7 @@ public class GitHub { } /** - * Gets the repository object from 'user/reponame' string that GitHub calls as "repository name" + * Gets the repository object from 'owner/repo' string that GitHub calls as "repository name" * * @param name * the name @@ -543,6 +543,9 @@ public class GitHub { */ public GHRepository getRepository(String name) throws IOException { String[] tokens = name.split("/"); + if (tokens.length < 2) { + throw new IllegalArgumentException("Repository name must be in format owner/repo"); + } return createRequest().withUrlPath("/repos/" + tokens[0] + '/' + tokens[1]) .fetch(GHRepository.class) .wrap(this); diff --git a/src/main/java/org/kohsuke/github/GitHubResponse.java b/src/main/java/org/kohsuke/github/GitHubResponse.java index a27a861b5..9e82eb80d 100644 --- a/src/main/java/org/kohsuke/github/GitHubResponse.java +++ b/src/main/java/org/kohsuke/github/GitHubResponse.java @@ -78,9 +78,14 @@ class GitHubResponse { @CheckForNull static T parseBody(ResponseInfo responseInfo, Class type) throws IOException { - if (responseInfo.statusCode() == HttpURLConnection.HTTP_NO_CONTENT && type != null && type.isArray()) { - // no content - return type.cast(Array.newInstance(type.getComponentType(), 0)); + if (responseInfo.statusCode() == HttpURLConnection.HTTP_NO_CONTENT) { + if (type != null && type.isArray()) { + // no content for array should be empty array + return type.cast(Array.newInstance(type.getComponentType(), 0)); + } else { + // no content for object should be null + return null; + } } String data = responseInfo.getBodyAsString(); diff --git a/src/test/java/org/kohsuke/github/GHBranchTest.java b/src/test/java/org/kohsuke/github/GHBranchTest.java new file mode 100644 index 000000000..2bffd8d05 --- /dev/null +++ b/src/test/java/org/kohsuke/github/GHBranchTest.java @@ -0,0 +1,47 @@ +package org.kohsuke.github; + +import org.junit.Test; + +import java.io.IOException; + +import static org.hamcrest.Matchers.*; + +public class GHBranchTest extends AbstractGitHubWireMockTest { + private static final String BRANCH_1 = "testBranch1"; + private static final String BRANCH_2 = "testBranch2"; + + private GHRepository repository; + + @Test + public void testMergeBranch() throws Exception { + repository = getTempRepository(); + + String masterHead = repository.getRef("heads/master").getObject().getSha(); + createRefAndPostContent(BRANCH_1, masterHead); + createRefAndPostContent(BRANCH_2, masterHead); + + GHBranch otherBranch = repository.getBranch(BRANCH_2); + String commitMessage = "merging " + BRANCH_2; + GHCommit mergeCommit = repository.getBranch(BRANCH_1).merge(otherBranch, commitMessage); + assertThat(mergeCommit, notNullValue()); + assertThat(mergeCommit.getCommitShortInfo().getMessage(), equalTo(commitMessage)); + + // Merging commit sha should work + commitMessage = "merging from " + mergeCommit.getSHA1(); + GHBranch master = repository.getBranch("master"); + mergeCommit = master.merge(mergeCommit.getSHA1(), commitMessage); + + assertThat(mergeCommit, notNullValue()); + assertThat(mergeCommit.getCommitShortInfo().getMessage(), equalTo(commitMessage)); + + mergeCommit = master.merge(mergeCommit.getSHA1(), commitMessage); + // Should be null since all changes already merged + assertThat(mergeCommit, nullValue()); + } + + private void createRefAndPostContent(String branchName, String sha) throws IOException { + String refName = "refs/heads/" + branchName; + repository.createRef(refName, sha); + repository.createContent().content(branchName).message(branchName).path(branchName).branch(branchName).commit(); + } +} diff --git a/src/test/java/org/kohsuke/github/GHEventPayloadTest.java b/src/test/java/org/kohsuke/github/GHEventPayloadTest.java index b8dd31172..b618635d7 100644 --- a/src/test/java/org/kohsuke/github/GHEventPayloadTest.java +++ b/src/test/java/org/kohsuke/github/GHEventPayloadTest.java @@ -3,6 +3,7 @@ package org.kohsuke.github; import org.junit.Rule; import org.junit.Test; +import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Collections; import java.util.TimeZone; @@ -387,7 +388,25 @@ public class GHEventPayloadTest extends AbstractGitHubWireMockTest { @Payload("check-run") public void checkRunEvent() throws Exception { GHEventPayload.CheckRun event = GitHub.offline() - .parseEventPayload(payload.asReader(), GHEventPayload.CheckRun.class); + .parseEventPayload(payload.asReader(mockGitHub::mapToMockGitHub), GHEventPayload.CheckRun.class); + GHCheckRun checkRun = verifyBasicCheckRunEvent(event); + assertThat("pull body not populated offline", checkRun.getPullRequests().get(0).getBody(), nullValue()); + assertThat("using offline github", mockGitHub.getRequestCount(), equalTo(0)); + + gitHub = getGitHubBuilder().withEndpoint(mockGitHub.apiServer().baseUrl()).build(); + event = gitHub.parseEventPayload(payload.asReader(mockGitHub::mapToMockGitHub), GHEventPayload.CheckRun.class); + checkRun = verifyBasicCheckRunEvent(event); + + int expectedRequestCount = mockGitHub.isUseProxy() ? 3 : 2; + assertThat("pull body should be populated", + checkRun.getPullRequests().get(0).getBody(), + equalTo("This is a pretty simple change that we need to pull into master.")); + assertThat("multiple getPullRequests() calls are made, the pull is populated only once", + mockGitHub.getRequestCount(), + equalTo(expectedRequestCount)); + } + + private GHCheckRun verifyBasicCheckRunEvent(GHEventPayload.CheckRun event) throws IOException { assertThat(event.getRepository().getName(), is("Hello-World")); assertThat(event.getRepository().getOwner().getLogin(), is("Codertocat")); assertThat(event.getAction(), is("created")); @@ -406,9 +425,9 @@ public class GHEventPayloadTest extends AbstractGitHubWireMockTest { assertThat(formatter.format(checkRun.getCompletedAt()), is("2019-05-15T20:22:22Z")); assertThat(checkRun.getConclusion(), is("success")); - assertThat(checkRun.getUrl().toString(), - is("https://api.github.com/repos/Codertocat/Hello-World/check-runs/128620228")); - assertThat(checkRun.getHtmlUrl().toString(), is("https://github.com/Codertocat/Hello-World/runs/128620228")); + assertThat(checkRun.getUrl().toString(), endsWith("/repos/Codertocat/Hello-World/check-runs/128620228")); + assertThat(checkRun.getHtmlUrl().toString(), + endsWith("https://github.com/Codertocat/Hello-World/runs/128620228")); assertThat(checkRun.getDetailsUrl().toString(), is("https://octocoders.io")); assertThat(checkRun.getApp().getId(), is(29310L)); assertThat(checkRun.getCheckSuite().getId(), is(118578147L)); @@ -417,18 +436,41 @@ public class GHEventPayloadTest extends AbstractGitHubWireMockTest { assertThat(checkRun.getOutput().getText(), nullValue()); assertThat(checkRun.getOutput().getAnnotationsCount(), is(0)); assertThat(checkRun.getOutput().getAnnotationsUrl().toString(), - is("https://api.github.com/repos/Codertocat/Hello-World/check-runs/128620228/annotations")); + endsWith("/repos/Codertocat/Hello-World/check-runs/128620228/annotations")); // Checks the deserialization of sender assertThat(event.getSender().getId(), is(21031067L)); + + assertThat(checkRun.getPullRequests(), notNullValue()); + assertThat(checkRun.getPullRequests().size(), equalTo(1)); + assertThat(checkRun.getPullRequests().get(0).getNumber(), equalTo(2)); + return checkRun; } @Test @Payload("check-suite") public void checkSuiteEvent() throws Exception { GHEventPayload.CheckSuite event = GitHub.offline() - .parseEventPayload(payload.asReader(), GHEventPayload.CheckSuite.class); + .parseEventPayload(payload.asReader(mockGitHub::mapToMockGitHub), GHEventPayload.CheckSuite.class); + GHCheckSuite checkSuite = verifyBasicCheckSuiteEvent(event); + assertThat("pull body not populated offline", checkSuite.getPullRequests().get(0).getBody(), nullValue()); + assertThat("using offline github", mockGitHub.getRequestCount(), equalTo(0)); + gitHub = getGitHubBuilder().withEndpoint(mockGitHub.apiServer().baseUrl()).build(); + event = gitHub.parseEventPayload(payload.asReader(mockGitHub::mapToMockGitHub), + GHEventPayload.CheckSuite.class); + checkSuite = verifyBasicCheckSuiteEvent(event); + + int expectedRequestCount = mockGitHub.isUseProxy() ? 3 : 2; + assertThat("pull body should be populated", + checkSuite.getPullRequests().get(0).getBody(), + equalTo("This is a pretty simple change that we need to pull into master.")); + assertThat("multiple getPullRequests() calls are made, the pull is populated only once", + mockGitHub.getRequestCount(), + lessThanOrEqualTo(expectedRequestCount)); + } + + private GHCheckSuite verifyBasicCheckSuiteEvent(GHEventPayload.CheckSuite event) throws IOException { assertThat(event.getRepository().getName(), is("Hello-World")); assertThat(event.getRepository().getOwner().getLogin(), is("Codertocat")); assertThat(event.getAction(), is("completed")); @@ -445,7 +487,7 @@ public class GHEventPayloadTest extends AbstractGitHubWireMockTest { assertThat(checkSuite.getAfter(), is("ec26c3e57ca3a959ca5aad62de7213c562f8c821")); assertThat(checkSuite.getLatestCheckRunsCount(), is(1)); assertThat(checkSuite.getCheckRunsUrl().toString(), - is("https://api.github.com/repos/Codertocat/Hello-World/check-suites/118578147/check-runs")); + endsWith("/repos/Codertocat/Hello-World/check-suites/118578147/check-runs")); assertThat(checkSuite.getHeadCommit().getMessage(), is("Update README.md")); assertThat(checkSuite.getHeadCommit().getId(), is("ec26c3e57ca3a959ca5aad62de7213c562f8c821")); assertThat(checkSuite.getHeadCommit().getTreeId(), is("31b122c26a97cf9af023e9ddab94a82c6e77b0ea")); @@ -457,6 +499,11 @@ public class GHEventPayloadTest extends AbstractGitHubWireMockTest { assertThat(formatter.format(checkSuite.getHeadCommit().getTimestamp()), is("2019-05-15T15:20:30Z")); assertThat(checkSuite.getApp().getId(), is(29310L)); + + assertThat(checkSuite.getPullRequests(), notNullValue()); + assertThat(checkSuite.getPullRequests().size(), equalTo(1)); + assertThat(checkSuite.getPullRequests().get(0).getNumber(), equalTo(2)); + return checkSuite; } @Test diff --git a/src/test/java/org/kohsuke/github/GHMilestoneTest.java b/src/test/java/org/kohsuke/github/GHMilestoneTest.java index 0eb08df1d..046936dfa 100644 --- a/src/test/java/org/kohsuke/github/GHMilestoneTest.java +++ b/src/test/java/org/kohsuke/github/GHMilestoneTest.java @@ -70,6 +70,26 @@ public class GHMilestoneTest extends AbstractGitHubWireMockTest { assertEquals(null, issue.getMilestone()); } + @Test + public void testUnsetMilestoneFromPullRequest() throws IOException { + GHRepository repo = getRepository(); + GHMilestone milestone = repo.createMilestone("Unset Test Milestone", "For testUnsetMilestone"); + GHPullRequest p = repo.createPullRequest("testUnsetMilestoneFromPullRequest", + "test/stable", + "master", + "## test pull request"); + + // set the milestone + p.setMilestone(milestone); + p = repo.getPullRequest(p.getNumber()); // force reload + assertEquals(milestone.getNumber(), p.getMilestone().getNumber()); + + // remove the milestone + p.setMilestone(null); + p = repo.getPullRequest(p.getNumber()); // force reload + assertNull(p.getMilestone()); + } + protected GHRepository getRepository() throws IOException { return getRepository(gitHub); } diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch-2.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch-2.json new file mode 100644 index 000000000..563abbe8d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch-2.json @@ -0,0 +1,126 @@ +{ + "id": 283313593, + "node_id": "MDEwOlJlcG9zaXRvcnkyODMzMTM1OTM=", + "name": "temp-testMergeBranch", + "full_name": "hub4j-test-org/temp-testMergeBranch", + "private": false, + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/temp-testMergeBranch", + "description": "A test repository for testing the github-api project: temp-testMergeBranch", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch", + "forks_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/deployments", + "created_at": "2020-07-28T19:54:49Z", + "updated_at": "2020-07-28T19:54:53Z", + "pushed_at": "2020-07-28T19:54:51Z", + "git_url": "git://github.com/hub4j-test-org/temp-testMergeBranch.git", + "ssh_url": "git@github.com:hub4j-test-org/temp-testMergeBranch.git", + "clone_url": "https://github.com/hub4j-test-org/temp-testMergeBranch.git", + "svn_url": "https://github.com/hub4j-test-org/temp-testMergeBranch", + "homepage": "http://github-api.kohsuke.org/", + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "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": null, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "delete_branch_on_merge": false, + "organization": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 0, + "subscribers_count": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_branches_master-11.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_branches_master-11.json new file mode 100644 index 000000000..95014f264 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_branches_master-11.json @@ -0,0 +1,89 @@ +{ + "name": "master", + "commit": { + "sha": "688a1c3f8bc67deb767f68560ed8c7350d70d50f", + "node_id": "MDY6Q29tbWl0MjgzMzEzNTkzOjY4OGExYzNmOGJjNjdkZWI3NjdmNjg1NjBlZDhjNzM1MGQ3MGQ1MGY=", + "commit": { + "author": { + "name": "Liam Newman", + "email": "bitwiseman@gmail.com", + "date": "2020-07-28T19:54:50Z" + }, + "committer": { + "name": "GitHub", + "email": "noreply@github.com", + "date": "2020-07-28T19:54:50Z" + }, + "message": "Initial commit", + "tree": { + "sha": "c6da5eb430eb876e5a03323a62ea01365a753d3b", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/trees/c6da5eb430eb876e5a03323a62ea01365a753d3b" + }, + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/commits/688a1c3f8bc67deb767f68560ed8c7350d70d50f", + "comment_count": 0, + "verification": { + "verified": true, + "reason": "valid", + "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBcBAABCAAQBQJfIIKKCRBK7hj4Ov3rIwAAdHIIAH1NiSMFO1907U4QdfRgdqCP\nQHgc6KsflfLPxeP/Tt02Q+BJQeN8e1/IMXziwOp5dt5+CSuGFLN9U41fsBOxIRk6\nagqX5q4KleZaUEjOik2PfmXkwO+mQU64CX2QdpfHuqZNvCl6H1G4dnEAWdM1E3oA\nvLMIOHdjy6Fc1VJzmcc8+RVzUvKv/9Fq0uU6WR9Jl6TfMnfGqtVwQ1USuerhnIs0\nPSI9Yo12Wy8b+8psD3bwBcjbX8r6ItM//DjzU3XcKRZxv54u7tgQuLELqxh9dQSu\nCDSV9/LyHpMC3WMRAupusGsb4rMKeN+C7NYC4ZMmoRmwvWAhRKjTtCHBP8Ksapo=\n=OLMl\n-----END PGP SIGNATURE-----\n", + "payload": "tree c6da5eb430eb876e5a03323a62ea01365a753d3b\nauthor Liam Newman 1595966090 -0700\ncommitter GitHub 1595966090 -0700\n\nInitial commit" + } + }, + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/commits/688a1c3f8bc67deb767f68560ed8c7350d70d50f", + "html_url": "https://github.com/hub4j-test-org/temp-testMergeBranch/commit/688a1c3f8bc67deb767f68560ed8c7350d70d50f", + "comments_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/commits/688a1c3f8bc67deb767f68560ed8c7350d70d50f/comments", + "author": { + "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 + }, + "committer": { + "login": "web-flow", + "id": 19864447, + "node_id": "MDQ6VXNlcjE5ODY0NDQ3", + "avatar_url": "https://avatars3.githubusercontent.com/u/19864447?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/web-flow", + "html_url": "https://github.com/web-flow", + "followers_url": "https://api.github.com/users/web-flow/followers", + "following_url": "https://api.github.com/users/web-flow/following{/other_user}", + "gists_url": "https://api.github.com/users/web-flow/gists{/gist_id}", + "starred_url": "https://api.github.com/users/web-flow/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/web-flow/subscriptions", + "organizations_url": "https://api.github.com/users/web-flow/orgs", + "repos_url": "https://api.github.com/users/web-flow/repos", + "events_url": "https://api.github.com/users/web-flow/events{/privacy}", + "received_events_url": "https://api.github.com/users/web-flow/received_events", + "type": "User", + "site_admin": false + }, + "parents": [] + }, + "_links": { + "self": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/branches/master", + "html": "https://github.com/hub4j-test-org/temp-testMergeBranch/tree/master" + }, + "protected": false, + "protection": { + "enabled": false, + "required_status_checks": { + "enforcement_level": "off", + "contexts": [] + } + }, + "protection_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/branches/master/protection" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_branches_testbranch1-9.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_branches_testbranch1-9.json new file mode 100644 index 000000000..0479f9a5b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_branches_testbranch1-9.json @@ -0,0 +1,95 @@ +{ + "name": "testBranch1", + "commit": { + "sha": "beac07bbfdeb8a5d261739cd65c4caaaca48ac79", + "node_id": "MDY6Q29tbWl0MjgzMzEzNTkzOmJlYWMwN2JiZmRlYjhhNWQyNjE3MzljZDY1YzRjYWFhY2E0OGFjNzk=", + "commit": { + "author": { + "name": "Liam Newman", + "email": "bitwiseman@gmail.com", + "date": "2020-07-28T19:54:55Z" + }, + "committer": { + "name": "Liam Newman", + "email": "bitwiseman@gmail.com", + "date": "2020-07-28T19:54:55Z" + }, + "message": "testBranch1", + "tree": { + "sha": "540c4a3c093ad09a869163c60d44218774ff5474", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/trees/540c4a3c093ad09a869163c60d44218774ff5474" + }, + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/commits/beac07bbfdeb8a5d261739cd65c4caaaca48ac79", + "comment_count": 0, + "verification": { + "verified": false, + "reason": "unsigned", + "signature": null, + "payload": null + } + }, + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/commits/beac07bbfdeb8a5d261739cd65c4caaaca48ac79", + "html_url": "https://github.com/hub4j-test-org/temp-testMergeBranch/commit/beac07bbfdeb8a5d261739cd65c4caaaca48ac79", + "comments_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/commits/beac07bbfdeb8a5d261739cd65c4caaaca48ac79/comments", + "author": { + "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 + }, + "committer": { + "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 + }, + "parents": [ + { + "sha": "688a1c3f8bc67deb767f68560ed8c7350d70d50f", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/commits/688a1c3f8bc67deb767f68560ed8c7350d70d50f", + "html_url": "https://github.com/hub4j-test-org/temp-testMergeBranch/commit/688a1c3f8bc67deb767f68560ed8c7350d70d50f" + } + ] + }, + "_links": { + "self": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/branches/testBranch1", + "html": "https://github.com/hub4j-test-org/temp-testMergeBranch/tree/testBranch1" + }, + "protected": false, + "protection": { + "enabled": false, + "required_status_checks": { + "enforcement_level": "off", + "contexts": [] + } + }, + "protection_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/branches/testBranch1/protection" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_branches_testbranch2-8.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_branches_testbranch2-8.json new file mode 100644 index 000000000..2afd91f20 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_branches_testbranch2-8.json @@ -0,0 +1,95 @@ +{ + "name": "testBranch2", + "commit": { + "sha": "506cfc5bb47ac087b26c6d95d0ad305c5917c4b2", + "node_id": "MDY6Q29tbWl0MjgzMzEzNTkzOjUwNmNmYzViYjQ3YWMwODdiMjZjNmQ5NWQwYWQzMDVjNTkxN2M0YjI=", + "commit": { + "author": { + "name": "Liam Newman", + "email": "bitwiseman@gmail.com", + "date": "2020-07-28T19:54:57Z" + }, + "committer": { + "name": "Liam Newman", + "email": "bitwiseman@gmail.com", + "date": "2020-07-28T19:54:57Z" + }, + "message": "testBranch2", + "tree": { + "sha": "a183aaff617bc52ba1bdcea74faf24687194faf1", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/trees/a183aaff617bc52ba1bdcea74faf24687194faf1" + }, + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/commits/506cfc5bb47ac087b26c6d95d0ad305c5917c4b2", + "comment_count": 0, + "verification": { + "verified": false, + "reason": "unsigned", + "signature": null, + "payload": null + } + }, + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/commits/506cfc5bb47ac087b26c6d95d0ad305c5917c4b2", + "html_url": "https://github.com/hub4j-test-org/temp-testMergeBranch/commit/506cfc5bb47ac087b26c6d95d0ad305c5917c4b2", + "comments_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/commits/506cfc5bb47ac087b26c6d95d0ad305c5917c4b2/comments", + "author": { + "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 + }, + "committer": { + "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 + }, + "parents": [ + { + "sha": "688a1c3f8bc67deb767f68560ed8c7350d70d50f", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/commits/688a1c3f8bc67deb767f68560ed8c7350d70d50f", + "html_url": "https://github.com/hub4j-test-org/temp-testMergeBranch/commit/688a1c3f8bc67deb767f68560ed8c7350d70d50f" + } + ] + }, + "_links": { + "self": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/branches/testBranch2", + "html": "https://github.com/hub4j-test-org/temp-testMergeBranch/tree/testBranch2" + }, + "protected": false, + "protection": { + "enabled": false, + "required_status_checks": { + "enforcement_level": "off", + "contexts": [] + } + }, + "protection_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/branches/testBranch2/protection" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_contents_testbranch1-5.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_contents_testbranch1-5.json new file mode 100644 index 000000000..a1db105bc --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_contents_testbranch1-5.json @@ -0,0 +1,52 @@ +{ + "content": { + "name": "testBranch1", + "path": "testBranch1", + "sha": "2207929ecd1b9edb692e9538707dda960e1b0c8c", + "size": 11, + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/contents/testBranch1?ref=testBranch1", + "html_url": "https://github.com/hub4j-test-org/temp-testMergeBranch/blob/testBranch1/testBranch1", + "git_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/blobs/2207929ecd1b9edb692e9538707dda960e1b0c8c", + "download_url": "https://raw.githubusercontent.com/hub4j-test-org/temp-testMergeBranch/testBranch1/testBranch1", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/contents/testBranch1?ref=testBranch1", + "git": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/blobs/2207929ecd1b9edb692e9538707dda960e1b0c8c", + "html": "https://github.com/hub4j-test-org/temp-testMergeBranch/blob/testBranch1/testBranch1" + } + }, + "commit": { + "sha": "beac07bbfdeb8a5d261739cd65c4caaaca48ac79", + "node_id": "MDY6Q29tbWl0MjgzMzEzNTkzOmJlYWMwN2JiZmRlYjhhNWQyNjE3MzljZDY1YzRjYWFhY2E0OGFjNzk=", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/commits/beac07bbfdeb8a5d261739cd65c4caaaca48ac79", + "html_url": "https://github.com/hub4j-test-org/temp-testMergeBranch/commit/beac07bbfdeb8a5d261739cd65c4caaaca48ac79", + "author": { + "name": "Liam Newman", + "email": "bitwiseman@gmail.com", + "date": "2020-07-28T19:54:55Z" + }, + "committer": { + "name": "Liam Newman", + "email": "bitwiseman@gmail.com", + "date": "2020-07-28T19:54:55Z" + }, + "tree": { + "sha": "540c4a3c093ad09a869163c60d44218774ff5474", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/trees/540c4a3c093ad09a869163c60d44218774ff5474" + }, + "message": "testBranch1", + "parents": [ + { + "sha": "688a1c3f8bc67deb767f68560ed8c7350d70d50f", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/commits/688a1c3f8bc67deb767f68560ed8c7350d70d50f", + "html_url": "https://github.com/hub4j-test-org/temp-testMergeBranch/commit/688a1c3f8bc67deb767f68560ed8c7350d70d50f" + } + ], + "verification": { + "verified": false, + "reason": "unsigned", + "signature": null, + "payload": null + } + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_contents_testbranch2-7.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_contents_testbranch2-7.json new file mode 100644 index 000000000..bc545ee59 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_contents_testbranch2-7.json @@ -0,0 +1,52 @@ +{ + "content": { + "name": "testBranch2", + "path": "testBranch2", + "sha": "2a521d98876f51a95f38aaba58c9e81672f7dd4d", + "size": 11, + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/contents/testBranch2?ref=testBranch2", + "html_url": "https://github.com/hub4j-test-org/temp-testMergeBranch/blob/testBranch2/testBranch2", + "git_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/blobs/2a521d98876f51a95f38aaba58c9e81672f7dd4d", + "download_url": "https://raw.githubusercontent.com/hub4j-test-org/temp-testMergeBranch/testBranch2/testBranch2", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/contents/testBranch2?ref=testBranch2", + "git": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/blobs/2a521d98876f51a95f38aaba58c9e81672f7dd4d", + "html": "https://github.com/hub4j-test-org/temp-testMergeBranch/blob/testBranch2/testBranch2" + } + }, + "commit": { + "sha": "506cfc5bb47ac087b26c6d95d0ad305c5917c4b2", + "node_id": "MDY6Q29tbWl0MjgzMzEzNTkzOjUwNmNmYzViYjQ3YWMwODdiMjZjNmQ5NWQwYWQzMDVjNTkxN2M0YjI=", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/commits/506cfc5bb47ac087b26c6d95d0ad305c5917c4b2", + "html_url": "https://github.com/hub4j-test-org/temp-testMergeBranch/commit/506cfc5bb47ac087b26c6d95d0ad305c5917c4b2", + "author": { + "name": "Liam Newman", + "email": "bitwiseman@gmail.com", + "date": "2020-07-28T19:54:57Z" + }, + "committer": { + "name": "Liam Newman", + "email": "bitwiseman@gmail.com", + "date": "2020-07-28T19:54:57Z" + }, + "tree": { + "sha": "a183aaff617bc52ba1bdcea74faf24687194faf1", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/trees/a183aaff617bc52ba1bdcea74faf24687194faf1" + }, + "message": "testBranch2", + "parents": [ + { + "sha": "688a1c3f8bc67deb767f68560ed8c7350d70d50f", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/commits/688a1c3f8bc67deb767f68560ed8c7350d70d50f", + "html_url": "https://github.com/hub4j-test-org/temp-testMergeBranch/commit/688a1c3f8bc67deb767f68560ed8c7350d70d50f" + } + ], + "verification": { + "verified": false, + "reason": "unsigned", + "signature": null, + "payload": null + } + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_git_refs-4.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_git_refs-4.json new file mode 100644 index 000000000..d7e09f156 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_git_refs-4.json @@ -0,0 +1,10 @@ +{ + "ref": "refs/heads/testBranch1", + "node_id": "MDM6UmVmMjgzMzEzNTkzOnJlZnMvaGVhZHMvdGVzdEJyYW5jaDE=", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/refs/heads/testBranch1", + "object": { + "sha": "688a1c3f8bc67deb767f68560ed8c7350d70d50f", + "type": "commit", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/commits/688a1c3f8bc67deb767f68560ed8c7350d70d50f" + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_git_refs-6.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_git_refs-6.json new file mode 100644 index 000000000..a3cfca16c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_git_refs-6.json @@ -0,0 +1,10 @@ +{ + "ref": "refs/heads/testBranch2", + "node_id": "MDM6UmVmMjgzMzEzNTkzOnJlZnMvaGVhZHMvdGVzdEJyYW5jaDI=", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/refs/heads/testBranch2", + "object": { + "sha": "688a1c3f8bc67deb767f68560ed8c7350d70d50f", + "type": "commit", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/commits/688a1c3f8bc67deb767f68560ed8c7350d70d50f" + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_git_refs_heads_master-3.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_git_refs_heads_master-3.json new file mode 100644 index 000000000..d9e93d0e9 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_git_refs_heads_master-3.json @@ -0,0 +1,10 @@ +{ + "ref": "refs/heads/master", + "node_id": "MDM6UmVmMjgzMzEzNTkzOnJlZnMvaGVhZHMvbWFzdGVy", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/refs/heads/master", + "object": { + "sha": "688a1c3f8bc67deb767f68560ed8c7350d70d50f", + "type": "commit", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/commits/688a1c3f8bc67deb767f68560ed8c7350d70d50f" + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_merges-10.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_merges-10.json new file mode 100644 index 000000000..0600189cb --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_merges-10.json @@ -0,0 +1,84 @@ +{ + "sha": "4cfa1cac01c59db507f550c8c870dac98859b353", + "node_id": "MDY6Q29tbWl0MjgzMzEzNTkzOjRjZmExY2FjMDFjNTlkYjUwN2Y1NTBjOGM4NzBkYWM5ODg1OWIzNTM=", + "commit": { + "author": { + "name": "Liam Newman", + "email": "bitwiseman@gmail.com", + "date": "2020-07-28T19:54:59Z" + }, + "committer": { + "name": "GitHub", + "email": "noreply@github.com", + "date": "2020-07-28T19:54:59Z" + }, + "message": "merging testBranch2", + "tree": { + "sha": "a5ae8da88efbf6ff508c9575601f9a437a980626", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/trees/a5ae8da88efbf6ff508c9575601f9a437a980626" + }, + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/commits/4cfa1cac01c59db507f550c8c870dac98859b353", + "comment_count": 0, + "verification": { + "verified": true, + "reason": "valid", + "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBcBAABCAAQBQJfIIKTCRBK7hj4Ov3rIwAAdHIIAKw4VKMUQj3CyA3VEOw08LCH\ng92h7Jy7ztaufDOGaRRlss77+Hdc0HyAhjnSI/ovj7uFKA0XOd+UZ8TVZzXQ0Nxo\ndBGAiR21l4YxRjb0wcvxCakjqjgYF0Pe5Jy4cptRIWlGp3HGgobF7Xq/80LaeFZ4\nnWS/DljtpQhuBgzD+boejookUrq5paZXr1q76cg7Orv6MbLALLs61QHkuihZQDA2\nZ5MeIVelxxXCVlw2+pceAKFtO8g7/lES7tBNtVhIwkdiGk3/V+Y8YR+U3nQC6vt9\nVVvCYAmCEnAQXWNJX+Dl4Zrx7n81FUPA0Y+0wMU86aY97flnopEt56Dge66wCDg=\n=S8yx\n-----END PGP SIGNATURE-----\n", + "payload": "tree a5ae8da88efbf6ff508c9575601f9a437a980626\nparent beac07bbfdeb8a5d261739cd65c4caaaca48ac79\nparent 506cfc5bb47ac087b26c6d95d0ad305c5917c4b2\nauthor Liam Newman 1595966099 -0700\ncommitter GitHub 1595966099 -0700\n\nmerging testBranch2\n" + } + }, + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/commits/4cfa1cac01c59db507f550c8c870dac98859b353", + "html_url": "https://github.com/hub4j-test-org/temp-testMergeBranch/commit/4cfa1cac01c59db507f550c8c870dac98859b353", + "comments_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/commits/4cfa1cac01c59db507f550c8c870dac98859b353/comments", + "author": { + "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 + }, + "committer": { + "login": "web-flow", + "id": 19864447, + "node_id": "MDQ6VXNlcjE5ODY0NDQ3", + "avatar_url": "https://avatars3.githubusercontent.com/u/19864447?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/web-flow", + "html_url": "https://github.com/web-flow", + "followers_url": "https://api.github.com/users/web-flow/followers", + "following_url": "https://api.github.com/users/web-flow/following{/other_user}", + "gists_url": "https://api.github.com/users/web-flow/gists{/gist_id}", + "starred_url": "https://api.github.com/users/web-flow/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/web-flow/subscriptions", + "organizations_url": "https://api.github.com/users/web-flow/orgs", + "repos_url": "https://api.github.com/users/web-flow/repos", + "events_url": "https://api.github.com/users/web-flow/events{/privacy}", + "received_events_url": "https://api.github.com/users/web-flow/received_events", + "type": "User", + "site_admin": false + }, + "parents": [ + { + "sha": "beac07bbfdeb8a5d261739cd65c4caaaca48ac79", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/commits/beac07bbfdeb8a5d261739cd65c4caaaca48ac79", + "html_url": "https://github.com/hub4j-test-org/temp-testMergeBranch/commit/beac07bbfdeb8a5d261739cd65c4caaaca48ac79" + }, + { + "sha": "506cfc5bb47ac087b26c6d95d0ad305c5917c4b2", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/commits/506cfc5bb47ac087b26c6d95d0ad305c5917c4b2", + "html_url": "https://github.com/hub4j-test-org/temp-testMergeBranch/commit/506cfc5bb47ac087b26c6d95d0ad305c5917c4b2" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_merges-12.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_merges-12.json new file mode 100644 index 000000000..cab4de502 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/repos_hub4j-test-org_temp-testmergebranch_merges-12.json @@ -0,0 +1,84 @@ +{ + "sha": "223608e290ccc2f8902385528a24b1f7aec92acf", + "node_id": "MDY6Q29tbWl0MjgzMzEzNTkzOjIyMzYwOGUyOTBjY2MyZjg5MDIzODU1MjhhMjRiMWY3YWVjOTJhY2Y=", + "commit": { + "author": { + "name": "Liam Newman", + "email": "bitwiseman@gmail.com", + "date": "2020-07-28T19:55:00Z" + }, + "committer": { + "name": "GitHub", + "email": "noreply@github.com", + "date": "2020-07-28T19:55:00Z" + }, + "message": "merging from 4cfa1cac01c59db507f550c8c870dac98859b353", + "tree": { + "sha": "a5ae8da88efbf6ff508c9575601f9a437a980626", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/trees/a5ae8da88efbf6ff508c9575601f9a437a980626" + }, + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/commits/223608e290ccc2f8902385528a24b1f7aec92acf", + "comment_count": 0, + "verification": { + "verified": true, + "reason": "valid", + "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBcBAABCAAQBQJfIIKUCRBK7hj4Ov3rIwAAdHIIAIdVJ69VtTQx9t3iZvp+k5J6\ncmI9Y/oIT/pqbsm/GuAMnmMgV1os9xhEa0QlwUu+MYDARw0ZuCKyeg3be/r5iigv\nXMhvU30hSsath7x/HNoeLROizuRcHCtkWRYmltXaNBeegCDDISFJAbMAa5XSb0/8\nwyH0FwxbA1kOtRqoebFBaAyrHZGzFTYjJil6ChTvVaDCMJLCXvZs1cFf3nQyWTa+\nV7sHSc1aqGO3N8O8CA4DFEwXDXdH1Fd5zKUlfCHve99hyKXX0n3N6F9nXAfx4bE2\ncZ0vbiLPHgIN+jc2PamSmBCNKYM31X5Nyw6Uatt2m21pMwbZ0goq7r7ZROtgzyg=\n=MS4E\n-----END PGP SIGNATURE-----\n", + "payload": "tree a5ae8da88efbf6ff508c9575601f9a437a980626\nparent 688a1c3f8bc67deb767f68560ed8c7350d70d50f\nparent 4cfa1cac01c59db507f550c8c870dac98859b353\nauthor Liam Newman 1595966100 -0700\ncommitter GitHub 1595966100 -0700\n\nmerging from 4cfa1cac01c59db507f550c8c870dac98859b353\n" + } + }, + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/commits/223608e290ccc2f8902385528a24b1f7aec92acf", + "html_url": "https://github.com/hub4j-test-org/temp-testMergeBranch/commit/223608e290ccc2f8902385528a24b1f7aec92acf", + "comments_url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/commits/223608e290ccc2f8902385528a24b1f7aec92acf/comments", + "author": { + "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 + }, + "committer": { + "login": "web-flow", + "id": 19864447, + "node_id": "MDQ6VXNlcjE5ODY0NDQ3", + "avatar_url": "https://avatars3.githubusercontent.com/u/19864447?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/web-flow", + "html_url": "https://github.com/web-flow", + "followers_url": "https://api.github.com/users/web-flow/followers", + "following_url": "https://api.github.com/users/web-flow/following{/other_user}", + "gists_url": "https://api.github.com/users/web-flow/gists{/gist_id}", + "starred_url": "https://api.github.com/users/web-flow/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/web-flow/subscriptions", + "organizations_url": "https://api.github.com/users/web-flow/orgs", + "repos_url": "https://api.github.com/users/web-flow/repos", + "events_url": "https://api.github.com/users/web-flow/events{/privacy}", + "received_events_url": "https://api.github.com/users/web-flow/received_events", + "type": "User", + "site_admin": false + }, + "parents": [ + { + "sha": "688a1c3f8bc67deb767f68560ed8c7350d70d50f", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/commits/688a1c3f8bc67deb767f68560ed8c7350d70d50f", + "html_url": "https://github.com/hub4j-test-org/temp-testMergeBranch/commit/688a1c3f8bc67deb767f68560ed8c7350d70d50f" + }, + { + "sha": "4cfa1cac01c59db507f550c8c870dac98859b353", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/commits/4cfa1cac01c59db507f550c8c870dac98859b353", + "html_url": "https://github.com/hub4j-test-org/temp-testMergeBranch/commit/4cfa1cac01c59db507f550c8c870dac98859b353" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/user-1.json new file mode 100644 index 000000000..00cf4f0f4 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/__files/user-1.json @@ -0,0 +1,46 @@ +{ + "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": null, + "twitter_username": "bitwiseman", + "public_repos": 197, + "public_gists": 7, + "followers": 164, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2020-07-27T20:21:05Z", + "private_gists": 19, + "total_private_repos": 13, + "owned_private_repos": 0, + "disk_usage": 33700, + "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/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch-2.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch-2.json new file mode 100644 index 000000000..83db2e797 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch-2.json @@ -0,0 +1,47 @@ +{ + "id": "a05c0e96-b289-4199-a555-c2bfd303a19b", + "name": "repos_hub4j-test-org_temp-testmergebranch", + "request": { + "url": "/repos/hub4j-test-org/temp-testMergeBranch", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_temp-testmergebranch-2.json", + "headers": { + "Date": "Tue, 28 Jul 2020 19:54:54 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4994", + "X-RateLimit-Reset": "1595969687", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"50d2a9acff5c7f08e2753ccafeeb04a6\"", + "Last-Modified": "Tue, 28 Jul 2020 19:54:53 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", + "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": "EE13:3784:A649D:D1586:5F208288" + } + }, + "uuid": "a05c0e96-b289-4199-a555-c2bfd303a19b", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_branches_master-11.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_branches_master-11.json new file mode 100644 index 000000000..1f74650e2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_branches_master-11.json @@ -0,0 +1,46 @@ +{ + "id": "149b51b4-e911-42b7-b181-488bb6a2bf95", + "name": "repos_hub4j-test-org_temp-testmergebranch_branches_master", + "request": { + "url": "/repos/hub4j-test-org/temp-testMergeBranch/branches/master", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_temp-testmergebranch_branches_master-11.json", + "headers": { + "Date": "Tue, 28 Jul 2020 19:55:00 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4985", + "X-RateLimit-Reset": "1595969688", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"c2772edda686a81b33fab1f45051da14\"", + "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", + "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": "EE13:3784:A6552:D17AC:5F208293" + } + }, + "uuid": "149b51b4-e911-42b7-b181-488bb6a2bf95", + "persistent": true, + "insertionIndex": 11 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_branches_testbranch1-9.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_branches_testbranch1-9.json new file mode 100644 index 000000000..1465e7903 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_branches_testbranch1-9.json @@ -0,0 +1,46 @@ +{ + "id": "3ae737b6-9240-422d-8e4e-f3c3e6fef444", + "name": "repos_hub4j-test-org_temp-testmergebranch_branches_testbranch1", + "request": { + "url": "/repos/hub4j-test-org/temp-testMergeBranch/branches/testBranch1", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_temp-testmergebranch_branches_testbranch1-9.json", + "headers": { + "Date": "Tue, 28 Jul 2020 19:54:58 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4987", + "X-RateLimit-Reset": "1595969687", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"34ff9c8b8f8d8123155a0db487411a1c\"", + "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", + "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": "EE13:3784:A6519:D1765:5F208292" + } + }, + "uuid": "3ae737b6-9240-422d-8e4e-f3c3e6fef444", + "persistent": true, + "insertionIndex": 9 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_branches_testbranch2-8.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_branches_testbranch2-8.json new file mode 100644 index 000000000..3774f190f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_branches_testbranch2-8.json @@ -0,0 +1,46 @@ +{ + "id": "0d9d8c6a-b1af-4836-ab6e-90649abe9314", + "name": "repos_hub4j-test-org_temp-testmergebranch_branches_testbranch2", + "request": { + "url": "/repos/hub4j-test-org/temp-testMergeBranch/branches/testBranch2", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_temp-testmergebranch_branches_testbranch2-8.json", + "headers": { + "Date": "Tue, 28 Jul 2020 19:54:58 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4988", + "X-RateLimit-Reset": "1595969688", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"a0325b24ee9c35961b6e3bb036ce8150\"", + "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", + "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": "EE13:3784:A6512:D1752:5F208292" + } + }, + "uuid": "0d9d8c6a-b1af-4836-ab6e-90649abe9314", + "persistent": true, + "insertionIndex": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_contents_testbranch1-5.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_contents_testbranch1-5.json new file mode 100644 index 000000000..122afc79a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_contents_testbranch1-5.json @@ -0,0 +1,53 @@ +{ + "id": "d02ffee7-28b2-4cba-96f5-b6c57d48c903", + "name": "repos_hub4j-test-org_temp-testmergebranch_contents_testbranch1", + "request": { + "url": "/repos/hub4j-test-org/temp-testMergeBranch/contents/testBranch1", + "method": "PUT", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"path\":\"testBranch1\",\"message\":\"testBranch1\",\"branch\":\"testBranch1\",\"content\":\"dGVzdEJyYW5jaDE=\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_temp-testmergebranch_contents_testbranch1-5.json", + "headers": { + "Date": "Tue, 28 Jul 2020 19:54:56 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4991", + "X-RateLimit-Reset": "1595969688", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "\"f4dbe8e0bd7a12c64e12252c4cc291f2\"", + "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", + "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": "EE13:3784:A64BD:D16FF:5F20828F" + } + }, + "uuid": "d02ffee7-28b2-4cba-96f5-b6c57d48c903", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_contents_testbranch2-7.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_contents_testbranch2-7.json new file mode 100644 index 000000000..64d256dab --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_contents_testbranch2-7.json @@ -0,0 +1,53 @@ +{ + "id": "078c1c45-bf0f-49d1-99a2-cea8339d2c2d", + "name": "repos_hub4j-test-org_temp-testmergebranch_contents_testbranch2", + "request": { + "url": "/repos/hub4j-test-org/temp-testMergeBranch/contents/testBranch2", + "method": "PUT", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"path\":\"testBranch2\",\"message\":\"testBranch2\",\"branch\":\"testBranch2\",\"content\":\"dGVzdEJyYW5jaDI=\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_temp-testmergebranch_contents_testbranch2-7.json", + "headers": { + "Date": "Tue, 28 Jul 2020 19:54:58 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4989", + "X-RateLimit-Reset": "1595969688", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "\"be8981ef90340e91391c74a9d8665f16\"", + "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", + "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": "EE13:3784:A64EE:D1730:5F208291" + } + }, + "uuid": "078c1c45-bf0f-49d1-99a2-cea8339d2c2d", + "persistent": true, + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_git_refs-4.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_git_refs-4.json new file mode 100644 index 000000000..2fa41fc53 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_git_refs-4.json @@ -0,0 +1,54 @@ +{ + "id": "94200d6b-4b21-4d99-9a46-e653c1b0be14", + "name": "repos_hub4j-test-org_temp-testmergebranch_git_refs", + "request": { + "url": "/repos/hub4j-test-org/temp-testMergeBranch/git/refs", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"ref\":\"refs/heads/testBranch1\",\"sha\":\"688a1c3f8bc67deb767f68560ed8c7350d70d50f\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_temp-testmergebranch_git_refs-4.json", + "headers": { + "Date": "Tue, 28 Jul 2020 19:54:55 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4992", + "X-RateLimit-Reset": "1595969688", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "\"4c1d080908281566b4cbeca9d8febe6c\"", + "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", + "Location": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/refs/heads/testBranch1", + "X-GitHub-Media-Type": "unknown, github.v3", + "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": "EE13:3784:A64A7:D16E2:5F20828E" + } + }, + "uuid": "94200d6b-4b21-4d99-9a46-e653c1b0be14", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_git_refs-6.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_git_refs-6.json new file mode 100644 index 000000000..3ceaa8d55 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_git_refs-6.json @@ -0,0 +1,54 @@ +{ + "id": "031e30e3-6faa-44c2-b70f-3d9ba5bec9d8", + "name": "repos_hub4j-test-org_temp-testmergebranch_git_refs", + "request": { + "url": "/repos/hub4j-test-org/temp-testMergeBranch/git/refs", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"ref\":\"refs/heads/testBranch2\",\"sha\":\"688a1c3f8bc67deb767f68560ed8c7350d70d50f\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_temp-testmergebranch_git_refs-6.json", + "headers": { + "Date": "Tue, 28 Jul 2020 19:54:57 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4990", + "X-RateLimit-Reset": "1595969688", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "\"5da13192d2a1368f382c1593a66e9e6e\"", + "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", + "Location": "https://api.github.com/repos/hub4j-test-org/temp-testMergeBranch/git/refs/heads/testBranch2", + "X-GitHub-Media-Type": "unknown, github.v3", + "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": "EE13:3784:A64DF:D171F:5F208290" + } + }, + "uuid": "031e30e3-6faa-44c2-b70f-3d9ba5bec9d8", + "persistent": true, + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_git_refs_heads_master-3.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_git_refs_heads_master-3.json new file mode 100644 index 000000000..db93ee649 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_git_refs_heads_master-3.json @@ -0,0 +1,48 @@ +{ + "id": "c4e8c18e-a010-46fb-a605-9c4b83b5ee3b", + "name": "repos_hub4j-test-org_temp-testmergebranch_git_refs_heads_master", + "request": { + "url": "/repos/hub4j-test-org/temp-testMergeBranch/git/refs/heads/master", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_temp-testmergebranch_git_refs_heads_master-3.json", + "headers": { + "Date": "Tue, 28 Jul 2020 19:54:54 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4993", + "X-RateLimit-Reset": "1595969687", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"d3b5113fd53fc08d8d171deb0f400daa\"", + "Last-Modified": "Tue, 28 Jul 2020 19:54:53 GMT", + "X-Poll-Interval": "300", + "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", + "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": "EE13:3784:A64A3:D16DC:5F20828E" + } + }, + "uuid": "c4e8c18e-a010-46fb-a605-9c4b83b5ee3b", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_merges-10.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_merges-10.json new file mode 100644 index 000000000..67c8cfe51 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_merges-10.json @@ -0,0 +1,54 @@ +{ + "id": "8f5eb5d0-5204-49ea-bc22-5f4e412f9def", + "name": "repos_hub4j-test-org_temp-testmergebranch_merges", + "request": { + "url": "/repos/hub4j-test-org/temp-testMergeBranch/merges", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"head\":\"testBranch2\",\"commit_message\":\"merging testBranch2\",\"base\":\"testBranch1\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_temp-testmergebranch_merges-10.json", + "headers": { + "Date": "Tue, 28 Jul 2020 19:54:59 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4986", + "X-RateLimit-Reset": "1595969687", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "\"9c320a3cf9eefca809ccbee57e38c84d\"", + "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/hub4j-test-org/temp-testMergeBranch/commits/4cfa1cac01c59db507f550c8c870dac98859b353", + "X-GitHub-Media-Type": "unknown, github.v3", + "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": "EE13:3784:A651D:D176C:5F208292" + } + }, + "uuid": "8f5eb5d0-5204-49ea-bc22-5f4e412f9def", + "persistent": true, + "insertionIndex": 10 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_merges-12.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_merges-12.json new file mode 100644 index 000000000..a458d361e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_merges-12.json @@ -0,0 +1,54 @@ +{ + "id": "4ab064aa-6af9-4a2f-910a-6142b5afd337", + "name": "repos_hub4j-test-org_temp-testmergebranch_merges", + "request": { + "url": "/repos/hub4j-test-org/temp-testMergeBranch/merges", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"head\":\"4cfa1cac01c59db507f550c8c870dac98859b353\",\"commit_message\":\"merging from 4cfa1cac01c59db507f550c8c870dac98859b353\",\"base\":\"master\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_temp-testmergebranch_merges-12.json", + "headers": { + "Date": "Tue, 28 Jul 2020 19:55:01 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4984", + "X-RateLimit-Reset": "1595969688", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "\"23dae4db9910ea437dfc2d6cde7939de\"", + "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/hub4j-test-org/temp-testMergeBranch/commits/223608e290ccc2f8902385528a24b1f7aec92acf", + "X-GitHub-Media-Type": "unknown, github.v3", + "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": "EE13:3784:A6562:D17CA:5F208294" + } + }, + "uuid": "4ab064aa-6af9-4a2f-910a-6142b5afd337", + "persistent": true, + "insertionIndex": 12 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_merges-13.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_merges-13.json new file mode 100644 index 000000000..2bc4b3621 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/repos_hub4j-test-org_temp-testmergebranch_merges-13.json @@ -0,0 +1,48 @@ +{ + "id": "8536e5ba-39e7-4985-b6dd-08abee17696c", + "name": "repos_hub4j-test-org_temp-testmergebranch_merges", + "request": { + "url": "/repos/hub4j-test-org/temp-testMergeBranch/merges", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"head\":\"223608e290ccc2f8902385528a24b1f7aec92acf\",\"commit_message\":\"merging from 4cfa1cac01c59db507f550c8c870dac98859b353\",\"base\":\"master\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 204, + "headers": { + "Date": "Tue, 28 Jul 2020 19:55:01 GMT", + "Server": "GitHub.com", + "Status": "204 No Content", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4983", + "X-RateLimit-Reset": "1595969687", + "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", + "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'", + "Vary": [ + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "X-GitHub-Request-Id": "EE13:3784:A65C4:D182E:5F208295" + } + }, + "uuid": "8536e5ba-39e7-4985-b6dd-08abee17696c", + "persistent": true, + "insertionIndex": 13 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/user-1.json new file mode 100644 index 000000000..c1f95b6c7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchTest/wiremock/testMergeBranch/mappings/user-1.json @@ -0,0 +1,47 @@ +{ + "id": "0e802578-0945-4434-a5de-bf83270366b5", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Date": "Tue, 28 Jul 2020 19:54:48 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4999", + "X-RateLimit-Reset": "1595969688", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"45741c9b5046d0be498127215d6c1db7\"", + "Last-Modified": "Mon, 27 Jul 2020 20:21:05 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", + "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": "EE13:3784:A637F:D157E:5F208287" + } + }, + "uuid": "0e802578-0945-4434-a5de-bf83270366b5", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkRunEvent/__files/repos_codertocat_hello-world_pulls_2-3.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkRunEvent/__files/repos_codertocat_hello-world_pulls_2-3.json new file mode 100644 index 000000000..c2f9a50f4 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkRunEvent/__files/repos_codertocat_hello-world_pulls_2-3.json @@ -0,0 +1,329 @@ +{ + "url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2", + "id": 279147437, + "node_id": "MDExOlB1bGxSZXF1ZXN0Mjc5MTQ3NDM3", + "html_url": "https://github.com/Codertocat/Hello-World/pull/2", + "diff_url": "https://github.com/Codertocat/Hello-World/pull/2.diff", + "patch_url": "https://github.com/Codertocat/Hello-World/pull/2.patch", + "issue_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2", + "number": 2, + "state": "closed", + "locked": false, + "title": "Update the README with new information.", + "user": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "body": "This is a pretty simple change that we need to pull into master.", + "created_at": "2019-05-15T15:20:33Z", + "updated_at": "2020-07-11T10:41:23Z", + "closed_at": "2019-05-15T15:21:18Z", + "merged_at": null, + "merge_commit_sha": "c4295bd74fb0f4fda03689c3df3f2803b658fd85", + "assignee": null, + "assignees": [], + "requested_reviewers": [], + "requested_teams": [], + "labels": [], + "milestone": null, + "draft": false, + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/commits", + "review_comments_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/comments", + "review_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2/comments", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/ec26c3e57ca3a959ca5aad62de7213c562f8c821", + "head": { + "label": "Codertocat:changes", + "ref": "changes", + "sha": "ec26c3e57ca3a959ca5aad62de7213c562f8c821", + "user": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2020-03-18T18:23:11Z", + "pushed_at": "2019-05-15T15:20:57Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 1, + "stargazers_count": 4, + "watchers_count": 4, + "language": "Ruby", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 2, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 1, + "license": null, + "forks": 2, + "open_issues": 1, + "watchers": 4, + "default_branch": "master" + } + }, + "base": { + "label": "Codertocat:master", + "ref": "master", + "sha": "f95f852bd8fca8fcc58a9a2d6c842781e32a215e", + "user": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2020-03-18T18:23:11Z", + "pushed_at": "2019-05-15T15:20:57Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 1, + "stargazers_count": 4, + "watchers_count": 4, + "language": "Ruby", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 2, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 1, + "license": null, + "forks": 2, + "open_issues": 1, + "watchers": 4, + "default_branch": "master" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2" + }, + "html": { + "href": "https://github.com/Codertocat/Hello-World/pull/2" + }, + "issue": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/issues/2" + }, + "comments": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/issues/2/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/statuses/ec26c3e57ca3a959ca5aad62de7213c562f8c821" + } + }, + "author_association": "OWNER", + "active_lock_reason": null, + "merged": false, + "mergeable": true, + "rebaseable": false, + "mergeable_state": "clean", + "merged_by": null, + "comments": 2, + "review_comments": 3, + "maintainer_can_modify": false, + "commits": 1, + "additions": 1, + "deletions": 1, + "changed_files": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkRunEvent/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkRunEvent/__files/user-1.json new file mode 100644 index 000000000..ab7a3f404 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkRunEvent/__files/user-1.json @@ -0,0 +1,46 @@ +{ + "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": null, + "twitter_username": "bitwiseman", + "public_repos": 197, + "public_gists": 7, + "followers": 164, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2020-07-30T20:38:23Z", + "private_gists": 19, + "total_private_repos": 13, + "owned_private_repos": 0, + "disk_usage": 33700, + "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/GHEventPayloadTest/wiremock/checkRunEvent/__files/users_codertocat-2.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkRunEvent/__files/users_codertocat-2.json new file mode 100644 index 000000000..5c9453c4b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkRunEvent/__files/users_codertocat-2.json @@ -0,0 +1,34 @@ +{ + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false, + "name": "Codertocat", + "company": null, + "blog": "", + "location": "Octoverse", + "email": null, + "hireable": null, + "bio": "⚡️ ☕️ ", + "twitter_username": null, + "public_repos": 3, + "public_gists": 0, + "followers": 38, + "following": 0, + "created_at": "2016-08-15T03:51:49Z", + "updated_at": "2020-05-25T00:39:05Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkRunEvent/mappings/repos_codertocat_hello-world_pulls_2-3.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkRunEvent/mappings/repos_codertocat_hello-world_pulls_2-3.json new file mode 100644 index 000000000..93152212b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkRunEvent/mappings/repos_codertocat_hello-world_pulls_2-3.json @@ -0,0 +1,46 @@ +{ + "id": "abca14dd-149a-458c-8aa6-a774c620cc44", + "name": "repos_codertocat_hello-world_pulls_2", + "request": { + "url": "/repos/Codertocat/Hello-World/pulls/2", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.shadow-cat-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_codertocat_hello-world_pulls_2-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Fri, 31 Jul 2020 21:47:31 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4980", + "X-RateLimit-Reset": "1596235134", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"6f504844c60099cd7bf7576af481d6b8\"", + "Last-Modified": "Sat, 11 Jul 2020 10:41:23 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": "github.v3; param=shadow-cat-preview; format=json", + "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": "F660:5BE7:14CF46:300F25:5F249173" + } + }, + "uuid": "abca14dd-149a-458c-8aa6-a774c620cc44", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkRunEvent/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkRunEvent/mappings/user-1.json new file mode 100644 index 000000000..da2d9cc24 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkRunEvent/mappings/user-1.json @@ -0,0 +1,46 @@ +{ + "id": "7311a2f2-a7f7-45a8-bd1b-8eaa4dd986d5", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Fri, 31 Jul 2020 21:47:31 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4982", + "X-RateLimit-Reset": "1596235134", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"fd90864a27d8465275943fa60d303b11\"", + "Last-Modified": "Thu, 30 Jul 2020 20:38:23 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", + "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": "F660:5BE7:14CF24:300ED5:5F249173" + } + }, + "uuid": "7311a2f2-a7f7-45a8-bd1b-8eaa4dd986d5", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkRunEvent/mappings/users_codertocat-2.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkRunEvent/mappings/users_codertocat-2.json new file mode 100644 index 000000000..efb210c26 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkRunEvent/mappings/users_codertocat-2.json @@ -0,0 +1,46 @@ +{ + "id": "dda0acac-03c9-444c-8bca-8054f499937e", + "name": "users_codertocat", + "request": { + "url": "/users/Codertocat", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "users_codertocat-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Fri, 31 Jul 2020 21:47:31 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4981", + "X-RateLimit-Reset": "1596235134", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"d13752bbc4a282a7318b1ee3e52f041e\"", + "Last-Modified": "Mon, 25 May 2020 00:39:05 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", + "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": "F660:5BE7:14CF3D:300EDF:5F249173" + } + }, + "uuid": "dda0acac-03c9-444c-8bca-8054f499937e", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkSuiteEvent/__files/repos_codertocat_hello-world_pulls_2-3.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkSuiteEvent/__files/repos_codertocat_hello-world_pulls_2-3.json new file mode 100644 index 000000000..c2f9a50f4 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkSuiteEvent/__files/repos_codertocat_hello-world_pulls_2-3.json @@ -0,0 +1,329 @@ +{ + "url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2", + "id": 279147437, + "node_id": "MDExOlB1bGxSZXF1ZXN0Mjc5MTQ3NDM3", + "html_url": "https://github.com/Codertocat/Hello-World/pull/2", + "diff_url": "https://github.com/Codertocat/Hello-World/pull/2.diff", + "patch_url": "https://github.com/Codertocat/Hello-World/pull/2.patch", + "issue_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2", + "number": 2, + "state": "closed", + "locked": false, + "title": "Update the README with new information.", + "user": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "body": "This is a pretty simple change that we need to pull into master.", + "created_at": "2019-05-15T15:20:33Z", + "updated_at": "2020-07-11T10:41:23Z", + "closed_at": "2019-05-15T15:21:18Z", + "merged_at": null, + "merge_commit_sha": "c4295bd74fb0f4fda03689c3df3f2803b658fd85", + "assignee": null, + "assignees": [], + "requested_reviewers": [], + "requested_teams": [], + "labels": [], + "milestone": null, + "draft": false, + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/commits", + "review_comments_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/comments", + "review_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2/comments", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/ec26c3e57ca3a959ca5aad62de7213c562f8c821", + "head": { + "label": "Codertocat:changes", + "ref": "changes", + "sha": "ec26c3e57ca3a959ca5aad62de7213c562f8c821", + "user": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2020-03-18T18:23:11Z", + "pushed_at": "2019-05-15T15:20:57Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 1, + "stargazers_count": 4, + "watchers_count": 4, + "language": "Ruby", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 2, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 1, + "license": null, + "forks": 2, + "open_issues": 1, + "watchers": 4, + "default_branch": "master" + } + }, + "base": { + "label": "Codertocat:master", + "ref": "master", + "sha": "f95f852bd8fca8fcc58a9a2d6c842781e32a215e", + "user": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2020-03-18T18:23:11Z", + "pushed_at": "2019-05-15T15:20:57Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 1, + "stargazers_count": 4, + "watchers_count": 4, + "language": "Ruby", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 2, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 1, + "license": null, + "forks": 2, + "open_issues": 1, + "watchers": 4, + "default_branch": "master" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2" + }, + "html": { + "href": "https://github.com/Codertocat/Hello-World/pull/2" + }, + "issue": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/issues/2" + }, + "comments": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/issues/2/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/statuses/ec26c3e57ca3a959ca5aad62de7213c562f8c821" + } + }, + "author_association": "OWNER", + "active_lock_reason": null, + "merged": false, + "mergeable": true, + "rebaseable": false, + "mergeable_state": "clean", + "merged_by": null, + "comments": 2, + "review_comments": 3, + "maintainer_can_modify": false, + "commits": 1, + "additions": 1, + "deletions": 1, + "changed_files": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkSuiteEvent/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkSuiteEvent/__files/user-1.json new file mode 100644 index 000000000..ab7a3f404 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkSuiteEvent/__files/user-1.json @@ -0,0 +1,46 @@ +{ + "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": null, + "twitter_username": "bitwiseman", + "public_repos": 197, + "public_gists": 7, + "followers": 164, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2020-07-30T20:38:23Z", + "private_gists": 19, + "total_private_repos": 13, + "owned_private_repos": 0, + "disk_usage": 33700, + "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/GHEventPayloadTest/wiremock/checkSuiteEvent/__files/users_codertocat-2.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkSuiteEvent/__files/users_codertocat-2.json new file mode 100644 index 000000000..5c9453c4b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkSuiteEvent/__files/users_codertocat-2.json @@ -0,0 +1,34 @@ +{ + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false, + "name": "Codertocat", + "company": null, + "blog": "", + "location": "Octoverse", + "email": null, + "hireable": null, + "bio": "⚡️ ☕️ ", + "twitter_username": null, + "public_repos": 3, + "public_gists": 0, + "followers": 38, + "following": 0, + "created_at": "2016-08-15T03:51:49Z", + "updated_at": "2020-05-25T00:39:05Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkSuiteEvent/mappings/repos_codertocat_hello-world_pulls_2-3.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkSuiteEvent/mappings/repos_codertocat_hello-world_pulls_2-3.json new file mode 100644 index 000000000..2ecbc42e0 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkSuiteEvent/mappings/repos_codertocat_hello-world_pulls_2-3.json @@ -0,0 +1,46 @@ +{ + "id": "450042f9-be05-4c1c-bc1b-3e8a86a99d81", + "name": "repos_codertocat_hello-world_pulls_2", + "request": { + "url": "/repos/Codertocat/Hello-World/pulls/2", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.shadow-cat-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_codertocat_hello-world_pulls_2-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Fri, 31 Jul 2020 21:49:55 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4962", + "X-RateLimit-Reset": "1596235134", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"6f504844c60099cd7bf7576af481d6b8\"", + "Last-Modified": "Sat, 11 Jul 2020 10:41:23 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": "github.v3; param=shadow-cat-preview; format=json", + "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": "F8DC:246B:17C38A:34AD28:5F249203" + } + }, + "uuid": "450042f9-be05-4c1c-bc1b-3e8a86a99d81", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkSuiteEvent/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkSuiteEvent/mappings/user-1.json new file mode 100644 index 000000000..3d794489e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkSuiteEvent/mappings/user-1.json @@ -0,0 +1,46 @@ +{ + "id": "bb8d640f-470f-49f1-8e0e-1a0181669592", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Fri, 31 Jul 2020 21:49:54 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4964", + "X-RateLimit-Reset": "1596235133", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"fd90864a27d8465275943fa60d303b11\"", + "Last-Modified": "Thu, 30 Jul 2020 20:38:23 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", + "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": "F8DC:246B:17C362:34ACEF:5F249202" + } + }, + "uuid": "bb8d640f-470f-49f1-8e0e-1a0181669592", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkSuiteEvent/mappings/users_codertocat-2.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkSuiteEvent/mappings/users_codertocat-2.json new file mode 100644 index 000000000..02c4a8d10 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/checkSuiteEvent/mappings/users_codertocat-2.json @@ -0,0 +1,46 @@ +{ + "id": "b29d95ea-fbcf-4efe-84d1-14f729bb4322", + "name": "users_codertocat", + "request": { + "url": "/users/Codertocat", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "users_codertocat-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Fri, 31 Jul 2020 21:49:55 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4963", + "X-RateLimit-Reset": "1596235134", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"d13752bbc4a282a7318b1ee3e52f041e\"", + "Last-Modified": "Mon, 25 May 2020 00:39:05 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", + "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": "F8DC:246B:17C37F:34ACF6:5F249202" + } + }, + "uuid": "b29d95ea-fbcf-4efe-84d1-14f729bb4322", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/orgs_hub4j-test-org-2.json new file mode 100644 index 000000000..6484d6f64 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/orgs_hub4j-test-org-2.json @@ -0,0 +1,47 @@ +{ + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/hub4j-test-org", + "repos_url": "https://api.github.com/orgs/hub4j-test-org/repos", + "events_url": "https://api.github.com/orgs/hub4j-test-org/events", + "hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks", + "issues_url": "https://api.github.com/orgs/hub4j-test-org/issues", + "members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": "Hub4j Test Org Description (this could be null or blank too)", + "name": "Hub4j Test Org Name (this could be null or blank too)", + "company": null, + "blog": "https://hub4j.url.io/could/be/null", + "location": "Hub4j Test Org Location (this could be null or blank too)", + "email": "hub4jtestorgemail@could.be.null.com", + "twitter_username": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 12, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/hub4j-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2020-06-04T05:56:10Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 148, + "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": 10000, + "filled_seats": 19, + "seats": 3 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api-3.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api-3.json new file mode 100644 index 000000000..7139e7245 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api-3.json @@ -0,0 +1,332 @@ +{ + "id": 206888201, + "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", + "name": "github-api", + "full_name": "hub4j-test-org/github-api", + "private": false, + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/github-api", + "description": "Resetting", + "fork": true, + "url": "https://api.github.com/repos/hub4j-test-org/github-api", + "forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments", + "created_at": "2019-09-06T23:26:04Z", + "updated_at": "2020-06-10T23:27:59Z", + "pushed_at": "2020-07-27T20:44:55Z", + "git_url": "git://github.com/hub4j-test-org/github-api.git", + "ssh_url": "git@github.com:hub4j-test-org/github-api.git", + "clone_url": "https://github.com/hub4j-test-org/github-api.git", + "svn_url": "https://github.com/hub4j-test-org/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 19050, + "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": 5, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 0, + "open_issues": 5, + "watchers": 0, + "default_branch": "master", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "delete_branch_on_merge": false, + "organization": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "parent": { + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "hub4j/github-api", + "private": false, + "owner": { + "login": "hub4j", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j", + "html_url": "https://github.com/hub4j", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "repos_url": "https://api.github.com/users/hub4j/repos", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/hub4j/github-api", + "forks_url": "https://api.github.com/repos/hub4j/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2020-07-27T20:33:12Z", + "pushed_at": "2020-07-27T20:38:26Z", + "git_url": "git://github.com/hub4j/github-api.git", + "ssh_url": "git@github.com:hub4j/github-api.git", + "clone_url": "https://github.com/hub4j/github-api.git", + "svn_url": "https://github.com/hub4j/github-api", + "homepage": "https://github-api.kohsuke.org/", + "size": 24664, + "stargazers_count": 687, + "watchers_count": 687, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 493, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 70, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 493, + "open_issues": 70, + "watchers": 687, + "default_branch": "master" + }, + "source": { + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "hub4j/github-api", + "private": false, + "owner": { + "login": "hub4j", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j", + "html_url": "https://github.com/hub4j", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "repos_url": "https://api.github.com/users/hub4j/repos", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/hub4j/github-api", + "forks_url": "https://api.github.com/repos/hub4j/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2020-07-27T20:33:12Z", + "pushed_at": "2020-07-27T20:38:26Z", + "git_url": "git://github.com/hub4j/github-api.git", + "ssh_url": "git@github.com:hub4j/github-api.git", + "clone_url": "https://github.com/hub4j/github-api.git", + "svn_url": "https://github.com/hub4j/github-api", + "homepage": "https://github-api.kohsuke.org/", + "size": 24664, + "stargazers_count": 687, + "watchers_count": 687, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 493, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 70, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 493, + "open_issues": 70, + "watchers": 687, + "default_branch": "master" + }, + "network_count": 493, + "subscribers_count": 0 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api_issues_370-7.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api_issues_370-7.json new file mode 100644 index 000000000..8c25db2c7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api_issues_370-7.json @@ -0,0 +1,89 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/370", + "repository_url": "https://api.github.com/repos/hub4j-test-org/github-api", + "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/370/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/370/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/370/events", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/370", + "id": 666574306, + "node_id": "MDExOlB1bGxSZXF1ZXN0NDU3MzkzNjM4", + "number": 370, + "title": "testUnsetMilestoneFromPullRequest", + "user": { + "login": "gastaldi", + "id": 54133, + "node_id": "MDQ6VXNlcjU0MTMz", + "avatar_url": "https://avatars1.githubusercontent.com/u/54133?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gastaldi", + "html_url": "https://github.com/gastaldi", + "followers_url": "https://api.github.com/users/gastaldi/followers", + "following_url": "https://api.github.com/users/gastaldi/following{/other_user}", + "gists_url": "https://api.github.com/users/gastaldi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gastaldi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gastaldi/subscriptions", + "organizations_url": "https://api.github.com/users/gastaldi/orgs", + "repos_url": "https://api.github.com/users/gastaldi/repos", + "events_url": "https://api.github.com/users/gastaldi/events{/privacy}", + "received_events_url": "https://api.github.com/users/gastaldi/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones/1", + "html_url": "https://github.com/hub4j-test-org/github-api/milestone/1", + "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones/1/labels", + "id": 5704738, + "node_id": "MDk6TWlsZXN0b25lNTcwNDczOA==", + "number": 1, + "title": "Unset Test Milestone", + "description": "For testUnsetMilestone", + "creator": { + "login": "gastaldi", + "id": 54133, + "node_id": "MDQ6VXNlcjU0MTMz", + "avatar_url": "https://avatars1.githubusercontent.com/u/54133?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gastaldi", + "html_url": "https://github.com/gastaldi", + "followers_url": "https://api.github.com/users/gastaldi/followers", + "following_url": "https://api.github.com/users/gastaldi/following{/other_user}", + "gists_url": "https://api.github.com/users/gastaldi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gastaldi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gastaldi/subscriptions", + "organizations_url": "https://api.github.com/users/gastaldi/orgs", + "repos_url": "https://api.github.com/users/gastaldi/repos", + "events_url": "https://api.github.com/users/gastaldi/events{/privacy}", + "received_events_url": "https://api.github.com/users/gastaldi/received_events", + "type": "User", + "site_admin": false + }, + "open_issues": 1, + "closed_issues": 0, + "state": "open", + "created_at": "2020-07-27T20:46:36Z", + "updated_at": "2020-07-27T20:46:38Z", + "due_on": null, + "closed_at": null + }, + "comments": 0, + "created_at": "2020-07-27T20:46:37Z", + "updated_at": "2020-07-27T20:46:38Z", + "closed_at": null, + "author_association": "MEMBER", + "active_lock_reason": null, + "pull_request": { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/370", + "diff_url": "https://github.com/hub4j-test-org/github-api/pull/370.diff", + "patch_url": "https://github.com/hub4j-test-org/github-api/pull/370.patch" + }, + "body": "## test", + "closed_by": null, + "performed_via_github_app": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api_issues_370-9.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api_issues_370-9.json new file mode 100644 index 000000000..d97e81240 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api_issues_370-9.json @@ -0,0 +1,53 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/370", + "repository_url": "https://api.github.com/repos/hub4j-test-org/github-api", + "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/370/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/370/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/370/events", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/370", + "id": 666574306, + "node_id": "MDExOlB1bGxSZXF1ZXN0NDU3MzkzNjM4", + "number": 370, + "title": "testUnsetMilestoneFromPullRequest", + "user": { + "login": "gastaldi", + "id": 54133, + "node_id": "MDQ6VXNlcjU0MTMz", + "avatar_url": "https://avatars1.githubusercontent.com/u/54133?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gastaldi", + "html_url": "https://github.com/gastaldi", + "followers_url": "https://api.github.com/users/gastaldi/followers", + "following_url": "https://api.github.com/users/gastaldi/following{/other_user}", + "gists_url": "https://api.github.com/users/gastaldi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gastaldi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gastaldi/subscriptions", + "organizations_url": "https://api.github.com/users/gastaldi/orgs", + "repos_url": "https://api.github.com/users/gastaldi/repos", + "events_url": "https://api.github.com/users/gastaldi/events{/privacy}", + "received_events_url": "https://api.github.com/users/gastaldi/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2020-07-27T20:46:37Z", + "updated_at": "2020-07-27T20:46:39Z", + "closed_at": null, + "author_association": "MEMBER", + "active_lock_reason": null, + "pull_request": { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/370", + "diff_url": "https://github.com/hub4j-test-org/github-api/pull/370.diff", + "patch_url": "https://github.com/hub4j-test-org/github-api/pull/370.patch" + }, + "body": "## test", + "closed_by": null, + "performed_via_github_app": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api_milestones-4.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api_milestones-4.json new file mode 100644 index 000000000..b1f3ec8ae --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api_milestones-4.json @@ -0,0 +1,37 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones/1", + "html_url": "https://github.com/hub4j-test-org/github-api/milestone/1", + "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones/1/labels", + "id": 5704738, + "node_id": "MDk6TWlsZXN0b25lNTcwNDczOA==", + "number": 1, + "title": "Unset Test Milestone", + "description": "For testUnsetMilestone", + "creator": { + "login": "gastaldi", + "id": 54133, + "node_id": "MDQ6VXNlcjU0MTMz", + "avatar_url": "https://avatars1.githubusercontent.com/u/54133?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gastaldi", + "html_url": "https://github.com/gastaldi", + "followers_url": "https://api.github.com/users/gastaldi/followers", + "following_url": "https://api.github.com/users/gastaldi/following{/other_user}", + "gists_url": "https://api.github.com/users/gastaldi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gastaldi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gastaldi/subscriptions", + "organizations_url": "https://api.github.com/users/gastaldi/orgs", + "repos_url": "https://api.github.com/users/gastaldi/repos", + "events_url": "https://api.github.com/users/gastaldi/events{/privacy}", + "received_events_url": "https://api.github.com/users/gastaldi/received_events", + "type": "User", + "site_admin": false + }, + "open_issues": 0, + "closed_issues": 0, + "state": "open", + "created_at": "2020-07-27T20:46:36Z", + "updated_at": "2020-07-27T20:46:36Z", + "due_on": null, + "closed_at": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api_pulls-6.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api_pulls-6.json new file mode 100644 index 000000000..84b9d34ed --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api_pulls-6.json @@ -0,0 +1,341 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370", + "id": 457393638, + "node_id": "MDExOlB1bGxSZXF1ZXN0NDU3MzkzNjM4", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/370", + "diff_url": "https://github.com/hub4j-test-org/github-api/pull/370.diff", + "patch_url": "https://github.com/hub4j-test-org/github-api/pull/370.patch", + "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/370", + "number": 370, + "state": "open", + "locked": false, + "title": "testUnsetMilestoneFromPullRequest", + "user": { + "login": "gastaldi", + "id": 54133, + "node_id": "MDQ6VXNlcjU0MTMz", + "avatar_url": "https://avatars1.githubusercontent.com/u/54133?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gastaldi", + "html_url": "https://github.com/gastaldi", + "followers_url": "https://api.github.com/users/gastaldi/followers", + "following_url": "https://api.github.com/users/gastaldi/following{/other_user}", + "gists_url": "https://api.github.com/users/gastaldi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gastaldi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gastaldi/subscriptions", + "organizations_url": "https://api.github.com/users/gastaldi/orgs", + "repos_url": "https://api.github.com/users/gastaldi/repos", + "events_url": "https://api.github.com/users/gastaldi/events{/privacy}", + "received_events_url": "https://api.github.com/users/gastaldi/received_events", + "type": "User", + "site_admin": false + }, + "body": "## test pull request", + "created_at": "2020-07-27T20:46:37Z", + "updated_at": "2020-07-27T20:46:37Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": null, + "assignee": null, + "assignees": [], + "requested_reviewers": [], + "requested_teams": [], + "labels": [], + "milestone": null, + "draft": false, + "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370/commits", + "review_comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370/comments", + "review_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/370/comments", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/1f40fdf4acf1adb246c109c21a22f617e4bd1ca8", + "head": { + "label": "hub4j-test-org:test/stable", + "ref": "test/stable", + "sha": "1f40fdf4acf1adb246c109c21a22f617e4bd1ca8", + "user": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 206888201, + "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", + "name": "github-api", + "full_name": "hub4j-test-org/github-api", + "private": false, + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/github-api", + "description": "Resetting", + "fork": true, + "url": "https://api.github.com/repos/hub4j-test-org/github-api", + "forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments", + "created_at": "2019-09-06T23:26:04Z", + "updated_at": "2020-06-10T23:27:59Z", + "pushed_at": "2020-07-27T20:44:55Z", + "git_url": "git://github.com/hub4j-test-org/github-api.git", + "ssh_url": "git@github.com:hub4j-test-org/github-api.git", + "clone_url": "https://github.com/hub4j-test-org/github-api.git", + "svn_url": "https://github.com/hub4j-test-org/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 19050, + "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": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 0, + "open_issues": 6, + "watchers": 0, + "default_branch": "master" + } + }, + "base": { + "label": "hub4j-test-org:master", + "ref": "master", + "sha": "8051615eff597f4e49f4f47625e6fc2b49f26bfc", + "user": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 206888201, + "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", + "name": "github-api", + "full_name": "hub4j-test-org/github-api", + "private": false, + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/github-api", + "description": "Resetting", + "fork": true, + "url": "https://api.github.com/repos/hub4j-test-org/github-api", + "forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments", + "created_at": "2019-09-06T23:26:04Z", + "updated_at": "2020-06-10T23:27:59Z", + "pushed_at": "2020-07-27T20:44:55Z", + "git_url": "git://github.com/hub4j-test-org/github-api.git", + "ssh_url": "git@github.com:hub4j-test-org/github-api.git", + "clone_url": "https://github.com/hub4j-test-org/github-api.git", + "svn_url": "https://github.com/hub4j-test-org/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 19050, + "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": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 0, + "open_issues": 6, + "watchers": 0, + "default_branch": "master" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370" + }, + "html": { + "href": "https://github.com/hub4j-test-org/github-api/pull/370" + }, + "issue": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/issues/370" + }, + "comments": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/issues/370/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/1f40fdf4acf1adb246c109c21a22f617e4bd1ca8" + } + }, + "author_association": "MEMBER", + "active_lock_reason": null, + "merged": false, + "mergeable": null, + "rebaseable": null, + "mergeable_state": "unknown", + "merged_by": null, + "comments": 0, + "review_comments": 0, + "maintainer_can_modify": false, + "commits": 2, + "additions": 2, + "deletions": 1, + "changed_files": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api_pulls_370-10.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api_pulls_370-10.json new file mode 100644 index 000000000..483406500 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api_pulls_370-10.json @@ -0,0 +1,341 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370", + "id": 457393638, + "node_id": "MDExOlB1bGxSZXF1ZXN0NDU3MzkzNjM4", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/370", + "diff_url": "https://github.com/hub4j-test-org/github-api/pull/370.diff", + "patch_url": "https://github.com/hub4j-test-org/github-api/pull/370.patch", + "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/370", + "number": 370, + "state": "open", + "locked": false, + "title": "testUnsetMilestoneFromPullRequest", + "user": { + "login": "gastaldi", + "id": 54133, + "node_id": "MDQ6VXNlcjU0MTMz", + "avatar_url": "https://avatars1.githubusercontent.com/u/54133?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gastaldi", + "html_url": "https://github.com/gastaldi", + "followers_url": "https://api.github.com/users/gastaldi/followers", + "following_url": "https://api.github.com/users/gastaldi/following{/other_user}", + "gists_url": "https://api.github.com/users/gastaldi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gastaldi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gastaldi/subscriptions", + "organizations_url": "https://api.github.com/users/gastaldi/orgs", + "repos_url": "https://api.github.com/users/gastaldi/repos", + "events_url": "https://api.github.com/users/gastaldi/events{/privacy}", + "received_events_url": "https://api.github.com/users/gastaldi/received_events", + "type": "User", + "site_admin": false + }, + "body": "## test pull request", + "created_at": "2020-07-27T20:46:37Z", + "updated_at": "2020-07-27T20:46:39Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": "795728d748492989a5a013f69f8dfb6c5d093688", + "assignee": null, + "assignees": [], + "requested_reviewers": [], + "requested_teams": [], + "labels": [], + "milestone": null, + "draft": false, + "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370/commits", + "review_comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370/comments", + "review_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/370/comments", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/1f40fdf4acf1adb246c109c21a22f617e4bd1ca8", + "head": { + "label": "hub4j-test-org:test/stable", + "ref": "test/stable", + "sha": "1f40fdf4acf1adb246c109c21a22f617e4bd1ca8", + "user": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 206888201, + "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", + "name": "github-api", + "full_name": "hub4j-test-org/github-api", + "private": false, + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/github-api", + "description": "Resetting", + "fork": true, + "url": "https://api.github.com/repos/hub4j-test-org/github-api", + "forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments", + "created_at": "2019-09-06T23:26:04Z", + "updated_at": "2020-06-10T23:27:59Z", + "pushed_at": "2020-07-27T20:46:38Z", + "git_url": "git://github.com/hub4j-test-org/github-api.git", + "ssh_url": "git@github.com:hub4j-test-org/github-api.git", + "clone_url": "https://github.com/hub4j-test-org/github-api.git", + "svn_url": "https://github.com/hub4j-test-org/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 19050, + "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": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 0, + "open_issues": 6, + "watchers": 0, + "default_branch": "master" + } + }, + "base": { + "label": "hub4j-test-org:master", + "ref": "master", + "sha": "8051615eff597f4e49f4f47625e6fc2b49f26bfc", + "user": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 206888201, + "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", + "name": "github-api", + "full_name": "hub4j-test-org/github-api", + "private": false, + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/github-api", + "description": "Resetting", + "fork": true, + "url": "https://api.github.com/repos/hub4j-test-org/github-api", + "forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments", + "created_at": "2019-09-06T23:26:04Z", + "updated_at": "2020-06-10T23:27:59Z", + "pushed_at": "2020-07-27T20:46:38Z", + "git_url": "git://github.com/hub4j-test-org/github-api.git", + "ssh_url": "git@github.com:hub4j-test-org/github-api.git", + "clone_url": "https://github.com/hub4j-test-org/github-api.git", + "svn_url": "https://github.com/hub4j-test-org/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 19050, + "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": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 0, + "open_issues": 6, + "watchers": 0, + "default_branch": "master" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370" + }, + "html": { + "href": "https://github.com/hub4j-test-org/github-api/pull/370" + }, + "issue": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/issues/370" + }, + "comments": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/issues/370/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/1f40fdf4acf1adb246c109c21a22f617e4bd1ca8" + } + }, + "author_association": "MEMBER", + "active_lock_reason": null, + "merged": false, + "mergeable": true, + "rebaseable": true, + "mergeable_state": "clean", + "merged_by": null, + "comments": 0, + "review_comments": 0, + "maintainer_can_modify": false, + "commits": 2, + "additions": 2, + "deletions": 1, + "changed_files": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api_pulls_370-8.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api_pulls_370-8.json new file mode 100644 index 000000000..f185ab025 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/repos_hub4j-test-org_github-api_pulls_370-8.json @@ -0,0 +1,377 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370", + "id": 457393638, + "node_id": "MDExOlB1bGxSZXF1ZXN0NDU3MzkzNjM4", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/370", + "diff_url": "https://github.com/hub4j-test-org/github-api/pull/370.diff", + "patch_url": "https://github.com/hub4j-test-org/github-api/pull/370.patch", + "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/370", + "number": 370, + "state": "open", + "locked": false, + "title": "testUnsetMilestoneFromPullRequest", + "user": { + "login": "gastaldi", + "id": 54133, + "node_id": "MDQ6VXNlcjU0MTMz", + "avatar_url": "https://avatars1.githubusercontent.com/u/54133?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gastaldi", + "html_url": "https://github.com/gastaldi", + "followers_url": "https://api.github.com/users/gastaldi/followers", + "following_url": "https://api.github.com/users/gastaldi/following{/other_user}", + "gists_url": "https://api.github.com/users/gastaldi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gastaldi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gastaldi/subscriptions", + "organizations_url": "https://api.github.com/users/gastaldi/orgs", + "repos_url": "https://api.github.com/users/gastaldi/repos", + "events_url": "https://api.github.com/users/gastaldi/events{/privacy}", + "received_events_url": "https://api.github.com/users/gastaldi/received_events", + "type": "User", + "site_admin": false + }, + "body": "## test pull request", + "created_at": "2020-07-27T20:46:37Z", + "updated_at": "2020-07-27T20:46:38Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": "795728d748492989a5a013f69f8dfb6c5d093688", + "assignee": null, + "assignees": [], + "requested_reviewers": [], + "requested_teams": [], + "labels": [], + "milestone": { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones/1", + "html_url": "https://github.com/hub4j-test-org/github-api/milestone/1", + "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones/1/labels", + "id": 5704738, + "node_id": "MDk6TWlsZXN0b25lNTcwNDczOA==", + "number": 1, + "title": "Unset Test Milestone", + "description": "For testUnsetMilestone", + "creator": { + "login": "gastaldi", + "id": 54133, + "node_id": "MDQ6VXNlcjU0MTMz", + "avatar_url": "https://avatars1.githubusercontent.com/u/54133?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gastaldi", + "html_url": "https://github.com/gastaldi", + "followers_url": "https://api.github.com/users/gastaldi/followers", + "following_url": "https://api.github.com/users/gastaldi/following{/other_user}", + "gists_url": "https://api.github.com/users/gastaldi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gastaldi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gastaldi/subscriptions", + "organizations_url": "https://api.github.com/users/gastaldi/orgs", + "repos_url": "https://api.github.com/users/gastaldi/repos", + "events_url": "https://api.github.com/users/gastaldi/events{/privacy}", + "received_events_url": "https://api.github.com/users/gastaldi/received_events", + "type": "User", + "site_admin": false + }, + "open_issues": 1, + "closed_issues": 0, + "state": "open", + "created_at": "2020-07-27T20:46:36Z", + "updated_at": "2020-07-27T20:46:38Z", + "due_on": null, + "closed_at": null + }, + "draft": false, + "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370/commits", + "review_comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370/comments", + "review_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/370/comments", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/1f40fdf4acf1adb246c109c21a22f617e4bd1ca8", + "head": { + "label": "hub4j-test-org:test/stable", + "ref": "test/stable", + "sha": "1f40fdf4acf1adb246c109c21a22f617e4bd1ca8", + "user": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 206888201, + "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", + "name": "github-api", + "full_name": "hub4j-test-org/github-api", + "private": false, + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/github-api", + "description": "Resetting", + "fork": true, + "url": "https://api.github.com/repos/hub4j-test-org/github-api", + "forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments", + "created_at": "2019-09-06T23:26:04Z", + "updated_at": "2020-06-10T23:27:59Z", + "pushed_at": "2020-07-27T20:46:38Z", + "git_url": "git://github.com/hub4j-test-org/github-api.git", + "ssh_url": "git@github.com:hub4j-test-org/github-api.git", + "clone_url": "https://github.com/hub4j-test-org/github-api.git", + "svn_url": "https://github.com/hub4j-test-org/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 19050, + "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": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 0, + "open_issues": 6, + "watchers": 0, + "default_branch": "master" + } + }, + "base": { + "label": "hub4j-test-org:master", + "ref": "master", + "sha": "8051615eff597f4e49f4f47625e6fc2b49f26bfc", + "user": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 206888201, + "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", + "name": "github-api", + "full_name": "hub4j-test-org/github-api", + "private": false, + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/github-api", + "description": "Resetting", + "fork": true, + "url": "https://api.github.com/repos/hub4j-test-org/github-api", + "forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments", + "created_at": "2019-09-06T23:26:04Z", + "updated_at": "2020-06-10T23:27:59Z", + "pushed_at": "2020-07-27T20:46:38Z", + "git_url": "git://github.com/hub4j-test-org/github-api.git", + "ssh_url": "git@github.com:hub4j-test-org/github-api.git", + "clone_url": "https://github.com/hub4j-test-org/github-api.git", + "svn_url": "https://github.com/hub4j-test-org/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 19050, + "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": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 0, + "open_issues": 6, + "watchers": 0, + "default_branch": "master" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370" + }, + "html": { + "href": "https://github.com/hub4j-test-org/github-api/pull/370" + }, + "issue": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/issues/370" + }, + "comments": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/issues/370/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/1f40fdf4acf1adb246c109c21a22f617e4bd1ca8" + } + }, + "author_association": "MEMBER", + "active_lock_reason": null, + "merged": false, + "mergeable": true, + "rebaseable": true, + "mergeable_state": "unstable", + "merged_by": null, + "comments": 0, + "review_comments": 0, + "maintainer_can_modify": false, + "commits": 2, + "additions": 2, + "deletions": 1, + "changed_files": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/user-1.json new file mode 100644 index 000000000..440a7f7c4 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/__files/user-1.json @@ -0,0 +1,46 @@ +{ + "login": "gastaldi", + "id": 54133, + "node_id": "MDQ6VXNlcjU0MTMz", + "avatar_url": "https://avatars1.githubusercontent.com/u/54133?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gastaldi", + "html_url": "https://github.com/gastaldi", + "followers_url": "https://api.github.com/users/gastaldi/followers", + "following_url": "https://api.github.com/users/gastaldi/following{/other_user}", + "gists_url": "https://api.github.com/users/gastaldi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gastaldi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gastaldi/subscriptions", + "organizations_url": "https://api.github.com/users/gastaldi/orgs", + "repos_url": "https://api.github.com/users/gastaldi/repos", + "events_url": "https://api.github.com/users/gastaldi/events{/privacy}", + "received_events_url": "https://api.github.com/users/gastaldi/received_events", + "type": "User", + "site_admin": false, + "name": "George Gastaldi", + "company": "Red Hat, Inc.", + "blog": "http://gastaldi.wordpress.com", + "location": "Joinville, Santa Catarina, Brasil", + "email": "gegastaldi@gmail.com", + "hireable": null, + "bio": "\r\n Principal Software Engineer @ Red Hat and JBoss Forge Project Lead. Works on @quarkusio. Enjoys submitting PRs to interesting projects\r\n", + "twitter_username": "gegastaldi", + "public_repos": 240, + "public_gists": 88, + "followers": 159, + "following": 82, + "created_at": "2009-02-13T01:52:01Z", + "updated_at": "2020-07-25T18:35:06Z", + "private_gists": 3, + "total_private_repos": 1, + "owned_private_repos": 1, + "disk_usage": 1017411, + "collaborators": 1, + "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/testUnsetMilestoneFromPullRequest/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/orgs_hub4j-test-org-2.json new file mode 100644 index 000000000..c5a326446 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/orgs_hub4j-test-org-2.json @@ -0,0 +1,47 @@ +{ + "id": "afe33575-a0c9-4198-902d-809acfb0b120", + "name": "orgs_hub4j-test-org", + "request": { + "url": "/orgs/hub4j-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org-2.json", + "headers": { + "Date": "Mon, 27 Jul 2020 20:46:35 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4912", + "X-RateLimit-Reset": "1595885200", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"f27774969913a0bbb98565b381b8554c\"", + "Last-Modified": "Thu, 04 Jun 2020 05:56:10 GMT", + "X-OAuth-Scopes": "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, read:packages, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "X-GitHub-Media-Type": "unknown, github.v3", + "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": "C730:4712:B35F3A:FFAA95:5F1F3D29" + } + }, + "uuid": "afe33575-a0c9-4198-902d-809acfb0b120", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api-3.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api-3.json new file mode 100644 index 000000000..f43dea7e9 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api-3.json @@ -0,0 +1,50 @@ +{ + "id": "2d00f122-be4d-45aa-ac91-895fd6d73034", + "name": "repos_hub4j-test-org_github-api", + "request": { + "url": "/repos/hub4j-test-org/github-api", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api-3.json", + "headers": { + "Date": "Mon, 27 Jul 2020 20:46:35 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4911", + "X-RateLimit-Reset": "1595885200", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"5a80625b81785acf0855c7e7cb5bf574\"", + "Last-Modified": "Wed, 10 Jun 2020 23:27:59 GMT", + "X-OAuth-Scopes": "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, read:packages, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "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": "C730:4712:B35F49:FFAB1B:5F1F3D2B" + } + }, + "uuid": "2d00f122-be4d-45aa-ac91-895fd6d73034", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-github-api", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-repos-hub4j-test-org-github-api-2", + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api_issues_370-7.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api_issues_370-7.json new file mode 100644 index 000000000..1843d7ec2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api_issues_370-7.json @@ -0,0 +1,53 @@ +{ + "id": "13604596-6767-4020-ada1-41c8845b84ec", + "name": "repos_hub4j-test-org_github-api_issues_370", + "request": { + "url": "/repos/hub4j-test-org/github-api/issues/370", + "method": "PATCH", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"milestone\":1}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api_issues_370-7.json", + "headers": { + "Date": "Mon, 27 Jul 2020 20:46:38 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4907", + "X-RateLimit-Reset": "1595885200", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"544abb953c4396649474c93cdcd7cd9e\"", + "X-OAuth-Scopes": "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, read:packages, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "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": "C730:4712:B35FDB:FFABE8:5F1F3D2E" + } + }, + "uuid": "13604596-6767-4020-ada1-41c8845b84ec", + "persistent": true, + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api_issues_370-9.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api_issues_370-9.json new file mode 100644 index 000000000..822233078 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api_issues_370-9.json @@ -0,0 +1,53 @@ +{ + "id": "268cc36e-ea6d-4ac0-b0de-32ad29b875be", + "name": "repos_hub4j-test-org_github-api_issues_370", + "request": { + "url": "/repos/hub4j-test-org/github-api/issues/370", + "method": "PATCH", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"milestone\":null}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api_issues_370-9.json", + "headers": { + "Date": "Mon, 27 Jul 2020 20:46:39 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4905", + "X-RateLimit-Reset": "1595885200", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"082bf0ebf930b58e337ce3e16b10a17a\"", + "X-OAuth-Scopes": "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, read:packages, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "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": "C730:4712:B36033:FFAC62:5F1F3D2F" + } + }, + "uuid": "268cc36e-ea6d-4ac0-b0de-32ad29b875be", + "persistent": true, + "insertionIndex": 9 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api_milestones-4.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api_milestones-4.json new file mode 100644 index 000000000..bac32a35f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api_milestones-4.json @@ -0,0 +1,54 @@ +{ + "id": "375956e0-764e-4e6c-bfbe-aed30d86ee89", + "name": "repos_hub4j-test-org_github-api_milestones", + "request": { + "url": "/repos/hub4j-test-org/github-api/milestones", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"description\":\"For testUnsetMilestone\",\"title\":\"Unset Test Milestone\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_github-api_milestones-4.json", + "headers": { + "Date": "Mon, 27 Jul 2020 20:46:36 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4910", + "X-RateLimit-Reset": "1595885200", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "\"e78bfb2829de0438b07cf0deac4248ee\"", + "X-OAuth-Scopes": "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, read:packages, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "", + "Location": "https://api.github.com/repos/hub4j-test-org/github-api/milestones/1", + "X-GitHub-Media-Type": "unknown, github.v3", + "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": "C730:4712:B35F63:FFAB35:5F1F3D2B" + } + }, + "uuid": "375956e0-764e-4e6c-bfbe-aed30d86ee89", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api_pulls-6.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api_pulls-6.json new file mode 100644 index 000000000..58dc555a5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api_pulls-6.json @@ -0,0 +1,54 @@ +{ + "id": "db2a1014-e671-4483-9d30-2df3a54375a0", + "name": "repos_hub4j-test-org_github-api_pulls", + "request": { + "url": "/repos/hub4j-test-org/github-api/pulls", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.shadow-cat-preview+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"head\":\"test/stable\",\"draft\":false,\"maintainer_can_modify\":true,\"title\":\"testUnsetMilestoneFromPullRequest\",\"body\":\"## test pull request\",\"base\":\"master\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_github-api_pulls-6.json", + "headers": { + "Date": "Mon, 27 Jul 2020 20:46:37 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4908", + "X-RateLimit-Reset": "1595885200", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "\"2ec7235639804a6c052a39e6e626113c\"", + "X-OAuth-Scopes": "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, read:packages, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "", + "Location": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/370", + "X-GitHub-Media-Type": "github.v3; param=shadow-cat-preview; format=json", + "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": "C730:4712:B35F8F:FFAB82:5F1F3D2C" + } + }, + "uuid": "db2a1014-e671-4483-9d30-2df3a54375a0", + "persistent": true, + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api_pulls_370-10.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api_pulls_370-10.json new file mode 100644 index 000000000..15a47cc12 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api_pulls_370-10.json @@ -0,0 +1,49 @@ +{ + "id": "478c6283-eb61-4042-9a7f-4d2ef92dbea9", + "name": "repos_hub4j-test-org_github-api_pulls_370", + "request": { + "url": "/repos/hub4j-test-org/github-api/pulls/370", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.shadow-cat-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api_pulls_370-10.json", + "headers": { + "Date": "Mon, 27 Jul 2020 20:46:40 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4904", + "X-RateLimit-Reset": "1595885201", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"dc598bdd247bce695a5e72bb0fb7ac7e\"", + "Last-Modified": "Mon, 27 Jul 2020 20:46:39 GMT", + "X-OAuth-Scopes": "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, read:packages, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "github.v3; param=shadow-cat-preview; format=json", + "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": "C730:4712:B36054:FFAC99:5F1F3D2F" + } + }, + "uuid": "478c6283-eb61-4042-9a7f-4d2ef92dbea9", + "persistent": true, + "scenarioName": "scenario-2-repos-hub4j-test-org-github-api-pulls-370", + "requiredScenarioState": "scenario-2-repos-hub4j-test-org-github-api-pulls-370-2", + "insertionIndex": 10 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api_pulls_370-8.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api_pulls_370-8.json new file mode 100644 index 000000000..d38daaf49 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/repos_hub4j-test-org_github-api_pulls_370-8.json @@ -0,0 +1,50 @@ +{ + "id": "1ba351e6-d00e-4ed3-a556-bd05b72ca730", + "name": "repos_hub4j-test-org_github-api_pulls_370", + "request": { + "url": "/repos/hub4j-test-org/github-api/pulls/370", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.shadow-cat-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api_pulls_370-8.json", + "headers": { + "Date": "Mon, 27 Jul 2020 20:46:39 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4906", + "X-RateLimit-Reset": "1595885201", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"e9298b8c24777fd7070e52317f8c7376\"", + "Last-Modified": "Mon, 27 Jul 2020 20:46:38 GMT", + "X-OAuth-Scopes": "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, read:packages, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "github.v3; param=shadow-cat-preview; format=json", + "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": "C730:4712:B3600F:FFAC31:5F1F3D2E" + } + }, + "uuid": "1ba351e6-d00e-4ed3-a556-bd05b72ca730", + "persistent": true, + "scenarioName": "scenario-2-repos-hub4j-test-org-github-api-pulls-370", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-2-repos-hub4j-test-org-github-api-pulls-370-2", + "insertionIndex": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/user-1.json new file mode 100644 index 000000000..b9a76bf88 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHMilestoneTest/wiremock/testUnsetMilestoneFromPullRequest/mappings/user-1.json @@ -0,0 +1,47 @@ +{ + "id": "4587fa84-6600-4da2-9e22-583dfbfe78ef", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Date": "Mon, 27 Jul 2020 20:46:33 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4917", + "X-RateLimit-Reset": "1595885200", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"5b4936e5deab228c37153468ddf2554b\"", + "Last-Modified": "Sat, 25 Jul 2020 18:35:06 GMT", + "X-OAuth-Scopes": "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, read:packages, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "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": "C730:4712:B35ED8:FFAA81:5F1F3D29" + } + }, + "uuid": "4587fa84-6600-4da2-9e22-583dfbfe78ef", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file