From d641edb3358c412bedb2e3e7350440978ac34277 Mon Sep 17 00:00:00 2001 From: Gavin Mogan Date: Thu, 19 Dec 2019 23:23:13 -0800 Subject: [PATCH 1/2] Add ghlabels.update, and extend ghobject for standardness --- src/main/java/org/kohsuke/github/GHLabel.java | 42 +++++- .../java/org/kohsuke/github/GHRepository.java | 2 +- .../java/org/kohsuke/github/GHLabelTest.java | 35 +++++ ...-80c07746-69ee-44bb-9494-ddfae62252ad.json | 41 ++++++ ...-ab0de86d-86f9-4c4a-971d-16da0851f6ae.json | 125 ++++++++++++++++++ .../orgs_github-api-test-org-1-80c077.json | 45 +++++++ ...hub-api-test-org_test-labels-2-ab0de8.json | 45 +++++++ ...-test-org_test-labels_labels-3-03f3e6.json | 52 ++++++++ ...t-org_test-labels_labels_foo-4-b31fcb.json | 51 +++++++ ...rg_test-labels_labels_newfoo-5-93349c.json | 39 ++++++ ...-78894a7c-1be7-448f-9f81-2b5849253343.json | 41 ++++++ ...-0e01bea9-8d15-44a9-826e-bcc7a0a7e882.json | 125 ++++++++++++++++++ .../orgs_github-api-test-org-1-78894a.json | 45 +++++++ ...hub-api-test-org_test-labels-2-0e01be.json | 45 +++++++ ...-test-org_test-labels_labels-3-8482f7.json | 52 ++++++++ ...-test-org_test-labels_labels-4-02b0fe.json | 44 ++++++ 16 files changed, 825 insertions(+), 4 deletions(-) create mode 100644 src/test/java/org/kohsuke/github/GHLabelTest.java create mode 100644 src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/__files/orgs_github-api-test-org-80c07746-69ee-44bb-9494-ddfae62252ad.json create mode 100644 src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/__files/repos_github-api-test-org_test-labels-ab0de86d-86f9-4c4a-971d-16da0851f6ae.json create mode 100644 src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/orgs_github-api-test-org-1-80c077.json create mode 100644 src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels-2-ab0de8.json create mode 100644 src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels-3-03f3e6.json create mode 100644 src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels_foo-4-b31fcb.json create mode 100644 src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels_newfoo-5-93349c.json create mode 100644 src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/orgs_github-api-test-org-78894a7c-1be7-448f-9f81-2b5849253343.json create mode 100644 src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/repos_github-api-test-org_test-labels-0e01bea9-8d15-44a9-826e-bcc7a0a7e882.json create mode 100644 src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/orgs_github-api-test-org-1-78894a.json create mode 100644 src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels-2-0e01be.json create mode 100644 src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels_labels-3-8482f7.json create mode 100644 src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels_labels-4-02b0fe.json diff --git a/src/main/java/org/kohsuke/github/GHLabel.java b/src/main/java/org/kohsuke/github/GHLabel.java index 8fdd0d7d6f..1f474f4256 100644 --- a/src/main/java/org/kohsuke/github/GHLabel.java +++ b/src/main/java/org/kohsuke/github/GHLabel.java @@ -1,6 +1,8 @@ package org.kohsuke.github; import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -13,7 +15,7 @@ * @see GHIssue#getLabels() GHIssue#getLabels() * @see GHRepository#listLabels() GHRepository#listLabels() */ -public class GHLabel { +public class GHLabel extends GHObject { private String url, name, color, description; private GHRepository repo; @@ -22,8 +24,18 @@ public class GHLabel { * * @return the url */ - public String getUrl() { - return url; + public URL getUrl() { + try { + return new URL(url); + } catch (MalformedURLException e) { + e.printStackTrace(); + return null; + } + } + + @Override + public URL getHtmlUrl() throws IOException { + return null; } /** @@ -68,6 +80,30 @@ public void delete() throws IOException { repo.root.createRequest().method("DELETE").setRawUrlPath(url).send(); } + /** + * Updates an existing github label + * + * @param name + * the name of the label + * @param color + * the color + * @param description + * the description + * @return gh label + * @throws IOException + * the io exception + */ + public GHLabel update(String name, String color, String description) throws IOException { + return repo.root.createRequest() + .method("PATCH") + .with("new_name", name) + .with("color", color) + .with("description", description) + .setRawUrlPath(url) + .fetchInto(this) + .wrapUp(this.repo); + } + /** * Sets color. * diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index f2937c3506..00e285d74f 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -1816,7 +1816,7 @@ public GHLabel createLabel(String name, String color) throws IOException { } /** - * Description is still in preview. + * Creates a new github label * * @param name * the name diff --git a/src/test/java/org/kohsuke/github/GHLabelTest.java b/src/test/java/org/kohsuke/github/GHLabelTest.java new file mode 100644 index 0000000000..c7e2f2dc63 --- /dev/null +++ b/src/test/java/org/kohsuke/github/GHLabelTest.java @@ -0,0 +1,35 @@ +package org.kohsuke.github; + +import org.junit.Test; + +import java.util.List; + +import static org.hamcrest.Matchers.*; + +public class GHLabelTest extends org.kohsuke.github.AbstractGitHubWireMockTest { + + @Test + public void test_toString() throws Exception { + GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG); + GHRepository rep = org.getRepository("test-labels"); + + GHLabel label = rep.createLabel("foo", "001122", "test foo label"); + assertThat(label.toString(), containsString("name=foo,color=001122,description=test foo label")); + + List list = rep.listLabels().asList(); + + assertEquals(1, list.size()); + assertThat(list.get(0).toString(), containsString("name=foo,color=001122,description=test foo label")); + } + + @Test + public void test_create_updateLabel() throws Exception { + GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG); + GHRepository rep = org.getRepository("test-labels"); + GHLabel label = rep.createLabel("foo", "001122", "test foo label"); + assertThat(label.toString(), containsString("name=foo,color=001122,description=test foo label")); + label.update("newfoo", "221100", "label foo test"); + assertThat(label.toString(), containsString("name=newfoo,color=221100,description=label foo test")); + label.delete(); + } +} diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/__files/orgs_github-api-test-org-80c07746-69ee-44bb-9494-ddfae62252ad.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/__files/orgs_github-api-test-org-80c07746-69ee-44bb-9494-ddfae62252ad.json new file mode 100644 index 0000000000..29eb77a1b5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/__files/orgs_github-api-test-org-80c07746-69ee-44bb-9494-ddfae62252ad.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 59067752, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU5MDY3NzUy", + "url": "https://api.github.com/orgs/github-api-test-org", + "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", + "events_url": "https://api.github.com/orgs/github-api-test-org/events", + "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", + "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", + "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/59067752?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 2, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/github-api-test-org", + "created_at": "2019-12-19T20:34:09Z", + "updated_at": "2019-12-19T20:34:09Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 1, + "collaborators": 0, + "billing_email": "github@gavinmogan.com", + "default_repository_permission": "read", + "members_can_create_repositories": true, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 1, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/__files/repos_github-api-test-org_test-labels-ab0de86d-86f9-4c4a-971d-16da0851f6ae.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/__files/repos_github-api-test-org_test-labels-ab0de86d-86f9-4c4a-971d-16da0851f6ae.json new file mode 100644 index 0000000000..4cb080908d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/__files/repos_github-api-test-org_test-labels-ab0de86d-86f9-4c4a-971d-16da0851f6ae.json @@ -0,0 +1,125 @@ +{ + "id": 229210967, + "node_id": "MDEwOlJlcG9zaXRvcnkyMjkyMTA5Njc=", + "name": "test-labels", + "full_name": "github-api-test-org/test-labels", + "private": false, + "owner": { + "login": "github-api-test-org", + "id": 59067752, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU5MDY3NzUy", + "avatar_url": "https://avatars3.githubusercontent.com/u/59067752?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api-test-org", + "html_url": "https://github.com/github-api-test-org", + "followers_url": "https://api.github.com/users/github-api-test-org/followers", + "following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/github-api-test-org/orgs", + "repos_url": "https://api.github.com/users/github-api-test-org/repos", + "events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/github-api-test-org/test-labels", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/github-api-test-org/test-labels", + "forks_url": "https://api.github.com/repos/github-api-test-org/test-labels/forks", + "keys_url": "https://api.github.com/repos/github-api-test-org/test-labels/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api-test-org/test-labels/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api-test-org/test-labels/teams", + "hooks_url": "https://api.github.com/repos/github-api-test-org/test-labels/hooks", + "issue_events_url": "https://api.github.com/repos/github-api-test-org/test-labels/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api-test-org/test-labels/events", + "assignees_url": "https://api.github.com/repos/github-api-test-org/test-labels/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api-test-org/test-labels/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api-test-org/test-labels/tags", + "blobs_url": "https://api.github.com/repos/github-api-test-org/test-labels/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api-test-org/test-labels/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api-test-org/test-labels/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api-test-org/test-labels/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api-test-org/test-labels/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api-test-org/test-labels/languages", + "stargazers_url": "https://api.github.com/repos/github-api-test-org/test-labels/stargazers", + "contributors_url": "https://api.github.com/repos/github-api-test-org/test-labels/contributors", + "subscribers_url": "https://api.github.com/repos/github-api-test-org/test-labels/subscribers", + "subscription_url": "https://api.github.com/repos/github-api-test-org/test-labels/subscription", + "commits_url": "https://api.github.com/repos/github-api-test-org/test-labels/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api-test-org/test-labels/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api-test-org/test-labels/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api-test-org/test-labels/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api-test-org/test-labels/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api-test-org/test-labels/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api-test-org/test-labels/merges", + "archive_url": "https://api.github.com/repos/github-api-test-org/test-labels/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api-test-org/test-labels/downloads", + "issues_url": "https://api.github.com/repos/github-api-test-org/test-labels/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api-test-org/test-labels/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api-test-org/test-labels/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api-test-org/test-labels/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api-test-org/test-labels/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api-test-org/test-labels/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api-test-org/test-labels/deployments", + "created_at": "2019-12-20T07:14:10Z", + "updated_at": "2019-12-20T07:14:10Z", + "pushed_at": "2019-12-20T07:14:11Z", + "git_url": "git://github.com/github-api-test-org/test-labels.git", + "ssh_url": "git@github.com:github-api-test-org/test-labels.git", + "clone_url": "https://github.com/github-api-test-org/test-labels.git", + "svn_url": "https://github.com/github-api-test-org/test-labels", + "homepage": null, + "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, + "organization": { + "login": "github-api-test-org", + "id": 59067752, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU5MDY3NzUy", + "avatar_url": "https://avatars3.githubusercontent.com/u/59067752?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api-test-org", + "html_url": "https://github.com/github-api-test-org", + "followers_url": "https://api.github.com/users/github-api-test-org/followers", + "following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/github-api-test-org/orgs", + "repos_url": "https://api.github.com/users/github-api-test-org/repos", + "events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 0, + "subscribers_count": 0 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/orgs_github-api-test-org-1-80c077.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/orgs_github-api-test-org-1-80c077.json new file mode 100644 index 0000000000..85f377a7a1 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/orgs_github-api-test-org-1-80c077.json @@ -0,0 +1,45 @@ +{ + "id": "80c07746-69ee-44bb-9494-ddfae62252ad", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-80c07746-69ee-44bb-9494-ddfae62252ad.json", + "headers": { + "Server": "GitHub.com", + "Date": "Fri, 20 Dec 2019 07:15:31 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4987", + "X-RateLimit-Reset": "1576829624", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", + "ETag": "W/\"90e9105f0c44a060884a6b5a52e59941\"", + "Last-Modified": "Thu, 19 Dec 2019 20:34:09 GMT", + "X-OAuth-Scopes": "admin:org, repo", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "83F3:71F2:2997CB:67DDC0:5DFC7513" + } + }, + "uuid": "80c07746-69ee-44bb-9494-ddfae62252ad", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels-2-ab0de8.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels-2-ab0de8.json new file mode 100644 index 0000000000..6fa11e53b2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels-2-ab0de8.json @@ -0,0 +1,45 @@ +{ + "id": "ab0de86d-86f9-4c4a-971d-16da0851f6ae", + "name": "repos_github-api-test-org_test-labels", + "request": { + "url": "/repos/github-api-test-org/test-labels", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api-test-org_test-labels-ab0de86d-86f9-4c4a-971d-16da0851f6ae.json", + "headers": { + "Server": "GitHub.com", + "Date": "Fri, 20 Dec 2019 07:15:32 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4986", + "X-RateLimit-Reset": "1576829624", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", + "ETag": "W/\"85053b22f5c31079acccbcf5bfaa28e7\"", + "Last-Modified": "Fri, 20 Dec 2019 07:14:10 GMT", + "X-OAuth-Scopes": "admin:org, repo", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "83F3:71F2:2997D5:67DDC8:5DFC7513" + } + }, + "uuid": "ab0de86d-86f9-4c4a-971d-16da0851f6ae", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels-3-03f3e6.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels-3-03f3e6.json new file mode 100644 index 0000000000..78d4ba89d2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels-3-03f3e6.json @@ -0,0 +1,52 @@ +{ + "id": "03f3e613-ec17-4061-9449-5a6d77340e95", + "name": "repos_github-api-test-org_test-labels_labels", + "request": { + "url": "/repos/github-api-test-org/test-labels/labels", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"color\":\"001122\",\"name\":\"foo\",\"description\":\"test foo label\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "body": "{\"id\":1744812383,\"node_id\":\"MDU6TGFiZWwxNzQ0ODEyMzgz\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/foo\",\"name\":\"foo\",\"color\":\"001122\",\"default\":false,\"description\":\"test foo label\"}", + "headers": { + "Server": "GitHub.com", + "Date": "Fri, 20 Dec 2019 07:15:32 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4985", + "X-RateLimit-Reset": "1576829624", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", + "ETag": "\"ecc66d756e13197c60516c1d21a24d03\"", + "X-OAuth-Scopes": "admin:org, repo", + "X-Accepted-OAuth-Scopes": "", + "Location": "https://api.github.com/repos/github-api-test-org/test-labels/labels/foo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "83F3:71F2:2997DA:67DDD8:5DFC7514" + } + }, + "uuid": "03f3e613-ec17-4061-9449-5a6d77340e95", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels_foo-4-b31fcb.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels_foo-4-b31fcb.json new file mode 100644 index 0000000000..073378cec0 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels_foo-4-b31fcb.json @@ -0,0 +1,51 @@ +{ + "id": "b31fcb1b-ad83-498a-9919-335d2747b5d6", + "name": "repos_github-api-test-org_test-labels_labels_foo", + "request": { + "url": "/repos/github-api-test-org/test-labels/labels/foo", + "method": "PATCH", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"color\":\"221100\",\"description\":\"label foo test\",\"new_name\":\"newfoo\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"id\":1744812383,\"node_id\":\"MDU6TGFiZWwxNzQ0ODEyMzgz\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/newfoo\",\"name\":\"newfoo\",\"color\":\"221100\",\"default\":false,\"description\":\"label foo test\"}", + "headers": { + "Server": "GitHub.com", + "Date": "Fri, 20 Dec 2019 07:15:32 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4984", + "X-RateLimit-Reset": "1576829624", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", + "ETag": "W/\"171733d3f27f98e14b3c9bf1d9166183\"", + "X-OAuth-Scopes": "admin:org, repo", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "83F3:71F2:2997E0:67DDDE:5DFC7514" + } + }, + "uuid": "b31fcb1b-ad83-498a-9919-335d2747b5d6", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels_newfoo-5-93349c.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels_newfoo-5-93349c.json new file mode 100644 index 0000000000..6b2964a192 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels_newfoo-5-93349c.json @@ -0,0 +1,39 @@ +{ + "id": "93349c57-e435-431e-821f-759c84eee583", + "name": "repos_github-api-test-org_test-labels_labels_newfoo", + "request": { + "url": "/repos/github-api-test-org/test-labels/labels/newfoo", + "method": "DELETE", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 204, + "headers": { + "Server": "GitHub.com", + "Date": "Fri, 20 Dec 2019 07:15:33 GMT", + "Status": "204 No Content", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4983", + "X-RateLimit-Reset": "1576829624", + "X-OAuth-Scopes": "admin:org, repo", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "83F3:71F2:2997E4:67DDE7:5DFC7514" + } + }, + "uuid": "93349c57-e435-431e-821f-759c84eee583", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/orgs_github-api-test-org-78894a7c-1be7-448f-9f81-2b5849253343.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/orgs_github-api-test-org-78894a7c-1be7-448f-9f81-2b5849253343.json new file mode 100644 index 0000000000..29eb77a1b5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/orgs_github-api-test-org-78894a7c-1be7-448f-9f81-2b5849253343.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 59067752, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU5MDY3NzUy", + "url": "https://api.github.com/orgs/github-api-test-org", + "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", + "events_url": "https://api.github.com/orgs/github-api-test-org/events", + "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", + "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", + "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/59067752?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 2, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/github-api-test-org", + "created_at": "2019-12-19T20:34:09Z", + "updated_at": "2019-12-19T20:34:09Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 1, + "collaborators": 0, + "billing_email": "github@gavinmogan.com", + "default_repository_permission": "read", + "members_can_create_repositories": true, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 1, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/repos_github-api-test-org_test-labels-0e01bea9-8d15-44a9-826e-bcc7a0a7e882.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/repos_github-api-test-org_test-labels-0e01bea9-8d15-44a9-826e-bcc7a0a7e882.json new file mode 100644 index 0000000000..4cb080908d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/repos_github-api-test-org_test-labels-0e01bea9-8d15-44a9-826e-bcc7a0a7e882.json @@ -0,0 +1,125 @@ +{ + "id": 229210967, + "node_id": "MDEwOlJlcG9zaXRvcnkyMjkyMTA5Njc=", + "name": "test-labels", + "full_name": "github-api-test-org/test-labels", + "private": false, + "owner": { + "login": "github-api-test-org", + "id": 59067752, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU5MDY3NzUy", + "avatar_url": "https://avatars3.githubusercontent.com/u/59067752?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api-test-org", + "html_url": "https://github.com/github-api-test-org", + "followers_url": "https://api.github.com/users/github-api-test-org/followers", + "following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/github-api-test-org/orgs", + "repos_url": "https://api.github.com/users/github-api-test-org/repos", + "events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/github-api-test-org/test-labels", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/github-api-test-org/test-labels", + "forks_url": "https://api.github.com/repos/github-api-test-org/test-labels/forks", + "keys_url": "https://api.github.com/repos/github-api-test-org/test-labels/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api-test-org/test-labels/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api-test-org/test-labels/teams", + "hooks_url": "https://api.github.com/repos/github-api-test-org/test-labels/hooks", + "issue_events_url": "https://api.github.com/repos/github-api-test-org/test-labels/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api-test-org/test-labels/events", + "assignees_url": "https://api.github.com/repos/github-api-test-org/test-labels/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api-test-org/test-labels/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api-test-org/test-labels/tags", + "blobs_url": "https://api.github.com/repos/github-api-test-org/test-labels/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api-test-org/test-labels/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api-test-org/test-labels/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api-test-org/test-labels/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api-test-org/test-labels/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api-test-org/test-labels/languages", + "stargazers_url": "https://api.github.com/repos/github-api-test-org/test-labels/stargazers", + "contributors_url": "https://api.github.com/repos/github-api-test-org/test-labels/contributors", + "subscribers_url": "https://api.github.com/repos/github-api-test-org/test-labels/subscribers", + "subscription_url": "https://api.github.com/repos/github-api-test-org/test-labels/subscription", + "commits_url": "https://api.github.com/repos/github-api-test-org/test-labels/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api-test-org/test-labels/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api-test-org/test-labels/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api-test-org/test-labels/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api-test-org/test-labels/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api-test-org/test-labels/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api-test-org/test-labels/merges", + "archive_url": "https://api.github.com/repos/github-api-test-org/test-labels/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api-test-org/test-labels/downloads", + "issues_url": "https://api.github.com/repos/github-api-test-org/test-labels/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api-test-org/test-labels/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api-test-org/test-labels/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api-test-org/test-labels/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api-test-org/test-labels/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api-test-org/test-labels/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api-test-org/test-labels/deployments", + "created_at": "2019-12-20T07:14:10Z", + "updated_at": "2019-12-20T07:14:10Z", + "pushed_at": "2019-12-20T07:14:11Z", + "git_url": "git://github.com/github-api-test-org/test-labels.git", + "ssh_url": "git@github.com:github-api-test-org/test-labels.git", + "clone_url": "https://github.com/github-api-test-org/test-labels.git", + "svn_url": "https://github.com/github-api-test-org/test-labels", + "homepage": null, + "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, + "organization": { + "login": "github-api-test-org", + "id": 59067752, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU5MDY3NzUy", + "avatar_url": "https://avatars3.githubusercontent.com/u/59067752?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api-test-org", + "html_url": "https://github.com/github-api-test-org", + "followers_url": "https://api.github.com/users/github-api-test-org/followers", + "following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/github-api-test-org/orgs", + "repos_url": "https://api.github.com/users/github-api-test-org/repos", + "events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 0, + "subscribers_count": 0 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/orgs_github-api-test-org-1-78894a.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/orgs_github-api-test-org-1-78894a.json new file mode 100644 index 0000000000..6db263779c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/orgs_github-api-test-org-1-78894a.json @@ -0,0 +1,45 @@ +{ + "id": "78894a7c-1be7-448f-9f81-2b5849253343", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-78894a7c-1be7-448f-9f81-2b5849253343.json", + "headers": { + "Server": "GitHub.com", + "Date": "Fri, 20 Dec 2019 07:15:34 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4982", + "X-RateLimit-Reset": "1576829624", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", + "ETag": "W/\"90e9105f0c44a060884a6b5a52e59941\"", + "Last-Modified": "Thu, 19 Dec 2019 20:34:09 GMT", + "X-OAuth-Scopes": "admin:org, repo", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "B19B:3205:5B4C20:DEAF19:5DFC7515" + } + }, + "uuid": "78894a7c-1be7-448f-9f81-2b5849253343", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels-2-0e01be.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels-2-0e01be.json new file mode 100644 index 0000000000..136c5c5cd4 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels-2-0e01be.json @@ -0,0 +1,45 @@ +{ + "id": "0e01bea9-8d15-44a9-826e-bcc7a0a7e882", + "name": "repos_github-api-test-org_test-labels", + "request": { + "url": "/repos/github-api-test-org/test-labels", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api-test-org_test-labels-0e01bea9-8d15-44a9-826e-bcc7a0a7e882.json", + "headers": { + "Server": "GitHub.com", + "Date": "Fri, 20 Dec 2019 07:15:34 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4981", + "X-RateLimit-Reset": "1576829624", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", + "ETag": "W/\"85053b22f5c31079acccbcf5bfaa28e7\"", + "Last-Modified": "Fri, 20 Dec 2019 07:14:10 GMT", + "X-OAuth-Scopes": "admin:org, repo", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "B19B:3205:5B4C25:DEAF22:5DFC7516" + } + }, + "uuid": "0e01bea9-8d15-44a9-826e-bcc7a0a7e882", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels_labels-3-8482f7.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels_labels-3-8482f7.json new file mode 100644 index 0000000000..a922c93238 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels_labels-3-8482f7.json @@ -0,0 +1,52 @@ +{ + "id": "8482f7fe-789f-46cb-a4e6-370257e06b76", + "name": "repos_github-api-test-org_test-labels_labels", + "request": { + "url": "/repos/github-api-test-org/test-labels/labels", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"color\":\"001122\",\"name\":\"foo\",\"description\":\"test foo label\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "body": "{\"id\":1744812431,\"node_id\":\"MDU6TGFiZWwxNzQ0ODEyNDMx\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/foo\",\"name\":\"foo\",\"color\":\"001122\",\"default\":false,\"description\":\"test foo label\"}", + "headers": { + "Server": "GitHub.com", + "Date": "Fri, 20 Dec 2019 07:15:34 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4980", + "X-RateLimit-Reset": "1576829624", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", + "ETag": "\"56700bee7fde862d7ff56ae444999715\"", + "X-OAuth-Scopes": "admin:org, repo", + "X-Accepted-OAuth-Scopes": "", + "Location": "https://api.github.com/repos/github-api-test-org/test-labels/labels/foo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "B19B:3205:5B4C32:DEAF33:5DFC7516" + } + }, + "uuid": "8482f7fe-789f-46cb-a4e6-370257e06b76", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels_labels-4-02b0fe.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels_labels-4-02b0fe.json new file mode 100644 index 0000000000..2f153d2d0b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels_labels-4-02b0fe.json @@ -0,0 +1,44 @@ +{ + "id": "02b0fee0-7409-48c7-aa38-c53ae5bd2211", + "name": "repos_github-api-test-org_test-labels_labels", + "request": { + "url": "/repos/github-api-test-org/test-labels/labels", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "body": "[{\"id\":1744812431,\"node_id\":\"MDU6TGFiZWwxNzQ0ODEyNDMx\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/foo\",\"name\":\"foo\",\"color\":\"001122\",\"default\":false,\"description\":\"test foo label\"}]", + "headers": { + "Server": "GitHub.com", + "Date": "Fri, 20 Dec 2019 07:15:34 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4979", + "X-RateLimit-Reset": "1576829624", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", + "ETag": "W/\"06a16c807a6f56ac47a65fa11aa63480\"", + "X-OAuth-Scopes": "admin:org, repo", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "B19B:3205:5B4C3B:DEAF4A:5DFC7516" + } + }, + "uuid": "02b0fee0-7409-48c7-aa38-c53ae5bd2211", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file From a7062c0e36824dbe4a7273c4a2c897ec196f04fa Mon Sep 17 00:00:00 2001 From: Gavin Mogan Date: Sat, 21 Dec 2019 21:20:43 -0800 Subject: [PATCH 2/2] setName/setColor/setDescription and tests --- src/main/java/org/kohsuke/github/GHLabel.java | 23 ++-- .../java/org/kohsuke/github/GHLabelTest.java | 18 ++-- ...-80c07746-69ee-44bb-9494-ddfae62252ad.json | 41 ------- ...2d5e62d8-cef9-442b-8879-9252605af926.json} | 102 +++++++++--------- .../orgs_github-api-test-org-1-80c077.json | 45 -------- ...emp-test_create_updatelabel-1-2d5e62.json} | 26 ++--- ...t_create_updatelabel_labels-2-d658ff.json} | 26 ++--- ...reate_updatelabel_labels_foo-3-f27724.json | 51 +++++++++ ...reate_updatelabel_labels_foo-4-4d4e95.json | 51 +++++++++ ...eate_updatelabel_labels_foo-5-3b93b5.json} | 24 ++--- ...e_updatelabel_labels_newfoo-6-c7ceb0.json} | 20 ++-- ...-78894a7c-1be7-448f-9f81-2b5849253343.json | 41 ------- ...66791257-bc14-4b7c-bd5a-ec08788e4f39.json} | 102 +++++++++--------- ...-b1aef196-d0b5-4fc8-a538-fe1362aa63e0.json | 92 ++++++++++++++++ ...test-org_temp-test_tostring-1-667912.json} | 26 ++--- ...g_temp-test_tostring_labels-2-015b90.json} | 26 ++--- ...g_temp-test_tostring_labels-3-b1aef1.json} | 25 +++-- ...-test-org_test-labels_labels-4-02b0fe.json | 44 -------- 18 files changed, 403 insertions(+), 380 deletions(-) delete mode 100644 src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/__files/orgs_github-api-test-org-80c07746-69ee-44bb-9494-ddfae62252ad.json rename src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/__files/{repos_github-api-test-org_test-labels-ab0de86d-86f9-4c4a-971d-16da0851f6ae.json => repos_github-api-test-org_temp-test_create_updatelabel-2d5e62d8-cef9-442b-8879-9252605af926.json} (65%) delete mode 100644 src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/orgs_github-api-test-org-1-80c077.json rename src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/{test_toString/mappings/orgs_github-api-test-org-1-78894a.json => test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel-1-2d5e62.json} (61%) rename src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/{test_toString/mappings/repos_github-api-test-org_test-labels_labels-3-8482f7.json => test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel_labels-2-d658ff.json} (62%) create mode 100644 src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel_labels_foo-3-f27724.json create mode 100644 src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel_labels_foo-4-4d4e95.json rename src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/{repos_github-api-test-org_test-labels_labels_foo-4-b31fcb.json => repos_github-api-test-org_temp-test_create_updatelabel_labels_foo-5-3b93b5.json} (62%) rename src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/{repos_github-api-test-org_test-labels_labels_newfoo-5-93349c.json => repos_github-api-test-org_temp-test_create_updatelabel_labels_newfoo-6-c7ceb0.json} (66%) delete mode 100644 src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/orgs_github-api-test-org-78894a7c-1be7-448f-9f81-2b5849253343.json rename src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/{repos_github-api-test-org_test-labels-0e01bea9-8d15-44a9-826e-bcc7a0a7e882.json => repos_github-api-test-org_temp-test_tostring-66791257-bc14-4b7c-bd5a-ec08788e4f39.json} (69%) create mode 100644 src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/repos_github-api-test-org_temp-test_tostring_labels-b1aef196-d0b5-4fc8-a538-fe1362aa63e0.json rename src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/{test_create_updateLabel/mappings/repos_github-api-test-org_test-labels-2-ab0de8.json => test_toString/mappings/repos_github-api-test-org_temp-test_tostring-1-667912.json} (63%) rename src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/{test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels-3-03f3e6.json => test_toString/mappings/repos_github-api-test-org_temp-test_tostring_labels-2-015b90.json} (64%) rename src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/{repos_github-api-test-org_test-labels-2-0e01be.json => repos_github-api-test-org_temp-test_tostring_labels-3-b1aef1.json} (64%) delete mode 100644 src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels_labels-4-02b0fe.json diff --git a/src/main/java/org/kohsuke/github/GHLabel.java b/src/main/java/org/kohsuke/github/GHLabel.java index 1f474f4256..5458fac17d 100644 --- a/src/main/java/org/kohsuke/github/GHLabel.java +++ b/src/main/java/org/kohsuke/github/GHLabel.java @@ -81,22 +81,17 @@ public void delete() throws IOException { } /** - * Updates an existing github label + * Sets color. * - * @param name - * the name of the label - * @param color - * the color - * @param description - * the description - * @return gh label + * @param newName + * New name * @throws IOException * the io exception */ - public GHLabel update(String name, String color, String description) throws IOException { - return repo.root.createRequest() + public void setName(String newName) throws IOException { + repo.root.createRequest() .method("PATCH") - .with("new_name", name) + .with("new_name", newName) .with("color", color) .with("description", description) .setRawUrlPath(url) @@ -119,7 +114,8 @@ public void setColor(String newColor) throws IOException { .with("color", newColor) .with("description", description) .setRawUrlPath(url) - .send(); + .fetchInto(this) + .wrapUp(this.repo); } /** @@ -137,7 +133,8 @@ public void setDescription(String newDescription) throws IOException { .with("color", color) .with("description", newDescription) .setRawUrlPath(url) - .send(); + .fetchInto(this) + .wrapUp(this.repo); } static Collection toNames(Collection labels) { diff --git a/src/test/java/org/kohsuke/github/GHLabelTest.java b/src/test/java/org/kohsuke/github/GHLabelTest.java index c7e2f2dc63..7004ebdea0 100644 --- a/src/test/java/org/kohsuke/github/GHLabelTest.java +++ b/src/test/java/org/kohsuke/github/GHLabelTest.java @@ -10,25 +10,29 @@ public class GHLabelTest extends org.kohsuke.github.AbstractGitHubWireMockTest { @Test public void test_toString() throws Exception { - GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG); - GHRepository rep = org.getRepository("test-labels"); + GHRepository rep = getTempRepository(); GHLabel label = rep.createLabel("foo", "001122", "test foo label"); assertThat(label.toString(), containsString("name=foo,color=001122,description=test foo label")); List list = rep.listLabels().asList(); - assertEquals(1, list.size()); - assertThat(list.get(0).toString(), containsString("name=foo,color=001122,description=test foo label")); + assertEquals(10, list.size()); + assertThat(list.stream().filter(l -> "foo".equals(l.getName())).findAny().toString(), + containsString("name=foo,color=001122,description=test foo label")); } @Test public void test_create_updateLabel() throws Exception { - GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG); - GHRepository rep = org.getRepository("test-labels"); + GHRepository rep = getTempRepository(); + GHLabel label = rep.createLabel("foo", "001122", "test foo label"); assertThat(label.toString(), containsString("name=foo,color=001122,description=test foo label")); - label.update("newfoo", "221100", "label foo test"); + label.setColor("221100"); + assertThat(label.toString(), containsString("name=foo,color=221100,description=test foo label")); + label.setDescription("label foo test"); + assertThat(label.toString(), containsString("name=foo,color=221100,description=label foo test")); + label.setName("newfoo"); assertThat(label.toString(), containsString("name=newfoo,color=221100,description=label foo test")); label.delete(); } diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/__files/orgs_github-api-test-org-80c07746-69ee-44bb-9494-ddfae62252ad.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/__files/orgs_github-api-test-org-80c07746-69ee-44bb-9494-ddfae62252ad.json deleted file mode 100644 index 29eb77a1b5..0000000000 --- a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/__files/orgs_github-api-test-org-80c07746-69ee-44bb-9494-ddfae62252ad.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "login": "github-api-test-org", - "id": 59067752, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjU5MDY3NzUy", - "url": "https://api.github.com/orgs/github-api-test-org", - "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", - "events_url": "https://api.github.com/orgs/github-api-test-org/events", - "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", - "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", - "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", - "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", - "avatar_url": "https://avatars3.githubusercontent.com/u/59067752?v=4", - "description": null, - "is_verified": false, - "has_organization_projects": true, - "has_repository_projects": true, - "public_repos": 2, - "public_gists": 0, - "followers": 0, - "following": 0, - "html_url": "https://github.com/github-api-test-org", - "created_at": "2019-12-19T20:34:09Z", - "updated_at": "2019-12-19T20:34:09Z", - "type": "Organization", - "total_private_repos": 0, - "owned_private_repos": 0, - "private_gists": 0, - "disk_usage": 1, - "collaborators": 0, - "billing_email": "github@gavinmogan.com", - "default_repository_permission": "read", - "members_can_create_repositories": true, - "two_factor_requirement_enabled": false, - "plan": { - "name": "free", - "space": 976562499, - "private_repos": 0, - "filled_seats": 1, - "seats": 0 - } -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/__files/repos_github-api-test-org_test-labels-ab0de86d-86f9-4c4a-971d-16da0851f6ae.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/__files/repos_github-api-test-org_temp-test_create_updatelabel-2d5e62d8-cef9-442b-8879-9252605af926.json similarity index 65% rename from src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/__files/repos_github-api-test-org_test-labels-ab0de86d-86f9-4c4a-971d-16da0851f6ae.json rename to src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/__files/repos_github-api-test-org_temp-test_create_updatelabel-2d5e62d8-cef9-442b-8879-9252605af926.json index 4cb080908d..1fd9b8f47b 100644 --- a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/__files/repos_github-api-test-org_test-labels-ab0de86d-86f9-4c4a-971d-16da0851f6ae.json +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/__files/repos_github-api-test-org_temp-test_create_updatelabel-2d5e62d8-cef9-442b-8879-9252605af926.json @@ -1,8 +1,8 @@ { - "id": 229210967, - "node_id": "MDEwOlJlcG9zaXRvcnkyMjkyMTA5Njc=", - "name": "test-labels", - "full_name": "github-api-test-org/test-labels", + "id": 229521552, + "node_id": "MDEwOlJlcG9zaXRvcnkyMjk1MjE1NTI=", + "name": "temp-test_create_updateLabel", + "full_name": "github-api-test-org/temp-test_create_updateLabel", "private": false, "owner": { "login": "github-api-test-org", @@ -24,54 +24,54 @@ "type": "Organization", "site_admin": false }, - "html_url": "https://github.com/github-api-test-org/test-labels", - "description": null, + "html_url": "https://github.com/github-api-test-org/temp-test_create_updateLabel", + "description": "A test repository for testing the github-api project: temp-test_create_updateLabel", "fork": false, - "url": "https://api.github.com/repos/github-api-test-org/test-labels", - "forks_url": "https://api.github.com/repos/github-api-test-org/test-labels/forks", - "keys_url": "https://api.github.com/repos/github-api-test-org/test-labels/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/github-api-test-org/test-labels/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/github-api-test-org/test-labels/teams", - "hooks_url": "https://api.github.com/repos/github-api-test-org/test-labels/hooks", - "issue_events_url": "https://api.github.com/repos/github-api-test-org/test-labels/issues/events{/number}", - "events_url": "https://api.github.com/repos/github-api-test-org/test-labels/events", - "assignees_url": "https://api.github.com/repos/github-api-test-org/test-labels/assignees{/user}", - "branches_url": "https://api.github.com/repos/github-api-test-org/test-labels/branches{/branch}", - "tags_url": "https://api.github.com/repos/github-api-test-org/test-labels/tags", - "blobs_url": "https://api.github.com/repos/github-api-test-org/test-labels/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/github-api-test-org/test-labels/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/github-api-test-org/test-labels/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/github-api-test-org/test-labels/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/github-api-test-org/test-labels/statuses/{sha}", - "languages_url": "https://api.github.com/repos/github-api-test-org/test-labels/languages", - "stargazers_url": "https://api.github.com/repos/github-api-test-org/test-labels/stargazers", - "contributors_url": "https://api.github.com/repos/github-api-test-org/test-labels/contributors", - "subscribers_url": "https://api.github.com/repos/github-api-test-org/test-labels/subscribers", - "subscription_url": "https://api.github.com/repos/github-api-test-org/test-labels/subscription", - "commits_url": "https://api.github.com/repos/github-api-test-org/test-labels/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/github-api-test-org/test-labels/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/github-api-test-org/test-labels/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/github-api-test-org/test-labels/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/github-api-test-org/test-labels/contents/{+path}", - "compare_url": "https://api.github.com/repos/github-api-test-org/test-labels/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/github-api-test-org/test-labels/merges", - "archive_url": "https://api.github.com/repos/github-api-test-org/test-labels/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/github-api-test-org/test-labels/downloads", - "issues_url": "https://api.github.com/repos/github-api-test-org/test-labels/issues{/number}", - "pulls_url": "https://api.github.com/repos/github-api-test-org/test-labels/pulls{/number}", - "milestones_url": "https://api.github.com/repos/github-api-test-org/test-labels/milestones{/number}", - "notifications_url": "https://api.github.com/repos/github-api-test-org/test-labels/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/github-api-test-org/test-labels/labels{/name}", - "releases_url": "https://api.github.com/repos/github-api-test-org/test-labels/releases{/id}", - "deployments_url": "https://api.github.com/repos/github-api-test-org/test-labels/deployments", - "created_at": "2019-12-20T07:14:10Z", - "updated_at": "2019-12-20T07:14:10Z", - "pushed_at": "2019-12-20T07:14:11Z", - "git_url": "git://github.com/github-api-test-org/test-labels.git", - "ssh_url": "git@github.com:github-api-test-org/test-labels.git", - "clone_url": "https://github.com/github-api-test-org/test-labels.git", - "svn_url": "https://github.com/github-api-test-org/test-labels", - "homepage": null, + "url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel", + "forks_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/forks", + "keys_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/teams", + "hooks_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/hooks", + "issue_events_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/events", + "assignees_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/tags", + "blobs_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/languages", + "stargazers_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/stargazers", + "contributors_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/contributors", + "subscribers_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/subscribers", + "subscription_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/subscription", + "commits_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/merges", + "archive_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/downloads", + "issues_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/deployments", + "created_at": "2019-12-22T05:15:08Z", + "updated_at": "2019-12-22T05:15:12Z", + "pushed_at": "2019-12-22T05:15:10Z", + "git_url": "git://github.com/github-api-test-org/temp-test_create_updateLabel.git", + "ssh_url": "git@github.com:github-api-test-org/temp-test_create_updateLabel.git", + "clone_url": "https://github.com/github-api-test-org/temp-test_create_updateLabel.git", + "svn_url": "https://github.com/github-api-test-org/temp-test_create_updateLabel", + "homepage": "http://github-api.kohsuke.org/", "size": 0, "stargazers_count": 0, "watchers_count": 0, diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/orgs_github-api-test-org-1-80c077.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/orgs_github-api-test-org-1-80c077.json deleted file mode 100644 index 85f377a7a1..0000000000 --- a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/orgs_github-api-test-org-1-80c077.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "id": "80c07746-69ee-44bb-9494-ddfae62252ad", - "name": "orgs_github-api-test-org", - "request": { - "url": "/orgs/github-api-test-org", - "method": "GET", - "headers": { - "Accept": { - "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" - } - } - }, - "response": { - "status": 200, - "bodyFileName": "orgs_github-api-test-org-80c07746-69ee-44bb-9494-ddfae62252ad.json", - "headers": { - "Server": "GitHub.com", - "Date": "Fri, 20 Dec 2019 07:15:31 GMT", - "Content-Type": "application/json; charset=utf-8", - "Status": "200 OK", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4987", - "X-RateLimit-Reset": "1576829624", - "Cache-Control": "private, max-age=60, s-maxage=60", - "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", - "ETag": "W/\"90e9105f0c44a060884a6b5a52e59941\"", - "Last-Modified": "Thu, 19 Dec 2019 20:34:09 GMT", - "X-OAuth-Scopes": "admin:org, repo", - "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", - "X-GitHub-Media-Type": "unknown, github.v3", - "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", - "Access-Control-Allow-Origin": "*", - "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", - "X-Frame-Options": "deny", - "X-Content-Type-Options": "nosniff", - "X-XSS-Protection": "1; mode=block", - "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", - "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "83F3:71F2:2997CB:67DDC0:5DFC7513" - } - }, - "uuid": "80c07746-69ee-44bb-9494-ddfae62252ad", - "persistent": true, - "insertionIndex": 1 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/orgs_github-api-test-org-1-78894a.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel-1-2d5e62.json similarity index 61% rename from src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/orgs_github-api-test-org-1-78894a.json rename to src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel-1-2d5e62.json index 6db263779c..34a5177a55 100644 --- a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/orgs_github-api-test-org-1-78894a.json +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel-1-2d5e62.json @@ -1,8 +1,8 @@ { - "id": "78894a7c-1be7-448f-9f81-2b5849253343", - "name": "orgs_github-api-test-org", + "id": "2d5e62d8-cef9-442b-8879-9252605af926", + "name": "repos_github-api-test-org_temp-test_create_updatelabel", "request": { - "url": "/orgs/github-api-test-org", + "url": "/repos/github-api-test-org/temp-test_create_updateLabel", "method": "GET", "headers": { "Accept": { @@ -12,21 +12,21 @@ }, "response": { "status": 200, - "bodyFileName": "orgs_github-api-test-org-78894a7c-1be7-448f-9f81-2b5849253343.json", + "bodyFileName": "repos_github-api-test-org_temp-test_create_updatelabel-2d5e62d8-cef9-442b-8879-9252605af926.json", "headers": { "Server": "GitHub.com", - "Date": "Fri, 20 Dec 2019 07:15:34 GMT", + "Date": "Sun, 22 Dec 2019 05:15:13 GMT", "Content-Type": "application/json; charset=utf-8", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4982", - "X-RateLimit-Reset": "1576829624", + "X-RateLimit-Remaining": "4985", + "X-RateLimit-Reset": "1576995265", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", - "ETag": "W/\"90e9105f0c44a060884a6b5a52e59941\"", - "Last-Modified": "Thu, 19 Dec 2019 20:34:09 GMT", - "X-OAuth-Scopes": "admin:org, repo", - "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "ETag": "W/\"54c7fcda570458797658b96702bc16f2\"", + "Last-Modified": "Sun, 22 Dec 2019 05:15:12 GMT", + "X-OAuth-Scopes": "admin:org, delete_repo, repo", + "X-Accepted-OAuth-Scopes": "repo", "X-GitHub-Media-Type": "unknown, github.v3", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", @@ -36,10 +36,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": "B19B:3205:5B4C20:DEAF19:5DFC7515" + "X-GitHub-Request-Id": "3ADE:1E30:1325DC:2DC828:5DFEFBE1" } }, - "uuid": "78894a7c-1be7-448f-9f81-2b5849253343", + "uuid": "2d5e62d8-cef9-442b-8879-9252605af926", "persistent": true, "insertionIndex": 1 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels_labels-3-8482f7.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel_labels-2-d658ff.json similarity index 62% rename from src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels_labels-3-8482f7.json rename to src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel_labels-2-d658ff.json index a922c93238..b8c1589a02 100644 --- a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels_labels-3-8482f7.json +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel_labels-2-d658ff.json @@ -1,8 +1,8 @@ { - "id": "8482f7fe-789f-46cb-a4e6-370257e06b76", - "name": "repos_github-api-test-org_test-labels_labels", + "id": "d658ff9c-bd98-46c0-aaca-d619064496ea", + "name": "repos_github-api-test-org_temp-test_create_updatelabel_labels", "request": { - "url": "/repos/github-api-test-org/test-labels/labels", + "url": "/repos/github-api-test-org/temp-test_create_updateLabel/labels", "method": "POST", "headers": { "Accept": { @@ -19,21 +19,21 @@ }, "response": { "status": 201, - "body": "{\"id\":1744812431,\"node_id\":\"MDU6TGFiZWwxNzQ0ODEyNDMx\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/foo\",\"name\":\"foo\",\"color\":\"001122\",\"default\":false,\"description\":\"test foo label\"}", + "body": "{\"id\":1747637599,\"node_id\":\"MDU6TGFiZWwxNzQ3NjM3NTk5\",\"url\":\"https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/labels/foo\",\"name\":\"foo\",\"color\":\"001122\",\"default\":false,\"description\":\"test foo label\"}", "headers": { "Server": "GitHub.com", - "Date": "Fri, 20 Dec 2019 07:15:34 GMT", + "Date": "Sun, 22 Dec 2019 05:15:14 GMT", "Content-Type": "application/json; charset=utf-8", "Status": "201 Created", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4980", - "X-RateLimit-Reset": "1576829624", + "X-RateLimit-Remaining": "4984", + "X-RateLimit-Reset": "1576995265", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", - "ETag": "\"56700bee7fde862d7ff56ae444999715\"", - "X-OAuth-Scopes": "admin:org, repo", + "ETag": "\"df88c3c4db6b74f449a6a56e27725cc4\"", + "X-OAuth-Scopes": "admin:org, delete_repo, repo", "X-Accepted-OAuth-Scopes": "", - "Location": "https://api.github.com/repos/github-api-test-org/test-labels/labels/foo", + "Location": "https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/labels/foo", "X-GitHub-Media-Type": "unknown, github.v3", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", @@ -43,10 +43,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": "B19B:3205:5B4C32:DEAF33:5DFC7516" + "X-GitHub-Request-Id": "3ADE:1E30:1325DF:2DC82A:5DFEFBE1" } }, - "uuid": "8482f7fe-789f-46cb-a4e6-370257e06b76", + "uuid": "d658ff9c-bd98-46c0-aaca-d619064496ea", "persistent": true, - "insertionIndex": 3 + "insertionIndex": 2 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel_labels_foo-3-f27724.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel_labels_foo-3-f27724.json new file mode 100644 index 0000000000..028cb30749 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel_labels_foo-3-f27724.json @@ -0,0 +1,51 @@ +{ + "id": "f2772414-be05-4219-a22c-37b875287828", + "name": "repos_github-api-test-org_temp-test_create_updatelabel_labels_foo", + "request": { + "url": "/repos/github-api-test-org/temp-test_create_updateLabel/labels/foo", + "method": "PATCH", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"color\":\"221100\",\"name\":\"foo\",\"description\":\"test foo label\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"id\":1747637599,\"node_id\":\"MDU6TGFiZWwxNzQ3NjM3NTk5\",\"url\":\"https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/labels/foo\",\"name\":\"foo\",\"color\":\"221100\",\"default\":false,\"description\":\"test foo label\"}", + "headers": { + "Server": "GitHub.com", + "Date": "Sun, 22 Dec 2019 05:15:14 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4983", + "X-RateLimit-Reset": "1576995265", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", + "ETag": "W/\"b30ca9fa5d72b2fa2ca9ffbec5e2d23e\"", + "X-OAuth-Scopes": "admin:org, delete_repo, repo", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "3ADE:1E30:1325E2:2DC82F:5DFEFBE2" + } + }, + "uuid": "f2772414-be05-4219-a22c-37b875287828", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel_labels_foo-4-4d4e95.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel_labels_foo-4-4d4e95.json new file mode 100644 index 0000000000..e238a70d90 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel_labels_foo-4-4d4e95.json @@ -0,0 +1,51 @@ +{ + "id": "4d4e95de-3b21-4c93-afda-838f94d6599e", + "name": "repos_github-api-test-org_temp-test_create_updatelabel_labels_foo", + "request": { + "url": "/repos/github-api-test-org/temp-test_create_updateLabel/labels/foo", + "method": "PATCH", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"color\":\"221100\",\"name\":\"foo\",\"description\":\"label foo test\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"id\":1747637599,\"node_id\":\"MDU6TGFiZWwxNzQ3NjM3NTk5\",\"url\":\"https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/labels/foo\",\"name\":\"foo\",\"color\":\"221100\",\"default\":false,\"description\":\"label foo test\"}", + "headers": { + "Server": "GitHub.com", + "Date": "Sun, 22 Dec 2019 05:15:15 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4982", + "X-RateLimit-Reset": "1576995265", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", + "ETag": "W/\"684987871d872abf56bf9a46df7ecae1\"", + "X-OAuth-Scopes": "admin:org, delete_repo, repo", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "3ADE:1E30:1325E4:2DC832:5DFEFBE2" + } + }, + "uuid": "4d4e95de-3b21-4c93-afda-838f94d6599e", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels_foo-4-b31fcb.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel_labels_foo-5-3b93b5.json similarity index 62% rename from src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels_foo-4-b31fcb.json rename to src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel_labels_foo-5-3b93b5.json index 073378cec0..a9156cd9c2 100644 --- a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels_foo-4-b31fcb.json +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel_labels_foo-5-3b93b5.json @@ -1,8 +1,8 @@ { - "id": "b31fcb1b-ad83-498a-9919-335d2747b5d6", - "name": "repos_github-api-test-org_test-labels_labels_foo", + "id": "3b93b57e-3e16-4dda-ad79-7762f5946188", + "name": "repos_github-api-test-org_temp-test_create_updatelabel_labels_foo", "request": { - "url": "/repos/github-api-test-org/test-labels/labels/foo", + "url": "/repos/github-api-test-org/temp-test_create_updateLabel/labels/foo", "method": "PATCH", "headers": { "Accept": { @@ -19,19 +19,19 @@ }, "response": { "status": 200, - "body": "{\"id\":1744812383,\"node_id\":\"MDU6TGFiZWwxNzQ0ODEyMzgz\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/newfoo\",\"name\":\"newfoo\",\"color\":\"221100\",\"default\":false,\"description\":\"label foo test\"}", + "body": "{\"id\":1747637599,\"node_id\":\"MDU6TGFiZWwxNzQ3NjM3NTk5\",\"url\":\"https://api.github.com/repos/github-api-test-org/temp-test_create_updateLabel/labels/newfoo\",\"name\":\"newfoo\",\"color\":\"221100\",\"default\":false,\"description\":\"label foo test\"}", "headers": { "Server": "GitHub.com", - "Date": "Fri, 20 Dec 2019 07:15:32 GMT", + "Date": "Sun, 22 Dec 2019 05:15:15 GMT", "Content-Type": "application/json; charset=utf-8", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4984", - "X-RateLimit-Reset": "1576829624", + "X-RateLimit-Remaining": "4981", + "X-RateLimit-Reset": "1576995265", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", - "ETag": "W/\"171733d3f27f98e14b3c9bf1d9166183\"", - "X-OAuth-Scopes": "admin:org, repo", + "ETag": "W/\"c925604b756ac63a44af5d61905826ac\"", + "X-OAuth-Scopes": "admin:org, delete_repo, repo", "X-Accepted-OAuth-Scopes": "", "X-GitHub-Media-Type": "unknown, github.v3", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", @@ -42,10 +42,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": "83F3:71F2:2997E0:67DDDE:5DFC7514" + "X-GitHub-Request-Id": "3ADE:1E30:1325E6:2DC835:5DFEFBE3" } }, - "uuid": "b31fcb1b-ad83-498a-9919-335d2747b5d6", + "uuid": "3b93b57e-3e16-4dda-ad79-7762f5946188", "persistent": true, - "insertionIndex": 4 + "insertionIndex": 5 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels_newfoo-5-93349c.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel_labels_newfoo-6-c7ceb0.json similarity index 66% rename from src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels_newfoo-5-93349c.json rename to src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel_labels_newfoo-6-c7ceb0.json index 6b2964a192..e4017361a1 100644 --- a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels_newfoo-5-93349c.json +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_temp-test_create_updatelabel_labels_newfoo-6-c7ceb0.json @@ -1,8 +1,8 @@ { - "id": "93349c57-e435-431e-821f-759c84eee583", - "name": "repos_github-api-test-org_test-labels_labels_newfoo", + "id": "c7ceb02b-fd1a-4d80-897f-5a88c36eb1ae", + "name": "repos_github-api-test-org_temp-test_create_updatelabel_labels_newfoo", "request": { - "url": "/repos/github-api-test-org/test-labels/labels/newfoo", + "url": "/repos/github-api-test-org/temp-test_create_updateLabel/labels/newfoo", "method": "DELETE", "headers": { "Accept": { @@ -14,12 +14,12 @@ "status": 204, "headers": { "Server": "GitHub.com", - "Date": "Fri, 20 Dec 2019 07:15:33 GMT", + "Date": "Sun, 22 Dec 2019 05:15:15 GMT", "Status": "204 No Content", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4983", - "X-RateLimit-Reset": "1576829624", - "X-OAuth-Scopes": "admin:org, repo", + "X-RateLimit-Remaining": "4980", + "X-RateLimit-Reset": "1576995265", + "X-OAuth-Scopes": "admin:org, delete_repo, repo", "X-Accepted-OAuth-Scopes": "", "X-GitHub-Media-Type": "unknown, github.v3", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", @@ -30,10 +30,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": "83F3:71F2:2997E4:67DDE7:5DFC7514" + "X-GitHub-Request-Id": "3ADE:1E30:1325E8:2DC83B:5DFEFBE3" } }, - "uuid": "93349c57-e435-431e-821f-759c84eee583", + "uuid": "c7ceb02b-fd1a-4d80-897f-5a88c36eb1ae", "persistent": true, - "insertionIndex": 5 + "insertionIndex": 6 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/orgs_github-api-test-org-78894a7c-1be7-448f-9f81-2b5849253343.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/orgs_github-api-test-org-78894a7c-1be7-448f-9f81-2b5849253343.json deleted file mode 100644 index 29eb77a1b5..0000000000 --- a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/orgs_github-api-test-org-78894a7c-1be7-448f-9f81-2b5849253343.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "login": "github-api-test-org", - "id": 59067752, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjU5MDY3NzUy", - "url": "https://api.github.com/orgs/github-api-test-org", - "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", - "events_url": "https://api.github.com/orgs/github-api-test-org/events", - "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", - "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", - "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", - "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", - "avatar_url": "https://avatars3.githubusercontent.com/u/59067752?v=4", - "description": null, - "is_verified": false, - "has_organization_projects": true, - "has_repository_projects": true, - "public_repos": 2, - "public_gists": 0, - "followers": 0, - "following": 0, - "html_url": "https://github.com/github-api-test-org", - "created_at": "2019-12-19T20:34:09Z", - "updated_at": "2019-12-19T20:34:09Z", - "type": "Organization", - "total_private_repos": 0, - "owned_private_repos": 0, - "private_gists": 0, - "disk_usage": 1, - "collaborators": 0, - "billing_email": "github@gavinmogan.com", - "default_repository_permission": "read", - "members_can_create_repositories": true, - "two_factor_requirement_enabled": false, - "plan": { - "name": "free", - "space": 976562499, - "private_repos": 0, - "filled_seats": 1, - "seats": 0 - } -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/repos_github-api-test-org_test-labels-0e01bea9-8d15-44a9-826e-bcc7a0a7e882.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/repos_github-api-test-org_temp-test_tostring-66791257-bc14-4b7c-bd5a-ec08788e4f39.json similarity index 69% rename from src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/repos_github-api-test-org_test-labels-0e01bea9-8d15-44a9-826e-bcc7a0a7e882.json rename to src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/repos_github-api-test-org_temp-test_tostring-66791257-bc14-4b7c-bd5a-ec08788e4f39.json index 4cb080908d..aedac5abcd 100644 --- a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/repos_github-api-test-org_test-labels-0e01bea9-8d15-44a9-826e-bcc7a0a7e882.json +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/repos_github-api-test-org_temp-test_tostring-66791257-bc14-4b7c-bd5a-ec08788e4f39.json @@ -1,8 +1,8 @@ { - "id": 229210967, - "node_id": "MDEwOlJlcG9zaXRvcnkyMjkyMTA5Njc=", - "name": "test-labels", - "full_name": "github-api-test-org/test-labels", + "id": 229521570, + "node_id": "MDEwOlJlcG9zaXRvcnkyMjk1MjE1NzA=", + "name": "temp-test_toString", + "full_name": "github-api-test-org/temp-test_toString", "private": false, "owner": { "login": "github-api-test-org", @@ -24,54 +24,54 @@ "type": "Organization", "site_admin": false }, - "html_url": "https://github.com/github-api-test-org/test-labels", - "description": null, + "html_url": "https://github.com/github-api-test-org/temp-test_toString", + "description": "A test repository for testing the github-api project: temp-test_toString", "fork": false, - "url": "https://api.github.com/repos/github-api-test-org/test-labels", - "forks_url": "https://api.github.com/repos/github-api-test-org/test-labels/forks", - "keys_url": "https://api.github.com/repos/github-api-test-org/test-labels/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/github-api-test-org/test-labels/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/github-api-test-org/test-labels/teams", - "hooks_url": "https://api.github.com/repos/github-api-test-org/test-labels/hooks", - "issue_events_url": "https://api.github.com/repos/github-api-test-org/test-labels/issues/events{/number}", - "events_url": "https://api.github.com/repos/github-api-test-org/test-labels/events", - "assignees_url": "https://api.github.com/repos/github-api-test-org/test-labels/assignees{/user}", - "branches_url": "https://api.github.com/repos/github-api-test-org/test-labels/branches{/branch}", - "tags_url": "https://api.github.com/repos/github-api-test-org/test-labels/tags", - "blobs_url": "https://api.github.com/repos/github-api-test-org/test-labels/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/github-api-test-org/test-labels/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/github-api-test-org/test-labels/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/github-api-test-org/test-labels/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/github-api-test-org/test-labels/statuses/{sha}", - "languages_url": "https://api.github.com/repos/github-api-test-org/test-labels/languages", - "stargazers_url": "https://api.github.com/repos/github-api-test-org/test-labels/stargazers", - "contributors_url": "https://api.github.com/repos/github-api-test-org/test-labels/contributors", - "subscribers_url": "https://api.github.com/repos/github-api-test-org/test-labels/subscribers", - "subscription_url": "https://api.github.com/repos/github-api-test-org/test-labels/subscription", - "commits_url": "https://api.github.com/repos/github-api-test-org/test-labels/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/github-api-test-org/test-labels/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/github-api-test-org/test-labels/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/github-api-test-org/test-labels/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/github-api-test-org/test-labels/contents/{+path}", - "compare_url": "https://api.github.com/repos/github-api-test-org/test-labels/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/github-api-test-org/test-labels/merges", - "archive_url": "https://api.github.com/repos/github-api-test-org/test-labels/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/github-api-test-org/test-labels/downloads", - "issues_url": "https://api.github.com/repos/github-api-test-org/test-labels/issues{/number}", - "pulls_url": "https://api.github.com/repos/github-api-test-org/test-labels/pulls{/number}", - "milestones_url": "https://api.github.com/repos/github-api-test-org/test-labels/milestones{/number}", - "notifications_url": "https://api.github.com/repos/github-api-test-org/test-labels/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/github-api-test-org/test-labels/labels{/name}", - "releases_url": "https://api.github.com/repos/github-api-test-org/test-labels/releases{/id}", - "deployments_url": "https://api.github.com/repos/github-api-test-org/test-labels/deployments", - "created_at": "2019-12-20T07:14:10Z", - "updated_at": "2019-12-20T07:14:10Z", - "pushed_at": "2019-12-20T07:14:11Z", - "git_url": "git://github.com/github-api-test-org/test-labels.git", - "ssh_url": "git@github.com:github-api-test-org/test-labels.git", - "clone_url": "https://github.com/github-api-test-org/test-labels.git", - "svn_url": "https://github.com/github-api-test-org/test-labels", - "homepage": null, + "url": "https://api.github.com/repos/github-api-test-org/temp-test_toString", + "forks_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/forks", + "keys_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/teams", + "hooks_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/hooks", + "issue_events_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/events", + "assignees_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/tags", + "blobs_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/languages", + "stargazers_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/stargazers", + "contributors_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/contributors", + "subscribers_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/subscribers", + "subscription_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/subscription", + "commits_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/merges", + "archive_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/downloads", + "issues_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/deployments", + "created_at": "2019-12-22T05:15:17Z", + "updated_at": "2019-12-22T05:15:21Z", + "pushed_at": "2019-12-22T05:15:19Z", + "git_url": "git://github.com/github-api-test-org/temp-test_toString.git", + "ssh_url": "git@github.com:github-api-test-org/temp-test_toString.git", + "clone_url": "https://github.com/github-api-test-org/temp-test_toString.git", + "svn_url": "https://github.com/github-api-test-org/temp-test_toString", + "homepage": "http://github-api.kohsuke.org/", "size": 0, "stargazers_count": 0, "watchers_count": 0, diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/repos_github-api-test-org_temp-test_tostring_labels-b1aef196-d0b5-4fc8-a538-fe1362aa63e0.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/repos_github-api-test-org_temp-test_tostring_labels-b1aef196-d0b5-4fc8-a538-fe1362aa63e0.json new file mode 100644 index 0000000000..9113a024b7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/__files/repos_github-api-test-org_temp-test_tostring_labels-b1aef196-d0b5-4fc8-a538-fe1362aa63e0.json @@ -0,0 +1,92 @@ +[ + { + "id": 1747637662, + "node_id": "MDU6TGFiZWwxNzQ3NjM3NjYy", + "url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/labels/bug", + "name": "bug", + "color": "d73a4a", + "default": true, + "description": "Something isn't working" + }, + { + "id": 1747637664, + "node_id": "MDU6TGFiZWwxNzQ3NjM3NjY0", + "url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/labels/documentation", + "name": "documentation", + "color": "0075ca", + "default": true, + "description": "Improvements or additions to documentation" + }, + { + "id": 1747637665, + "node_id": "MDU6TGFiZWwxNzQ3NjM3NjY1", + "url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/labels/duplicate", + "name": "duplicate", + "color": "cfd3d7", + "default": true, + "description": "This issue or pull request already exists" + }, + { + "id": 1747637667, + "node_id": "MDU6TGFiZWwxNzQ3NjM3NjY3", + "url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/labels/enhancement", + "name": "enhancement", + "color": "a2eeef", + "default": true, + "description": "New feature or request" + }, + { + "id": 1747637719, + "node_id": "MDU6TGFiZWwxNzQ3NjM3NzE5", + "url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/labels/foo", + "name": "foo", + "color": "001122", + "default": false, + "description": "test foo label" + }, + { + "id": 1747637669, + "node_id": "MDU6TGFiZWwxNzQ3NjM3NjY5", + "url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/labels/good%20first%20issue", + "name": "good first issue", + "color": "7057ff", + "default": true, + "description": "Good for newcomers" + }, + { + "id": 1747637671, + "node_id": "MDU6TGFiZWwxNzQ3NjM3Njcx", + "url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/labels/help%20wanted", + "name": "help wanted", + "color": "008672", + "default": true, + "description": "Extra attention is needed" + }, + { + "id": 1747637674, + "node_id": "MDU6TGFiZWwxNzQ3NjM3Njc0", + "url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/labels/invalid", + "name": "invalid", + "color": "e4e669", + "default": true, + "description": "This doesn't seem right" + }, + { + "id": 1747637675, + "node_id": "MDU6TGFiZWwxNzQ3NjM3Njc1", + "url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/labels/question", + "name": "question", + "color": "d876e3", + "default": true, + "description": "Further information is requested" + }, + { + "id": 1747637677, + "node_id": "MDU6TGFiZWwxNzQ3NjM3Njc3", + "url": "https://api.github.com/repos/github-api-test-org/temp-test_toString/labels/wontfix", + "name": "wontfix", + "color": "ffffff", + "default": true, + "description": "This will not be worked on" + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels-2-ab0de8.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_temp-test_tostring-1-667912.json similarity index 63% rename from src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels-2-ab0de8.json rename to src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_temp-test_tostring-1-667912.json index 6fa11e53b2..60f85e983d 100644 --- a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels-2-ab0de8.json +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_temp-test_tostring-1-667912.json @@ -1,8 +1,8 @@ { - "id": "ab0de86d-86f9-4c4a-971d-16da0851f6ae", - "name": "repos_github-api-test-org_test-labels", + "id": "66791257-bc14-4b7c-bd5a-ec08788e4f39", + "name": "repos_github-api-test-org_temp-test_tostring", "request": { - "url": "/repos/github-api-test-org/test-labels", + "url": "/repos/github-api-test-org/temp-test_toString", "method": "GET", "headers": { "Accept": { @@ -12,20 +12,20 @@ }, "response": { "status": 200, - "bodyFileName": "repos_github-api-test-org_test-labels-ab0de86d-86f9-4c4a-971d-16da0851f6ae.json", + "bodyFileName": "repos_github-api-test-org_temp-test_tostring-66791257-bc14-4b7c-bd5a-ec08788e4f39.json", "headers": { "Server": "GitHub.com", - "Date": "Fri, 20 Dec 2019 07:15:32 GMT", + "Date": "Sun, 22 Dec 2019 05:15:22 GMT", "Content-Type": "application/json; charset=utf-8", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4986", - "X-RateLimit-Reset": "1576829624", + "X-RateLimit-Remaining": "4974", + "X-RateLimit-Reset": "1576995265", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", - "ETag": "W/\"85053b22f5c31079acccbcf5bfaa28e7\"", - "Last-Modified": "Fri, 20 Dec 2019 07:14:10 GMT", - "X-OAuth-Scopes": "admin:org, repo", + "ETag": "W/\"2655f9a48a23b97da69f41d2a781b619\"", + "Last-Modified": "Sun, 22 Dec 2019 05:15:21 GMT", + "X-OAuth-Scopes": "admin:org, delete_repo, repo", "X-Accepted-OAuth-Scopes": "repo", "X-GitHub-Media-Type": "unknown, github.v3", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", @@ -36,10 +36,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": "83F3:71F2:2997D5:67DDC8:5DFC7513" + "X-GitHub-Request-Id": "F99D:4B3C:75C287:1129E2F:5DFEFBEA" } }, - "uuid": "ab0de86d-86f9-4c4a-971d-16da0851f6ae", + "uuid": "66791257-bc14-4b7c-bd5a-ec08788e4f39", "persistent": true, - "insertionIndex": 2 + "insertionIndex": 1 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels-3-03f3e6.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_temp-test_tostring_labels-2-015b90.json similarity index 64% rename from src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels-3-03f3e6.json rename to src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_temp-test_tostring_labels-2-015b90.json index 78d4ba89d2..f5703e16a7 100644 --- a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_create_updateLabel/mappings/repos_github-api-test-org_test-labels_labels-3-03f3e6.json +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_temp-test_tostring_labels-2-015b90.json @@ -1,8 +1,8 @@ { - "id": "03f3e613-ec17-4061-9449-5a6d77340e95", - "name": "repos_github-api-test-org_test-labels_labels", + "id": "015b90d7-0429-4719-bf92-91c41ccd5775", + "name": "repos_github-api-test-org_temp-test_tostring_labels", "request": { - "url": "/repos/github-api-test-org/test-labels/labels", + "url": "/repos/github-api-test-org/temp-test_toString/labels", "method": "POST", "headers": { "Accept": { @@ -19,21 +19,21 @@ }, "response": { "status": 201, - "body": "{\"id\":1744812383,\"node_id\":\"MDU6TGFiZWwxNzQ0ODEyMzgz\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/foo\",\"name\":\"foo\",\"color\":\"001122\",\"default\":false,\"description\":\"test foo label\"}", + "body": "{\"id\":1747637719,\"node_id\":\"MDU6TGFiZWwxNzQ3NjM3NzE5\",\"url\":\"https://api.github.com/repos/github-api-test-org/temp-test_toString/labels/foo\",\"name\":\"foo\",\"color\":\"001122\",\"default\":false,\"description\":\"test foo label\"}", "headers": { "Server": "GitHub.com", - "Date": "Fri, 20 Dec 2019 07:15:32 GMT", + "Date": "Sun, 22 Dec 2019 05:15:23 GMT", "Content-Type": "application/json; charset=utf-8", "Status": "201 Created", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4985", - "X-RateLimit-Reset": "1576829624", + "X-RateLimit-Remaining": "4973", + "X-RateLimit-Reset": "1576995265", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", - "ETag": "\"ecc66d756e13197c60516c1d21a24d03\"", - "X-OAuth-Scopes": "admin:org, repo", + "ETag": "\"cc28330c01f358b0ba11f0c6d0eced7a\"", + "X-OAuth-Scopes": "admin:org, delete_repo, repo", "X-Accepted-OAuth-Scopes": "", - "Location": "https://api.github.com/repos/github-api-test-org/test-labels/labels/foo", + "Location": "https://api.github.com/repos/github-api-test-org/temp-test_toString/labels/foo", "X-GitHub-Media-Type": "unknown, github.v3", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", @@ -43,10 +43,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": "83F3:71F2:2997DA:67DDD8:5DFC7514" + "X-GitHub-Request-Id": "F99D:4B3C:75C28D:1129E3C:5DFEFBEA" } }, - "uuid": "03f3e613-ec17-4061-9449-5a6d77340e95", + "uuid": "015b90d7-0429-4719-bf92-91c41ccd5775", "persistent": true, - "insertionIndex": 3 + "insertionIndex": 2 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels-2-0e01be.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_temp-test_tostring_labels-3-b1aef1.json similarity index 64% rename from src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels-2-0e01be.json rename to src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_temp-test_tostring_labels-3-b1aef1.json index 136c5c5cd4..43b4d80a97 100644 --- a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels-2-0e01be.json +++ b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_temp-test_tostring_labels-3-b1aef1.json @@ -1,8 +1,8 @@ { - "id": "0e01bea9-8d15-44a9-826e-bcc7a0a7e882", - "name": "repos_github-api-test-org_test-labels", + "id": "b1aef196-d0b5-4fc8-a538-fe1362aa63e0", + "name": "repos_github-api-test-org_temp-test_tostring_labels", "request": { - "url": "/repos/github-api-test-org/test-labels", + "url": "/repos/github-api-test-org/temp-test_toString/labels", "method": "GET", "headers": { "Accept": { @@ -12,20 +12,19 @@ }, "response": { "status": 200, - "bodyFileName": "repos_github-api-test-org_test-labels-0e01bea9-8d15-44a9-826e-bcc7a0a7e882.json", + "bodyFileName": "repos_github-api-test-org_temp-test_tostring_labels-b1aef196-d0b5-4fc8-a538-fe1362aa63e0.json", "headers": { "Server": "GitHub.com", - "Date": "Fri, 20 Dec 2019 07:15:34 GMT", + "Date": "Sun, 22 Dec 2019 05:15:23 GMT", "Content-Type": "application/json; charset=utf-8", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4981", - "X-RateLimit-Reset": "1576829624", + "X-RateLimit-Remaining": "4972", + "X-RateLimit-Reset": "1576995265", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", - "ETag": "W/\"85053b22f5c31079acccbcf5bfaa28e7\"", - "Last-Modified": "Fri, 20 Dec 2019 07:14:10 GMT", - "X-OAuth-Scopes": "admin:org, repo", + "ETag": "W/\"40d077cf6b500998dbfde72b0d37bc5c\"", + "X-OAuth-Scopes": "admin:org, delete_repo, repo", "X-Accepted-OAuth-Scopes": "repo", "X-GitHub-Media-Type": "unknown, github.v3", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", @@ -36,10 +35,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": "B19B:3205:5B4C25:DEAF22:5DFC7516" + "X-GitHub-Request-Id": "F99D:4B3C:75C297:1129E4B:5DFEFBEB" } }, - "uuid": "0e01bea9-8d15-44a9-826e-bcc7a0a7e882", + "uuid": "b1aef196-d0b5-4fc8-a538-fe1362aa63e0", "persistent": true, - "insertionIndex": 2 + "insertionIndex": 3 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels_labels-4-02b0fe.json b/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels_labels-4-02b0fe.json deleted file mode 100644 index 2f153d2d0b..0000000000 --- a/src/test/resources/org/kohsuke/github/GHLabelTest/wiremock/test_toString/mappings/repos_github-api-test-org_test-labels_labels-4-02b0fe.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "id": "02b0fee0-7409-48c7-aa38-c53ae5bd2211", - "name": "repos_github-api-test-org_test-labels_labels", - "request": { - "url": "/repos/github-api-test-org/test-labels/labels", - "method": "GET", - "headers": { - "Accept": { - "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" - } - } - }, - "response": { - "status": 200, - "body": "[{\"id\":1744812431,\"node_id\":\"MDU6TGFiZWwxNzQ0ODEyNDMx\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/foo\",\"name\":\"foo\",\"color\":\"001122\",\"default\":false,\"description\":\"test foo label\"}]", - "headers": { - "Server": "GitHub.com", - "Date": "Fri, 20 Dec 2019 07:15:34 GMT", - "Content-Type": "application/json; charset=utf-8", - "Status": "200 OK", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4979", - "X-RateLimit-Reset": "1576829624", - "Cache-Control": "private, max-age=60, s-maxage=60", - "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", - "ETag": "W/\"06a16c807a6f56ac47a65fa11aa63480\"", - "X-OAuth-Scopes": "admin:org, repo", - "X-Accepted-OAuth-Scopes": "repo", - "X-GitHub-Media-Type": "unknown, github.v3", - "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", - "Access-Control-Allow-Origin": "*", - "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", - "X-Frame-Options": "deny", - "X-Content-Type-Options": "nosniff", - "X-XSS-Protection": "1; mode=block", - "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", - "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "B19B:3205:5B4C3B:DEAF4A:5DFC7516" - } - }, - "uuid": "02b0fee0-7409-48c7-aa38-c53ae5bd2211", - "persistent": true, - "insertionIndex": 4 -} \ No newline at end of file