From 9daa0df31145cb65b8dea10d3e8bc04d4a8c1128 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Wed, 10 Jun 2020 19:28:31 -0700 Subject: [PATCH] Modify getRef() changes to be compatible with older GHE versions Fixes #844 Fixes #794 --- .../java/org/kohsuke/github/GHRepository.java | 28 +++++++++-- .../org/kohsuke/github/GHRepositoryTest.java | 8 +--- ...insci_jenkins_git_refs_heads_master-3.json | 2 +- ...4j_github-api_git_refs_heads_master-3.json | 2 +- ...rg_github-api_git_refs_heads_master-4.json | 2 +- ...rg_github-api_git_refs_heads_master-4.json | 2 +- .../getRef/__files/orgs_hub4j-test-org-2.json | 14 ++++-- .../repos_hub4j-test-org_github-api-3.json | 46 +++++++++---------- ...st-org_github-api_git_refs_heads_gh-7.json | 12 +++++ ...github-api_git_refs_heads_gh-pages-4.json} | 0 ...github-api_git_refs_heads_gh-pages-5.json} | 0 ...github-api_git_refs_heads_gh-pages-6.json} | 0 .../wiremock/getRef/__files/user-1.json | 9 ++-- .../mappings/orgs_hub4j-test-org-2.json | 16 +++---- .../repos_hub4j-test-org_github-api-3.json | 16 +++---- ...t-org_github-api_git_refs_heads_gh-7.json} | 31 ++++++++----- ...github-api_git_refs_heads_gh-pages-4.json} | 24 +++++----- ...github-api_git_refs_heads_gh-pages-5.json} | 26 +++++------ ...github-api_git_refs_heads_gh-pages-6.json} | 24 +++++----- ...test-org_github-api_git_refs_headz-8.json} | 18 ++++---- .../wiremock/getRef/mappings/user-1.json | 16 +++---- ...eebuildertest_git_refs_heads_master-3.json | 2 +- ...eebuildertest_git_refs_heads_master-3.json | 2 +- ..._refs_heads_test_content_ref_cache-10.json | 2 +- ..._refs_heads_test_content_ref_cache-11.json | 2 +- ..._refs_heads_test_content_ref_cache-13.json | 2 +- ..._refs_heads_test_content_ref_cache-14.json | 2 +- ..._refs_heads_test_content_ref_cache-15.json | 2 +- ...t_refs_heads_test_content_ref_cache-7.json | 2 +- ...t_refs_heads_test_content_ref_cache-8.json | 2 +- ...api_git_refs_heads_test_unmergeable-5.json | 2 +- 31 files changed, 179 insertions(+), 137 deletions(-) create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/repos_hub4j-test-org_github-api_git_refs_heads_gh-7.json rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/{repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-4.json => repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-4.json} (100%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/{repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-5.json => repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-5.json} (100%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/{repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-6.json => repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-6.json} (100%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/{repos_hub4j-test-org_github-api_git_ref_heads_gh-7.json => repos_hub4j-test-org_github-api_git_refs_heads_gh-7.json} (53%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/{repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-4.json => repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-4.json} (70%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/{repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-5.json => repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-5.json} (69%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/{repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-6.json => repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-6.json} (69%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/{repos_hub4j-test-org_github-api_git_ref_headz-8.json => repos_hub4j-test-org_github-api_git_refs_headz-8.json} (71%) diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index 9d579b7438..9812a16b1f 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.JsonMappingException; import com.infradna.tool.bridge_method_injector.WithBridgeMethods; import edu.umd.cs.findbugs.annotations.CheckForNull; import edu.umd.cs.findbugs.annotations.NonNull; @@ -1589,10 +1590,29 @@ public GHRef getRef(String refName) throws IOException { refName = refName.replaceFirst("refs/", ""); } - return root.createRequest() - .withUrlPath(getApiTailUrl(String.format("git/ref/%s", refName))) - .fetch(GHRef.class) - .wrap(root); + // We would expect this to use `git/ref/%s` but some versions of GHE seem to not support it + // Instead use `git/refs/%s` and check the result actually matches the ref + GHRef result = null; + try { + result = root.createRequest() + .withUrlPath(getApiTailUrl(String.format("git/refs/%s", refName))) + .fetch(GHRef.class) + .wrap(root); + } catch (IOException e) { + // If the parse exception is due to the above returning an array instead of a single ref + // that means the individual ref did not exist + if (!(e.getCause() instanceof JsonMappingException)) { + throw e; + } + } + + // Verify that the ref returned is the one requested + if (result == null || !result.getRef().equals("refs/" + refName)) { + throw new GHFileNotFoundException(String.format("git/refs/%s", refName) + + " {\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/git/refs/#get-a-reference\"}"); + } + return result; + } /** diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index 13f5d4c732..b7df6d69f3 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java @@ -429,7 +429,6 @@ public void getRefsEmptyTags() throws Exception { assertThat(e.getMessage(), containsString( "{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/git/refs/#get-a-reference\"}")); - assertThat(e.getCause(), instanceOf(FileNotFoundException.class)); } } @@ -474,7 +473,6 @@ public void listRefs() throws Exception { assertThat(e.getMessage(), containsString( "{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/git/refs/#get-a-reference\"}")); - assertThat(e.getCause(), instanceOf(FileNotFoundException.class)); } } @@ -505,8 +503,7 @@ public void getRef() throws Exception { assertThat(e, instanceOf(GHFileNotFoundException.class)); assertThat(e.getMessage(), containsString( - "{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/git/refs/#get-a-single-reference\"}")); - assertThat(e.getCause(), instanceOf(FileNotFoundException.class)); + "{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/git/refs/#get-a-reference\"}")); } // git/refs/headz @@ -517,8 +514,7 @@ public void getRef() throws Exception { assertThat(e, instanceOf(GHFileNotFoundException.class)); assertThat(e.getMessage(), containsString( - "{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/git/refs/#get-a-single-reference\"}")); - assertThat(e.getCause(), instanceOf(FileNotFoundException.class)); + "{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/git/refs/#get-a-reference\"}")); } } diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRef/mappings/repos_jenkinsci_jenkins_git_refs_heads_master-3.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRef/mappings/repos_jenkinsci_jenkins_git_refs_heads_master-3.json index 239511435e..29b0ac76ba 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRef/mappings/repos_jenkinsci_jenkins_git_refs_heads_master-3.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRef/mappings/repos_jenkinsci_jenkins_git_refs_heads_master-3.json @@ -2,7 +2,7 @@ "id": "257aa346-b2fa-4808-a587-ce26a6859bf7", "name": "repos_jenkinsci_jenkins_git_refs_heads_master", "request": { - "url": "/repos/jenkinsci/jenkins/git/ref/heads/master", + "url": "/repos/jenkinsci/jenkins/git/refs/heads/master", "method": "GET", "headers": { "Accept": { diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/pushToFork/mappings/repos_hub4j_github-api_git_refs_heads_master-3.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/pushToFork/mappings/repos_hub4j_github-api_git_refs_heads_master-3.json index 364ba12092..28e044682a 100644 --- a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/pushToFork/mappings/repos_hub4j_github-api_git_refs_heads_master-3.json +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/wiremock/pushToFork/mappings/repos_hub4j_github-api_git_refs_heads_master-3.json @@ -2,7 +2,7 @@ "id": "79569c1e-168b-4816-930b-1ac370e164b9", "name": "repos_hub4j_github-api_git_refs_heads_master", "request": { - "url": "/repos/hub4j/github-api/git/ref/heads/master", + "url": "/repos/hub4j/github-api/git/refs/heads/master", "method": "GET", "headers": { "Accept": { diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/squashMerge/mappings/repos_hub4j-test-org_github-api_git_refs_heads_master-4.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/squashMerge/mappings/repos_hub4j-test-org_github-api_git_refs_heads_master-4.json index 36f7316165..006d3d89df 100644 --- a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/squashMerge/mappings/repos_hub4j-test-org_github-api_git_refs_heads_master-4.json +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/squashMerge/mappings/repos_hub4j-test-org_github-api_git_refs_heads_master-4.json @@ -2,7 +2,7 @@ "id": "7bfa9315-c036-44af-bc3c-1e639325a8fe", "name": "repos_hub4j-test-org_github-api_git_refs_heads_master", "request": { - "url": "/repos/hub4j-test-org/github-api/git/ref/heads/master", + "url": "/repos/hub4j-test-org/github-api/git/refs/heads/master", "method": "GET", "headers": { "Accept": { diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/updateContentSquashMerge/mappings/repos_hub4j-test-org_github-api_git_refs_heads_master-4.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/updateContentSquashMerge/mappings/repos_hub4j-test-org_github-api_git_refs_heads_master-4.json index 2691b9f10e..48acce4758 100644 --- a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/updateContentSquashMerge/mappings/repos_hub4j-test-org_github-api_git_refs_heads_master-4.json +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/updateContentSquashMerge/mappings/repos_hub4j-test-org_github-api_git_refs_heads_master-4.json @@ -2,7 +2,7 @@ "id": "fa77be60-4286-4610-bff6-3ab0bac74b1f", "name": "repos_hub4j-test-org_github-api_git_refs_heads_master", "request": { - "url": "/repos/hub4j-test-org/github-api/git/ref/heads/master", + "url": "/repos/hub4j-test-org/github-api/git/refs/heads/master", "method": "GET", "headers": { "Accept": { diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/orgs_hub4j-test-org-2.json index e079133f20..b115ab2ee6 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/orgs_hub4j-test-org-2.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/orgs_hub4j-test-org-2.json @@ -10,17 +10,23 @@ "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": null, + "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": 15, + "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-05-15T15:14:14Z", + "updated_at": "2020-06-04T05:56:10Z", "type": "Organization", "total_private_repos": 0, "owned_private_repos": 0, @@ -35,7 +41,7 @@ "name": "free", "space": 976562499, "private_repos": 10000, - "filled_seats": 17, + "filled_seats": 18, "seats": 3 } } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/repos_hub4j-test-org_github-api-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/repos_hub4j-test-org_github-api-3.json index 6de56ef741..eccd7b85d2 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/repos_hub4j-test-org_github-api-3.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/repos_hub4j-test-org_github-api-3.json @@ -25,7 +25,7 @@ "site_admin": false }, "html_url": "https://github.com/hub4j-test-org/github-api", - "description": "Tricky", + "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", @@ -65,7 +65,7 @@ "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-01-16T21:22:56Z", + "updated_at": "2020-06-10T23:27:59Z", "pushed_at": "2020-05-20T16:22:43Z", "git_url": "git://github.com/hub4j-test-org/github-api.git", "ssh_url": "git@github.com:hub4j-test-org/github-api.git", @@ -194,27 +194,27 @@ "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-05-20T22:54:46Z", - "pushed_at": "2020-05-20T20:24:04Z", + "updated_at": "2020-06-11T00:43:49Z", + "pushed_at": "2020-06-11T00:30:13Z", "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": 23100, - "stargazers_count": 656, - "watchers_count": 656, + "size": 24124, + "stargazers_count": 669, + "watchers_count": 669, "language": "Java", "has_issues": true, "has_projects": true, "has_downloads": true, "has_wiki": true, "has_pages": true, - "forks_count": 478, + "forks_count": 481, "mirror_url": null, "archived": false, "disabled": false, - "open_issues_count": 67, + "open_issues_count": 64, "license": { "key": "mit", "name": "MIT License", @@ -222,9 +222,9 @@ "url": "https://api.github.com/licenses/mit", "node_id": "MDc6TGljZW5zZTEz" }, - "forks": 478, - "open_issues": 67, - "watchers": 656, + "forks": 481, + "open_issues": 64, + "watchers": 669, "default_branch": "master" }, "source": { @@ -294,27 +294,27 @@ "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-05-20T22:54:46Z", - "pushed_at": "2020-05-20T20:24:04Z", + "updated_at": "2020-06-11T00:43:49Z", + "pushed_at": "2020-06-11T00:30:13Z", "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": 23100, - "stargazers_count": 656, - "watchers_count": 656, + "size": 24124, + "stargazers_count": 669, + "watchers_count": 669, "language": "Java", "has_issues": true, "has_projects": true, "has_downloads": true, "has_wiki": true, "has_pages": true, - "forks_count": 478, + "forks_count": 481, "mirror_url": null, "archived": false, "disabled": false, - "open_issues_count": 67, + "open_issues_count": 64, "license": { "key": "mit", "name": "MIT License", @@ -322,11 +322,11 @@ "url": "https://api.github.com/licenses/mit", "node_id": "MDc6TGljZW5zZTEz" }, - "forks": 478, - "open_issues": 67, - "watchers": 656, + "forks": 481, + "open_issues": 64, + "watchers": 669, "default_branch": "master" }, - "network_count": 478, + "network_count": 481, "subscribers_count": 0 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/repos_hub4j-test-org_github-api_git_refs_heads_gh-7.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/repos_hub4j-test-org_github-api_git_refs_heads_gh-7.json new file mode 100644 index 0000000000..a63324fb61 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/repos_hub4j-test-org_github-api_git_refs_heads_gh-7.json @@ -0,0 +1,12 @@ +[ + { + "ref": "refs/heads/gh-pages", + "node_id": "MDM6UmVmMjA2ODg4MjAxOnJlZnMvaGVhZHMvZ2gtcGFnZXM=", + "url": "https://api.github.com/repos/hub4j-test-org/github-api/git/refs/heads/gh-pages", + "object": { + "sha": "4e64a0f9c3d561ab8587d2f7b03074b8745b5943", + "type": "commit", + "url": "https://api.github.com/repos/hub4j-test-org/github-api/git/commits/4e64a0f9c3d561ab8587d2f7b03074b8745b5943" + } + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-4.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-4.json similarity index 100% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-4.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-4.json diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-5.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-5.json similarity index 100% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-5.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-5.json diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-6.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-6.json similarity index 100% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-6.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-6.json diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/user-1.json index e4fc4d8657..c0e6797da6 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/user-1.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/__files/user-1.json @@ -24,16 +24,17 @@ "email": "bitwiseman@gmail.com", "hireable": null, "bio": "https://twitter.com/bitwiseman", - "public_repos": 183, + "twitter_username": null, + "public_repos": 187, "public_gists": 7, - "followers": 159, + "followers": 161, "following": 9, "created_at": "2012-07-11T20:38:33Z", - "updated_at": "2020-05-20T16:02:42Z", + "updated_at": "2020-05-29T18:24:44Z", "private_gists": 19, "total_private_repos": 12, "owned_private_repos": 0, - "disk_usage": 33697, + "disk_usage": 33700, "collaborators": 0, "two_factor_authentication": true, "plan": { diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/orgs_hub4j-test-org-2.json index 6e0f796aa0..b6d257e699 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/orgs_hub4j-test-org-2.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/orgs_hub4j-test-org-2.json @@ -1,5 +1,5 @@ { - "id": "865b9946-8a74-4402-971b-ecd97db742e3", + "id": "93493987-1167-42ca-9ce1-668c3697700e", "name": "orgs_hub4j-test-org", "request": { "url": "/orgs/hub4j-test-org", @@ -14,21 +14,21 @@ "status": 200, "bodyFileName": "orgs_hub4j-test-org-2.json", "headers": { - "Date": "Wed, 20 May 2020 23:48:56 GMT", + "Date": "Thu, 11 Jun 2020 02:20:47 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4952", - "X-RateLimit-Reset": "1590020148", + "X-RateLimit-Remaining": "4917", + "X-RateLimit-Reset": "1591843209", "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/\"de5da0827fbd925dd0dde9d2d6a85f45\"", - "Last-Modified": "Fri, 15 May 2020 15:14:14 GMT", + "ETag": "W/\"6bd323dd4ab2a01dae2464621246c3cd\"", + "Last-Modified": "Thu, 04 Jun 2020 05:56:10 GMT", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", "X-GitHub-Media-Type": "unknown, github.v3", @@ -38,10 +38,10 @@ "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": "EFC6:5429:F7742:126AA2:5EC5C1E7" + "X-GitHub-Request-Id": "E5B0:5D6A:3A9A6:47E29:5EE194FE" } }, - "uuid": "865b9946-8a74-4402-971b-ecd97db742e3", + "uuid": "93493987-1167-42ca-9ce1-668c3697700e", "persistent": true, "insertionIndex": 2 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api-3.json index 1ddb2d64b8..9f77b1be1d 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api-3.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api-3.json @@ -1,5 +1,5 @@ { - "id": "80b0a475-ed72-40f2-b701-80f014fd077a", + "id": "188ff38b-cbda-4bdb-82f0-3dcd5eb20d72", "name": "repos_hub4j-test-org_github-api", "request": { "url": "/repos/hub4j-test-org/github-api", @@ -14,21 +14,21 @@ "status": 200, "bodyFileName": "repos_hub4j-test-org_github-api-3.json", "headers": { - "Date": "Wed, 20 May 2020 23:48:56 GMT", + "Date": "Thu, 11 Jun 2020 02:20:47 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4951", - "X-RateLimit-Reset": "1590020148", + "X-RateLimit-Remaining": "4916", + "X-RateLimit-Reset": "1591843209", "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/\"312e4c361c7730b8cbae6f074a82248e\"", - "Last-Modified": "Thu, 16 Jan 2020 21:22:56 GMT", + "ETag": "W/\"d50e09a217754b7ffeb7a6aa7219af30\"", + "Last-Modified": "Wed, 10 Jun 2020 23:27:59 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", @@ -38,10 +38,10 @@ "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": "EFC6:5429:F774E:126AC9:5EC5C1E8" + "X-GitHub-Request-Id": "E5B0:5D6A:3A9A9:47E30:5EE194FF" } }, - "uuid": "80b0a475-ed72-40f2-b701-80f014fd077a", + "uuid": "188ff38b-cbda-4bdb-82f0-3dcd5eb20d72", "persistent": true, "insertionIndex": 3 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_ref_heads_gh-7.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_refs_heads_gh-7.json similarity index 53% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_ref_heads_gh-7.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_refs_heads_gh-7.json index a7ffd52662..52d5fc1cfc 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_ref_heads_gh-7.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_refs_heads_gh-7.json @@ -1,8 +1,8 @@ { - "id": "019cbb3c-4211-4212-b6ff-fc2a505e4dd0", - "name": "repos_hub4j-test-org_github-api_git_ref_heads_gh", + "id": "36ac5bc2-71dc-416c-a8fd-c50a5b01f124", + "name": "repos_hub4j-test-org_github-api_git_refs_heads_gh", "request": { - "url": "/repos/hub4j-test-org/github-api/git/ref/heads/gh", + "url": "/repos/hub4j-test-org/github-api/git/refs/heads/gh", "method": "GET", "headers": { "Accept": { @@ -11,16 +11,24 @@ } }, "response": { - "status": 404, - "body": "{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/git/refs/#get-a-single-reference\"}", + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api_git_refs_heads_gh-7.json", "headers": { - "Date": "Wed, 20 May 2020 23:48:57 GMT", + "Date": "Thu, 11 Jun 2020 02:20:48 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", - "Status": "404 Not Found", + "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4947", - "X-RateLimit-Reset": "1590020149", + "X-RateLimit-Remaining": "4912", + "X-RateLimit-Reset": "1591843209", + "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/\"aa03a3ba0ec8d4fa83439f8d4390fa91\"", + "Last-Modified": "Wed, 10 Jun 2020 23:27:59 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", @@ -31,11 +39,10 @@ "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", - "X-GitHub-Request-Id": "EFC6:5429:F7779:126AFA:5EC5C1E9" + "X-GitHub-Request-Id": "E5B0:5D6A:3A9B3:47E3D:5EE194FF" } }, - "uuid": "019cbb3c-4211-4212-b6ff-fc2a505e4dd0", + "uuid": "36ac5bc2-71dc-416c-a8fd-c50a5b01f124", "persistent": true, "insertionIndex": 7 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-4.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-4.json similarity index 70% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-4.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-4.json index d0aa194ccf..bacc8e70c3 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-4.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-4.json @@ -1,8 +1,8 @@ { - "id": "e38154ef-90ed-42ea-92ca-5ad59a314955", - "name": "repos_hub4j-test-org_github-api_git_ref_heads_gh-pages", + "id": "22eb7d57-2a85-4948-9103-c4c76c279d00", + "name": "repos_hub4j-test-org_github-api_git_refs_heads_gh-pages", "request": { - "url": "/repos/hub4j-test-org/github-api/git/ref/heads/gh-pages", + "url": "/repos/hub4j-test-org/github-api/git/refs/heads/gh-pages", "method": "GET", "headers": { "Accept": { @@ -12,15 +12,15 @@ }, "response": { "status": 200, - "bodyFileName": "repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-4.json", + "bodyFileName": "repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-4.json", "headers": { - "Date": "Wed, 20 May 2020 23:48:56 GMT", + "Date": "Thu, 11 Jun 2020 02:20:47 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4950", - "X-RateLimit-Reset": "1590020148", + "X-RateLimit-Remaining": "4915", + "X-RateLimit-Reset": "1591843209", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", @@ -28,7 +28,7 @@ "Accept-Encoding" ], "ETag": "W/\"1ab7db857cfacd7c05c569c1a71ecc8c\"", - "Last-Modified": "Thu, 16 Jan 2020 21:22:56 GMT", + "Last-Modified": "Wed, 10 Jun 2020 23:27:59 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", @@ -39,13 +39,13 @@ "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": "EFC6:5429:F775F:126ADA:5EC5C1E8" + "X-GitHub-Request-Id": "E5B0:5D6A:3A9AC:47E36:5EE194FF" } }, - "uuid": "e38154ef-90ed-42ea-92ca-5ad59a314955", + "uuid": "22eb7d57-2a85-4948-9103-c4c76c279d00", "persistent": true, - "scenarioName": "scenario-1-repos-hub4j-test-org-github-api-git-ref-heads-gh-pages", + "scenarioName": "scenario-1-repos-hub4j-test-org-github-api-git-refs-heads-gh-pages", "requiredScenarioState": "Started", - "newScenarioState": "scenario-1-repos-hub4j-test-org-github-api-git-ref-heads-gh-pages-2", + "newScenarioState": "scenario-1-repos-hub4j-test-org-github-api-git-refs-heads-gh-pages-2", "insertionIndex": 4 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-5.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-5.json similarity index 69% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-5.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-5.json index c2c9457224..ead0613ff0 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-5.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-5.json @@ -1,8 +1,8 @@ { - "id": "38be8b43-c558-4cc3-8376-a66dffd3a5a5", - "name": "repos_hub4j-test-org_github-api_git_ref_heads_gh-pages", + "id": "23d1cd4c-65f0-40df-a643-05747c020b68", + "name": "repos_hub4j-test-org_github-api_git_refs_heads_gh-pages", "request": { - "url": "/repos/hub4j-test-org/github-api/git/ref/heads/gh-pages", + "url": "/repos/hub4j-test-org/github-api/git/refs/heads/gh-pages", "method": "GET", "headers": { "Accept": { @@ -12,15 +12,15 @@ }, "response": { "status": 200, - "bodyFileName": "repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-5.json", + "bodyFileName": "repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-5.json", "headers": { - "Date": "Wed, 20 May 2020 23:48:57 GMT", + "Date": "Thu, 11 Jun 2020 02:20:47 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4949", - "X-RateLimit-Reset": "1590020149", + "X-RateLimit-Remaining": "4914", + "X-RateLimit-Reset": "1591843209", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", @@ -28,7 +28,7 @@ "Accept-Encoding" ], "ETag": "W/\"1ab7db857cfacd7c05c569c1a71ecc8c\"", - "Last-Modified": "Thu, 16 Jan 2020 21:22:56 GMT", + "Last-Modified": "Wed, 10 Jun 2020 23:27:59 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", @@ -39,13 +39,13 @@ "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": "EFC6:5429:F7768:126AEA:5EC5C1E8" + "X-GitHub-Request-Id": "E5B0:5D6A:3A9AE:47E38:5EE194FF" } }, - "uuid": "38be8b43-c558-4cc3-8376-a66dffd3a5a5", + "uuid": "23d1cd4c-65f0-40df-a643-05747c020b68", "persistent": true, - "scenarioName": "scenario-1-repos-hub4j-test-org-github-api-git-ref-heads-gh-pages", - "requiredScenarioState": "scenario-1-repos-hub4j-test-org-github-api-git-ref-heads-gh-pages-2", - "newScenarioState": "scenario-1-repos-hub4j-test-org-github-api-git-ref-heads-gh-pages-3", + "scenarioName": "scenario-1-repos-hub4j-test-org-github-api-git-refs-heads-gh-pages", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-github-api-git-refs-heads-gh-pages-2", + "newScenarioState": "scenario-1-repos-hub4j-test-org-github-api-git-refs-heads-gh-pages-3", "insertionIndex": 5 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-6.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-6.json similarity index 69% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-6.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-6.json index 702784e4e4..4f1ba0038e 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-6.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-6.json @@ -1,8 +1,8 @@ { - "id": "25200487-a320-4002-a107-fc566f1d1e0f", - "name": "repos_hub4j-test-org_github-api_git_ref_heads_gh-pages", + "id": "1c47539d-60b6-4e6b-9b5e-8e452c51f30d", + "name": "repos_hub4j-test-org_github-api_git_refs_heads_gh-pages", "request": { - "url": "/repos/hub4j-test-org/github-api/git/ref/heads/gh-pages", + "url": "/repos/hub4j-test-org/github-api/git/refs/heads/gh-pages", "method": "GET", "headers": { "Accept": { @@ -12,15 +12,15 @@ }, "response": { "status": 200, - "bodyFileName": "repos_hub4j-test-org_github-api_git_ref_heads_gh-pages-6.json", + "bodyFileName": "repos_hub4j-test-org_github-api_git_refs_heads_gh-pages-6.json", "headers": { - "Date": "Wed, 20 May 2020 23:48:57 GMT", + "Date": "Thu, 11 Jun 2020 02:20:47 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4948", - "X-RateLimit-Reset": "1590020149", + "X-RateLimit-Remaining": "4913", + "X-RateLimit-Reset": "1591843208", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", @@ -28,7 +28,7 @@ "Accept-Encoding" ], "ETag": "W/\"1ab7db857cfacd7c05c569c1a71ecc8c\"", - "Last-Modified": "Thu, 16 Jan 2020 21:22:56 GMT", + "Last-Modified": "Wed, 10 Jun 2020 23:27:59 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", @@ -39,12 +39,12 @@ "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": "EFC6:5429:F7772:126AF3:5EC5C1E9" + "X-GitHub-Request-Id": "E5B0:5D6A:3A9B0:47E3A:5EE194FF" } }, - "uuid": "25200487-a320-4002-a107-fc566f1d1e0f", + "uuid": "1c47539d-60b6-4e6b-9b5e-8e452c51f30d", "persistent": true, - "scenarioName": "scenario-1-repos-hub4j-test-org-github-api-git-ref-heads-gh-pages", - "requiredScenarioState": "scenario-1-repos-hub4j-test-org-github-api-git-ref-heads-gh-pages-3", + "scenarioName": "scenario-1-repos-hub4j-test-org-github-api-git-refs-heads-gh-pages", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-github-api-git-refs-heads-gh-pages-3", "insertionIndex": 6 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_ref_headz-8.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_refs_headz-8.json similarity index 71% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_ref_headz-8.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_refs_headz-8.json index a0f0a874e3..85dba67c60 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_ref_headz-8.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/repos_hub4j-test-org_github-api_git_refs_headz-8.json @@ -1,8 +1,8 @@ { - "id": "17df7473-29a2-4ad8-ba4d-ed5d5ff2305e", - "name": "repos_hub4j-test-org_github-api_git_ref_headz", + "id": "0c8adeaf-a96e-48d1-b26e-9f574fd2c460", + "name": "repos_hub4j-test-org_github-api_git_refs_headz", "request": { - "url": "/repos/hub4j-test-org/github-api/git/ref/headz", + "url": "/repos/hub4j-test-org/github-api/git/refs/headz", "method": "GET", "headers": { "Accept": { @@ -12,15 +12,15 @@ }, "response": { "status": 404, - "body": "{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/git/refs/#get-a-single-reference\"}", + "body": "{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/git/refs/#get-a-reference\"}", "headers": { - "Date": "Wed, 20 May 2020 23:48:57 GMT", + "Date": "Thu, 11 Jun 2020 02:23:04 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "404 Not Found", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4946", - "X-RateLimit-Reset": "1590020148", + "X-RateLimit-Remaining": "4910", + "X-RateLimit-Reset": "1591843208", "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", @@ -32,10 +32,10 @@ "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", "Vary": "Accept-Encoding, Accept, X-Requested-With", - "X-GitHub-Request-Id": "EFC6:5429:F7782:126B08:5EC5C1E9" + "X-GitHub-Request-Id": "E7FA:3E37:A63FE:C9582:5EE19588" } }, - "uuid": "17df7473-29a2-4ad8-ba4d-ed5d5ff2305e", + "uuid": "0c8adeaf-a96e-48d1-b26e-9f574fd2c460", "persistent": true, "insertionIndex": 8 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/user-1.json index 7082756e48..87daae7732 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/user-1.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getRef/mappings/user-1.json @@ -1,5 +1,5 @@ { - "id": "f0825cda-4a2e-408c-8fbb-9358156de5b1", + "id": "2e0ec4a0-360f-4f45-8f35-01e219d1a781", "name": "user", "request": { "url": "/user", @@ -14,21 +14,21 @@ "status": 200, "bodyFileName": "user-1.json", "headers": { - "Date": "Wed, 20 May 2020 23:48:55 GMT", + "Date": "Thu, 11 Jun 2020 02:20:46 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4954", - "X-RateLimit-Reset": "1590020148", + "X-RateLimit-Remaining": "4919", + "X-RateLimit-Reset": "1591843209", "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/\"12430b620554d3ea3486a0972ee86bc8\"", - "Last-Modified": "Wed, 20 May 2020 16:02:42 GMT", + "ETag": "W/\"7e41c6c634de27b9ab8f4e95a42d16db\"", + "Last-Modified": "Fri, 29 May 2020 18:24:44 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", @@ -38,10 +38,10 @@ "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": "EFC6:5429:F7724:126A9A:5EC5C1E7" + "X-GitHub-Request-Id": "E5B0:5D6A:3A9A0:47E26:5EE194FE" } }, - "uuid": "f0825cda-4a2e-408c-8fbb-9358156de5b1", + "uuid": "2e0ec4a0-360f-4f45-8f35-01e219d1a781", "persistent": true, "insertionIndex": 1 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTreeBuilderTest/wiremock/testAdd/mappings/repos_hub4j-test-org_ghtreebuildertest_git_refs_heads_master-3.json b/src/test/resources/org/kohsuke/github/GHTreeBuilderTest/wiremock/testAdd/mappings/repos_hub4j-test-org_ghtreebuildertest_git_refs_heads_master-3.json index 681ee0c94e..d7447a661f 100644 --- a/src/test/resources/org/kohsuke/github/GHTreeBuilderTest/wiremock/testAdd/mappings/repos_hub4j-test-org_ghtreebuildertest_git_refs_heads_master-3.json +++ b/src/test/resources/org/kohsuke/github/GHTreeBuilderTest/wiremock/testAdd/mappings/repos_hub4j-test-org_ghtreebuildertest_git_refs_heads_master-3.json @@ -2,7 +2,7 @@ "id": "add23dfd-74f9-452c-8986-0a80d2f6cbec", "name": "repos_hub4j-test-org_ghtreebuildertest_git_refs_heads_master", "request": { - "url": "/repos/hub4j-test-org/GHTreeBuilderTest/git/ref/heads/master", + "url": "/repos/hub4j-test-org/GHTreeBuilderTest/git/refs/heads/master", "method": "GET", "headers": { "Accept": { diff --git a/src/test/resources/org/kohsuke/github/GHTreeBuilderTest/wiremock/testShaEntry/mappings/repos_hub4j-test-org_ghtreebuildertest_git_refs_heads_master-3.json b/src/test/resources/org/kohsuke/github/GHTreeBuilderTest/wiremock/testShaEntry/mappings/repos_hub4j-test-org_ghtreebuildertest_git_refs_heads_master-3.json index c361654ccc..12e509daa8 100644 --- a/src/test/resources/org/kohsuke/github/GHTreeBuilderTest/wiremock/testShaEntry/mappings/repos_hub4j-test-org_ghtreebuildertest_git_refs_heads_master-3.json +++ b/src/test/resources/org/kohsuke/github/GHTreeBuilderTest/wiremock/testShaEntry/mappings/repos_hub4j-test-org_ghtreebuildertest_git_refs_heads_master-3.json @@ -2,7 +2,7 @@ "id": "683572f1-512c-4a6f-b766-7447ed7908fe", "name": "repos_hub4j-test-org_ghtreebuildertest_git_refs_heads_master", "request": { - "url": "/repos/hub4j-test-org/GHTreeBuilderTest/git/ref/heads/master", + "url": "/repos/hub4j-test-org/GHTreeBuilderTest/git/refs/heads/master", "method": "GET", "headers": { "Accept": { diff --git a/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-10.json b/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-10.json index 1d73b6fead..9792976882 100644 --- a/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-10.json +++ b/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-10.json @@ -2,7 +2,7 @@ "id": "05226cf4-38e0-4cd4-82b6-b18cc720267b", "name": "repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache", "request": { - "url": "/repos/hub4j-test-org/github-api/git/ref/heads/test/content_ref_cache", + "url": "/repos/hub4j-test-org/github-api/git/refs/heads/test/content_ref_cache", "method": "GET", "headers": { "Cache-Control": { diff --git a/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-11.json b/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-11.json index 7800964d8a..8a3ed8e089 100644 --- a/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-11.json +++ b/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-11.json @@ -2,7 +2,7 @@ "id": "6e1f9524-6de8-4bb4-bad7-babdf5bb6015", "name": "repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache", "request": { - "url": "/repos/hub4j-test-org/github-api/git/ref/heads/test/content_ref_cache", + "url": "/repos/hub4j-test-org/github-api/git/refs/heads/test/content_ref_cache", "method": "GET", "headers": { "If-Modified-Since": { diff --git a/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-13.json b/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-13.json index ab09bc1ec3..ace5c60deb 100644 --- a/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-13.json +++ b/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-13.json @@ -2,7 +2,7 @@ "id": "60a34226-e65e-40f5-982e-8ee51627b8eb", "name": "repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache", "request": { - "url": "/repos/hub4j-test-org/github-api/git/ref/heads/test/content_ref_cache", + "url": "/repos/hub4j-test-org/github-api/git/refs/heads/test/content_ref_cache", "method": "GET", "headers": { "If-Modified-Since": { diff --git a/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-14.json b/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-14.json index b4a09cdd3d..bd486a0dd4 100644 --- a/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-14.json +++ b/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-14.json @@ -2,7 +2,7 @@ "id": "709410bf-7c2e-48fa-92a7-f493ffbe7262", "name": "repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache", "request": { - "url": "/repos/hub4j-test-org/github-api/git/ref/heads/test/content_ref_cache", + "url": "/repos/hub4j-test-org/github-api/git/refs/heads/test/content_ref_cache", "method": "GET", "headers": { "Cache-Control": { diff --git a/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-15.json b/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-15.json index b572bc2f13..6bb9de6da8 100644 --- a/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-15.json +++ b/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-15.json @@ -2,7 +2,7 @@ "id": "eea55a5c-27a5-448a-a51f-097a78fcc884", "name": "repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache", "request": { - "url": "/repos/hub4j-test-org/github-api/git/ref/heads/test/content_ref_cache", + "url": "/repos/hub4j-test-org/github-api/git/refs/heads/test/content_ref_cache", "method": "GET", "headers": { "If-None-Match": { diff --git a/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-7.json b/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-7.json index 5eedca35fa..e88f261f88 100644 --- a/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-7.json +++ b/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-7.json @@ -2,7 +2,7 @@ "id": "3964781d-6074-412b-bb7a-f3de1bd9ca9c", "name": "repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache", "request": { - "url": "/repos/hub4j-test-org/github-api/git/ref/heads/test/content_ref_cache", + "url": "/repos/hub4j-test-org/github-api/git/refs/heads/test/content_ref_cache", "method": "GET", "headers": { "Cache-Control": { diff --git a/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-8.json b/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-8.json index cd8617af97..a56170fbe7 100644 --- a/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-8.json +++ b/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache-8.json @@ -2,7 +2,7 @@ "id": "4506da20-fd38-4c44-a4de-99242417e735", "name": "repos_hub4j-test-org_github-api_git_refs_heads_test_content_ref_cache", "request": { - "url": "/repos/hub4j-test-org/github-api/git/ref/heads/test/content_ref_cache", + "url": "/repos/hub4j-test-org/github-api/git/refs/heads/test/content_ref_cache", "method": "GET", "headers": { "If-None-Match": { diff --git a/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_unmergeable-5.json b/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_unmergeable-5.json index 05a91ae3d8..488a6fb96e 100644 --- a/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_unmergeable-5.json +++ b/src/test/resources/org/kohsuke/github/extras/GitHubCachingTest/wiremock/testCached404/mappings/repos_hub4j-test-org_github-api_git_refs_heads_test_unmergeable-5.json @@ -2,7 +2,7 @@ "id": "d47b333a-351b-499c-866b-11122bd52803", "name": "repos_hub4j-test-org_github-api_git_refs_heads_test_unmergeable", "request": { - "url": "/repos/hub4j-test-org/github-api/git/ref/heads/test/unmergeable", + "url": "/repos/hub4j-test-org/github-api/git/refs/heads/test/unmergeable", "method": "GET", "headers": { "Cache-Control": {