-
Notifications
You must be signed in to change notification settings - Fork 735
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1372 from antrix190/main
Adding Star/Unstar Methods
- Loading branch information
Showing
13 changed files
with
737 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...es/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/__files/orgs_hub4j-test-org.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"login": "hub4j-test-org", | ||
"id": 7544739, | ||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", | ||
"url": "https://api.github.com/orgs/hub4j-test-org", | ||
"repos_url": "https://api.github.com/orgs/hub4j-test-org/repos", | ||
"events_url": "https://api.github.com/orgs/hub4j-test-org/events", | ||
"hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks", | ||
"issues_url": "https://api.github.com/orgs/hub4j-test-org/issues", | ||
"members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}", | ||
"public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}", | ||
"avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", | ||
"description": null, | ||
"is_verified": false, | ||
"has_organization_projects": true, | ||
"has_repository_projects": true, | ||
"public_repos": 9, | ||
"public_gists": 0, | ||
"followers": 0, | ||
"following": 0, | ||
"html_url": "https://github.com/hub4j-test-org", | ||
"created_at": "2014-05-10T19:39:11Z", | ||
"updated_at": "2015-04-20T00:42:30Z", | ||
"type": "Organization", | ||
"total_private_repos": 0, | ||
"owned_private_repos": 0, | ||
"private_gists": 0, | ||
"disk_usage": 132, | ||
"collaborators": 0, | ||
"billing_email": "[email protected]", | ||
"default_repository_permission": "none", | ||
"members_can_create_repositories": false, | ||
"two_factor_requirement_enabled": false, | ||
"plan": { | ||
"name": "free", | ||
"space": 976562499, | ||
"private_repos": 0, | ||
"filled_seats": 10, | ||
"seats": 0 | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...positoryTest/wiremock/starTest/__files/repos_hub4j-test-org_github-api-starred-users.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[ | ||
{ | ||
"starred_at": "2010-04-19T04:13:03Z", | ||
"user": { | ||
"login": "hub4j-test-org", | ||
"id": 9799, | ||
"node_id": "MDQ6VXNlcjk3OTk=", | ||
"avatar_url": "https://avatars.githubusercontent.com/u/9799?v=4", | ||
"gravatar_id": "", | ||
"url": "https://api.github.com/users/hub4j-test-org", | ||
"html_url": "https://github.com/hub4j-test-org", | ||
"followers_url": "https://api.github.com/users/hub4j-test-org/followers", | ||
"following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", | ||
"gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", | ||
"starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", | ||
"subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", | ||
"organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", | ||
"repos_url": "https://api.github.com/users/hub4j-test-org/repos", | ||
"events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", | ||
"received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", | ||
"type": "User", | ||
"site_admin": false | ||
} | ||
} | ||
] |
330 changes: 330 additions & 0 deletions
330
...ke/github/GHRepositoryTest/wiremock/starTest/__files/repos_hub4j-test-org_github-api.json
Large diffs are not rendered by default.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/__files/user.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"login": "hub4j-test-org", | ||
"id": 1958953, | ||
"node_id": "MDQ6VXNlcjE5NTg5NTM=", | ||
"avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", | ||
"gravatar_id": "", | ||
"url": "https://api.github.com/users/hub4j-test-org", | ||
"html_url": "https://github.com/hub4j-test-org", | ||
"followers_url": "https://api.github.com/users/hub4j-test-org/followers", | ||
"following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", | ||
"gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", | ||
"starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", | ||
"subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", | ||
"organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", | ||
"repos_url": "https://api.github.com/users/hub4j-test-org/repos", | ||
"events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", | ||
"received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", | ||
"type": "User", | ||
"site_admin": false, | ||
"name": "Liam Newman", | ||
"company": "Cloudbees, Inc.", | ||
"blog": "", | ||
"location": "Seattle, WA, USA", | ||
"email": "[email protected]", | ||
"hireable": null, | ||
"bio": "https://twitter.com/hub4j-test-org", | ||
"public_repos": 166, | ||
"public_gists": 4, | ||
"followers": 135, | ||
"following": 9, | ||
"created_at": "2012-07-11T20:38:33Z", | ||
"updated_at": "2019-09-24T19:32:29Z" | ||
} |
48 changes: 48 additions & 0 deletions
48
...s/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/orgs_hub4j-test-org.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"id": "d319a11c-9dce-4642-a18a-175f6cdbde6d", | ||
"name": "orgs_hub4j-test-org", | ||
"request": { | ||
"url": "/orgs/hub4j-test-org", | ||
"method": "GET", | ||
"headers": { | ||
"Accept": { | ||
"equalTo": "application/vnd.github.v3+json" | ||
} | ||
} | ||
}, | ||
"response": { | ||
"status": 200, | ||
"bodyFileName": "orgs_hub4j-test-org.json", | ||
"headers": { | ||
"Date": "Wed, 04 Dec 2019 17:07:18 GMT", | ||
"Content-Type": "application/json; charset=utf-8", | ||
"Server": "GitHub.com", | ||
"Status": "200 OK", | ||
"X-RateLimit-Limit": "5000", | ||
"X-RateLimit-Remaining": "4956", | ||
"X-RateLimit-Reset": "1575482837", | ||
"Cache-Control": "private, max-age=60, s-maxage=60", | ||
"Vary": [ | ||
"Accept, Authorization, Cookie, X-GitHub-OTP", | ||
"Accept-Encoding" | ||
], | ||
"ETag": "W/\"1de516fab0228945881043c1bc527c88\"", | ||
"Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", | ||
"X-OAuth-Scopes": "gist, notifications, read:org, read:public_key, read:repo_hook, 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": "A585:3D530:D2A1AF3:FAB1EAD:5DE7E7C5" | ||
} | ||
}, | ||
"uuid": "d319a11c-9dce-4642-a18a-175f6cdbde6d", | ||
"persistent": true, | ||
"insertionIndex": 2 | ||
} |
16 changes: 16 additions & 0 deletions
16
.../GHRepositoryTest/wiremock/starTest/mappings/repos_hub4j-test-org_github-api-starred.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"id": "4c1e8c73-a989-4625-8582-5fa6a2f88f4d", | ||
"name": "repos_hub4j-test-org_github-api-starred", | ||
"request": { | ||
"url": "/user/starred/hub4j-test-org/github-api", | ||
"method": "PUT", | ||
"headers": { | ||
"Accept": { | ||
"equalTo": "application/vnd.github.v3+json" | ||
} | ||
} | ||
}, | ||
"response": { | ||
"status": 204 | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...HRepositoryTest/wiremock/starTest/mappings/repos_hub4j-test-org_github-api-unstarred.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"id": "4c1e8c73-a989-4625-8582-5fa6a2f88f4d", | ||
"name": "repos_hub4j-test-org_github-api-starred", | ||
"request": { | ||
"url": "/user/starred/hub4j-test-org/github-api", | ||
"method": "DELETE", | ||
"headers": { | ||
"Accept": { | ||
"equalTo": "application/vnd.github.v3+json" | ||
} | ||
} | ||
}, | ||
"response": { | ||
"status": 204 | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
...e/github/GHRepositoryTest/wiremock/starTest/mappings/repos_hub4j-test-org_github-api.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"id": "4c1e8c73-a989-4625-8582-5fa6a2f88f4d", | ||
"name": "repos_hub4j-test-org_github-api", | ||
"request": { | ||
"url": "/repos/hub4j-test-org/github-api", | ||
"method": "GET", | ||
"headers": { | ||
"Accept": { | ||
"equalTo": "application/vnd.github.v3+json" | ||
} | ||
} | ||
}, | ||
"response": { | ||
"status": 200, | ||
"bodyFileName": "repos_hub4j-test-org_github-api.json", | ||
"headers": { | ||
"Date": "Wed, 04 Dec 2019 17:07:19 GMT", | ||
"Content-Type": "application/json; charset=utf-8", | ||
"Server": "GitHub.com", | ||
"Status": "200 OK", | ||
"X-RateLimit-Limit": "5000", | ||
"X-RateLimit-Remaining": "4955", | ||
"X-RateLimit-Reset": "1575482837", | ||
"Cache-Control": "private, max-age=60, s-maxage=60", | ||
"Vary": [ | ||
"Accept, Authorization, Cookie, X-GitHub-OTP", | ||
"Accept-Encoding" | ||
], | ||
"ETag": "W/\"bd13c31938217e87f61c9a08bd0fe01d\"", | ||
"Last-Modified": "Thu, 07 Nov 2019 22:27:11 GMT", | ||
"X-OAuth-Scopes": "gist, notifications, read:org, read:public_key, read:repo_hook, 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": "A585:3D530:D2A1B48:FAB201E:5DE7E7C6" | ||
} | ||
}, | ||
"uuid": "4c1e8c73-a989-4625-8582-5fa6a2f88f4d", | ||
"persistent": true, | ||
"insertionIndex": 3 | ||
} |
47 changes: 47 additions & 0 deletions
47
...ositoryTest/wiremock/starTest/mappings/repos_hub4j-test-org_github-api_starred-users.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"id": "a8dd4fb9-0ec7-4a93-b642-193312795e64", | ||
"name": "repos_hub4j-test-org_github-api_stargazers", | ||
"request": { | ||
"url": "/repos/hub4j-test-org/github-api/stargazers", | ||
"method": "GET", | ||
"headers": { | ||
"Accept": { | ||
"equalTo": "application/vnd.github.v3.star+json" | ||
} | ||
} | ||
}, | ||
"response": { | ||
"status": 200, | ||
"bodyFileName": "repos_hub4j-test-org_github-api-starred-users.json", | ||
"headers": { | ||
"Date": "Mon, 25 Jan 2021 01:00:35 GMT", | ||
"Content-Type": "application/json; charset=utf-8", | ||
"Server": "GitHub.com", | ||
"Status": "200 OK", | ||
"Cache-Control": "private, max-age=60, s-maxage=60", | ||
"Vary": [ | ||
"Accept, Authorization, Cookie, X-GitHub-OTP", | ||
"Accept-Encoding, Accept, X-Requested-With", | ||
"Accept-Encoding" | ||
], | ||
"ETag": "\"c0ae8d4e2de626e3c17a734d124e620264c64895ab868c0914ace984cce8cef8\"", | ||
"X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, workflow, write:discussion", | ||
"X-Accepted-OAuth-Scopes": "", | ||
"X-GitHub-Media-Type": "github.v3; param=star; format=json", | ||
"X-RateLimit-Limit": "5000", | ||
"X-RateLimit-Remaining": "4943", | ||
"X-RateLimit-Reset": "1611538431", | ||
"x-ratelimit-used": "57", | ||
"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": "FEDB:9997:871A4E:9D45ED:600E1833" | ||
} | ||
}, | ||
"uuid": "a8dd4fb9-0ec7-4a93-b642-193312795e64", | ||
"persistent": true, | ||
"insertionIndex": 4 | ||
} |
47 changes: 47 additions & 0 deletions
47
...itoryTest/wiremock/starTest/mappings/repos_hub4j-test-org_github-api_unstarred-users.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"id": "a8dd4fb9-0ec7-4a93-b642-193312795e64", | ||
"name": "repos_hub4j-test-org_github-api_stargazers", | ||
"request": { | ||
"url": "/repos/hub4j-test-org/github-api/stargazers", | ||
"method": "GET", | ||
"headers": { | ||
"Accept": { | ||
"equalTo": "application/vnd.github.v3+json" | ||
} | ||
} | ||
}, | ||
"response": { | ||
"status": 200, | ||
"body": "[]", | ||
"headers": { | ||
"Date": "Mon, 25 Jan 2021 01:00:35 GMT", | ||
"Content-Type": "application/json; charset=utf-8", | ||
"Server": "GitHub.com", | ||
"Status": "200 OK", | ||
"Cache-Control": "private, max-age=60, s-maxage=60", | ||
"Vary": [ | ||
"Accept, Authorization, Cookie, X-GitHub-OTP", | ||
"Accept-Encoding, Accept, X-Requested-With", | ||
"Accept-Encoding" | ||
], | ||
"ETag": "\"c0ae8d4e2de626e3c17a734d124e620264c64895ab868c0914ace984cce8cef8\"", | ||
"X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, workflow, write:discussion", | ||
"X-Accepted-OAuth-Scopes": "", | ||
"X-GitHub-Media-Type": "github.v3; param=star; format=json", | ||
"X-RateLimit-Limit": "5000", | ||
"X-RateLimit-Remaining": "4943", | ||
"X-RateLimit-Reset": "1611538431", | ||
"x-ratelimit-used": "57", | ||
"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": "FEDB:9997:871A4E:9D45ED:600E1833" | ||
} | ||
}, | ||
"uuid": "a8dd4fb9-0ec7-4a93-b642-193312795e64", | ||
"persistent": true, | ||
"insertionIndex": 4 | ||
} |
Oops, something went wrong.