From 1165c88cc45fa625f887a6f7f47af3b62692922b Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Fri, 4 Mar 2022 11:41:40 +0100 Subject: [PATCH] Throw UnsupportedOperationException in long deprecated GitHub#getTeam(int) This API is not supported anymore. --- src/main/java/org/kohsuke/github/GitHub.java | 11 +- src/test/java/org/kohsuke/github/AppTest.java | 10 +- .../__files/orgs_hub4j-test-org-1.json} | 34 ++++-- .../__files/orgs_hub4j-test-org_teams-2.json | 112 ++++++++++++++++++ .../mappings/orgs_hub4j-test-org-1.json} | 33 +++--- .../orgs_hub4j-test-org_teams-2.json} | 31 ++--- .../organizations_7544739_team_820406-7.json | 43 ------- .../__files/orgs_hub4j-test-org_teams-3.json | 58 --------- .../__files/teams_820406-8.json | 43 ------- .../testShouldFetchTeam/__files/user-1.json | 45 ------- .../organizations_7544739_team_820406-7.json | 46 ------- .../organizations_7544739_teams_820406-6.json | 40 ------- ...zations_hub4j-test-org_teams_820406-5.json | 40 ------- .../orgs_hub4j-test-org_teams_820406-4.json | 40 ------- .../mappings/teams_820406-8.json | 49 -------- .../testShouldFetchTeam/mappings/user-1.json | 46 ------- 16 files changed, 181 insertions(+), 500 deletions(-) rename src/test/resources/org/kohsuke/github/AppTest/wiremock/{testShouldFetchTeam/__files/orgs_hub4j-test-org-2.json => testFetchingTeamFromGitHubInstanceThrowsException/__files/orgs_hub4j-test-org-1.json} (52%) create mode 100644 src/test/resources/org/kohsuke/github/AppTest/wiremock/testFetchingTeamFromGitHubInstanceThrowsException/__files/orgs_hub4j-test-org_teams-2.json rename src/test/resources/org/kohsuke/github/AppTest/wiremock/{testShouldFetchTeam/mappings/orgs_hub4j-test-org-2.json => testFetchingTeamFromGitHubInstanceThrowsException/mappings/orgs_hub4j-test-org-1.json} (54%) rename src/test/resources/org/kohsuke/github/AppTest/wiremock/{testShouldFetchTeam/mappings/orgs_hub4j-test-org_teams-3.json => testFetchingTeamFromGitHubInstanceThrowsException/mappings/orgs_hub4j-test-org_teams-2.json} (56%) delete mode 100644 src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/organizations_7544739_team_820406-7.json delete mode 100644 src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/orgs_hub4j-test-org_teams-3.json delete mode 100644 src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/teams_820406-8.json delete mode 100644 src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/user-1.json delete mode 100644 src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/organizations_7544739_team_820406-7.json delete mode 100644 src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/organizations_7544739_teams_820406-6.json delete mode 100644 src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/organizations_hub4j-test-org_teams_820406-5.json delete mode 100644 src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/orgs_hub4j-test-org_teams_820406-4.json delete mode 100644 src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/teams_820406-8.json delete mode 100644 src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/user-1.json diff --git a/src/main/java/org/kohsuke/github/GitHub.java b/src/main/java/org/kohsuke/github/GitHub.java index acf366c1dc..f81d8cbee6 100644 --- a/src/main/java/org/kohsuke/github/GitHub.java +++ b/src/main/java/org/kohsuke/github/GitHub.java @@ -874,7 +874,9 @@ public Map> getMyTeams() throws IOException { } /** - * Gets a sigle team by ID. + * Gets a single team by ID. + *

+ * This method is no longer supported and throws an UnsupportedOperationException. * * @param id * the id @@ -883,11 +885,14 @@ public Map> getMyTeams() throws IOException { * the io exception * * @deprecated Use {@link GHOrganization#getTeam(long)} - * @see deprecation notice + * @see deprecation notice + * @see sunset + * notice */ @Deprecated public GHTeam getTeam(int id) throws IOException { - return createRequest().withUrlPath("/teams/" + id).fetch(GHTeam.class).wrapUp(this); + throw new UnsupportedOperationException( + "This method is not supported anymore. Please use GHOrganization#getTeam(long)."); } /** diff --git a/src/test/java/org/kohsuke/github/AppTest.java b/src/test/java/org/kohsuke/github/AppTest.java index 494f3a7787..71f99bcb8e 100755 --- a/src/test/java/org/kohsuke/github/AppTest.java +++ b/src/test/java/org/kohsuke/github/AppTest.java @@ -21,6 +21,7 @@ import java.util.stream.Collectors; import static org.hamcrest.Matchers.*; +import static org.junit.Assert.assertThrows; /** * Unit test for simple App. @@ -444,15 +445,12 @@ private boolean shouldBelongToTeam(String organizationName, String teamName) thr } @Test - public void testShouldFetchTeam() throws Exception { + @SuppressWarnings("deprecation") + public void testFetchingTeamFromGitHubInstanceThrowsException() throws Exception { GHOrganization organization = gitHub.getOrganization(GITHUB_API_TEST_ORG); GHTeam teamByName = organization.getTeams().get("Core Developers"); - GHTeam teamById = gitHub.getTeam((int) teamByName.getId()); - assertThat(teamById, notNullValue()); - - assertThat(teamById.getId(), equalTo(teamByName.getId())); - assertThat(teamById.getDescription(), equalTo(teamByName.getDescription())); + assertThrows(UnsupportedOperationException.class, () -> gitHub.getTeam((int) teamByName.getId())); } @Test diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testFetchingTeamFromGitHubInstanceThrowsException/__files/orgs_hub4j-test-org-1.json similarity index 52% rename from src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/orgs_hub4j-test-org-2.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testFetchingTeamFromGitHubInstanceThrowsException/__files/orgs_hub4j-test-org-1.json index 8c0ba78353..162ceb1c73 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/orgs_hub4j-test-org-2.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testFetchingTeamFromGitHubInstanceThrowsException/__files/orgs_hub4j-test-org-1.json @@ -9,33 +9,47 @@ "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, + "avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4", + "description": "Hub4j Test Org Description (this could be null or blank too)", + "name": "Hub4j Test Org Name (this could be null or blank too)", + "company": null, + "blog": "https://hub4j.url.io/could/be/null", + "location": "Hub4j Test Org Location (this could be null or blank too)", + "email": "hub4jtestorgemail@could.be.null.com", + "twitter_username": null, "is_verified": false, "has_organization_projects": true, "has_repository_projects": true, - "public_repos": 26, + "public_repos": 49, "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", + "updated_at": "2020-06-04T05:56:10Z", "type": "Organization", - "total_private_repos": 0, - "owned_private_repos": 0, + "total_private_repos": 3, + "owned_private_repos": 3, "private_gists": 0, - "disk_usage": 147, + "disk_usage": 11979, "collaborators": 0, "billing_email": "kk@kohsuke.org", "default_repository_permission": "none", "members_can_create_repositories": false, "two_factor_requirement_enabled": false, + "members_allowed_repository_creation_type": "none", + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": false, + "members_can_create_internal_repositories": false, + "members_can_create_pages": true, + "members_can_fork_private_repositories": false, + "members_can_create_public_pages": true, + "members_can_create_private_pages": true, "plan": { "name": "free", "space": 976562499, - "private_repos": 0, - "filled_seats": 13, - "seats": 0 + "private_repos": 10000, + "filled_seats": 35, + "seats": 3 } } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testFetchingTeamFromGitHubInstanceThrowsException/__files/orgs_hub4j-test-org_teams-2.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testFetchingTeamFromGitHubInstanceThrowsException/__files/orgs_hub4j-test-org_teams-2.json new file mode 100644 index 0000000000..45d36ec88e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testFetchingTeamFromGitHubInstanceThrowsException/__files/orgs_hub4j-test-org_teams-2.json @@ -0,0 +1,112 @@ +[ + { + "name": "child-team-for-dummy", + "id": 3903497, + "node_id": "MDQ6VGVhbTM5MDM0OTc=", + "slug": "child-team-for-dummy", + "description": "to test the fetching of child teams", + "privacy": "closed", + "url": "https://api.github.com/organizations/7544739/team/3903497", + "html_url": "https://github.com/orgs/hub4j-test-org/teams/child-team-for-dummy", + "members_url": "https://api.github.com/organizations/7544739/team/3903497/members{/member}", + "repositories_url": "https://api.github.com/organizations/7544739/team/3903497/repos", + "permission": "pull", + "parent": { + "name": "dummy-team", + "id": 3451996, + "node_id": "MDQ6VGVhbTM0NTE5OTY=", + "slug": "dummy-team", + "description": "Updated by API TestModified", + "privacy": "closed", + "url": "https://api.github.com/organizations/7544739/team/3451996", + "html_url": "https://github.com/orgs/hub4j-test-org/teams/dummy-team", + "members_url": "https://api.github.com/organizations/7544739/team/3451996/members{/member}", + "repositories_url": "https://api.github.com/organizations/7544739/team/3451996/repos", + "permission": "pull" + } + }, + { + "name": "Contributors", + "id": 4882699, + "node_id": "MDQ6VGVhbTQ4ODI2OTk=", + "slug": "contributors", + "description": "", + "privacy": "closed", + "url": "https://api.github.com/organizations/7544739/team/4882699", + "html_url": "https://github.com/orgs/hub4j-test-org/teams/contributors", + "members_url": "https://api.github.com/organizations/7544739/team/4882699/members{/member}", + "repositories_url": "https://api.github.com/organizations/7544739/team/4882699/repos", + "permission": "pull", + "parent": null + }, + { + "name": "Core Developers", + "id": 820406, + "node_id": "MDQ6VGVhbTgyMDQwNg==", + "slug": "core-developers", + "description": "A random team", + "privacy": "secret", + "url": "https://api.github.com/organizations/7544739/team/820406", + "html_url": "https://github.com/orgs/hub4j-test-org/teams/core-developers", + "members_url": "https://api.github.com/organizations/7544739/team/820406/members{/member}", + "repositories_url": "https://api.github.com/organizations/7544739/team/820406/repos", + "permission": "pull", + "parent": null + }, + { + "name": "dummy-team", + "id": 3451996, + "node_id": "MDQ6VGVhbTM0NTE5OTY=", + "slug": "dummy-team", + "description": "Updated by API TestModified", + "privacy": "closed", + "url": "https://api.github.com/organizations/7544739/team/3451996", + "html_url": "https://github.com/orgs/hub4j-test-org/teams/dummy-team", + "members_url": "https://api.github.com/organizations/7544739/team/3451996/members{/member}", + "repositories_url": "https://api.github.com/organizations/7544739/team/3451996/repos", + "permission": "pull", + "parent": null + }, + { + "name": "Owners-team", + "id": 820404, + "node_id": "MDQ6VGVhbTgyMDQwNA==", + "slug": "owners-team", + "description": null, + "privacy": "secret", + "url": "https://api.github.com/organizations/7544739/team/820404", + "html_url": "https://github.com/orgs/hub4j-test-org/teams/owners-team", + "members_url": "https://api.github.com/organizations/7544739/team/820404/members{/member}", + "repositories_url": "https://api.github.com/organizations/7544739/team/820404/repos", + "permission": "pull", + "parent": null + }, + { + "name": "simple-team", + "id": 3947450, + "node_id": "MDQ6VGVhbTM5NDc0NTA=", + "slug": "simple-team", + "description": "A simple team with no children", + "privacy": "secret", + "url": "https://api.github.com/organizations/7544739/team/3947450", + "html_url": "https://github.com/orgs/hub4j-test-org/teams/simple-team", + "members_url": "https://api.github.com/organizations/7544739/team/3947450/members{/member}", + "repositories_url": "https://api.github.com/organizations/7544739/team/3947450/repos", + "permission": "pull", + "parent": null + }, + { + "name": "tricky-team", + "id": 3454508, + "node_id": "MDQ6VGVhbTM0NTQ1MDg=", + "slug": "tricky-team", + "description": "", + "privacy": "secret", + "url": "https://api.github.com/organizations/7544739/team/3454508", + "html_url": "https://github.com/orgs/hub4j-test-org/teams/tricky-team", + "members_url": "https://api.github.com/organizations/7544739/team/3454508/members{/member}", + "repositories_url": "https://api.github.com/organizations/7544739/team/3454508/repos", + "permission": "pull", + "parent": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testFetchingTeamFromGitHubInstanceThrowsException/mappings/orgs_hub4j-test-org-1.json similarity index 54% rename from src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/orgs_hub4j-test-org-2.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testFetchingTeamFromGitHubInstanceThrowsException/mappings/orgs_hub4j-test-org-1.json index fc86bec901..ef0cc6275d 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/orgs_hub4j-test-org-2.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testFetchingTeamFromGitHubInstanceThrowsException/mappings/orgs_hub4j-test-org-1.json @@ -1,5 +1,5 @@ { - "id": "84aa5465-24ab-43e3-9655-e835c39bfa65", + "id": "3c0fb9cd-6289-4f5c-baea-1bd6980a9d15", "name": "orgs_hub4j-test-org", "request": { "url": "/orgs/hub4j-test-org", @@ -12,35 +12,36 @@ }, "response": { "status": 200, - "bodyFileName": "orgs_hub4j-test-org-2.json", + "bodyFileName": "orgs_hub4j-test-org-1.json", "headers": { - "Date": "Tue, 17 Mar 2020 10:05:32 GMT", - "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", - "Status": "200 OK", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4937", - "X-RateLimit-Reset": "1584440312", + "Date": "Fri, 04 Mar 2022 19:26:44 GMT", + "Content-Type": "application/json; charset=utf-8", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"9d4203e09aeffc9b5325c2a5355275b5\"", - "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", - "X-OAuth-Scopes": "admin:org, admin:public_key, admin:repo_hook, notifications, repo, user", + "ETag": "W/\"861b38147d37bd59e507771e76ec048def20dd6e5ac5b75aceb01c8b9f0ef4f5\"", + "Last-Modified": "Thu, 04 Jun 2020 05:56:10 GMT", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, gist, notifications, repo, user, workflow, write:discussion", "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", - "X-GitHub-Media-Type": "unknown, github.v3", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4998", + "X-RateLimit-Reset": "1646424320", + "X-RateLimit-Used": "2", + "X-RateLimit-Resource": "core", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", "X-Frame-Options": "deny", "X-Content-Type-Options": "nosniff", - "X-XSS-Protection": "1; mode=block", + "X-XSS-Protection": "0", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "FBBC:4FD5:1C7954:325E0B:5E70A0EA" + "X-GitHub-Request-Id": "B678:265F:2A24E9B:2AE23A8:622267F3" } }, - "uuid": "84aa5465-24ab-43e3-9655-e835c39bfa65", + "uuid": "3c0fb9cd-6289-4f5c-baea-1bd6980a9d15", "persistent": true, - "insertionIndex": 2 + "insertionIndex": 1 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/orgs_hub4j-test-org_teams-3.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testFetchingTeamFromGitHubInstanceThrowsException/mappings/orgs_hub4j-test-org_teams-2.json similarity index 56% rename from src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/orgs_hub4j-test-org_teams-3.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testFetchingTeamFromGitHubInstanceThrowsException/mappings/orgs_hub4j-test-org_teams-2.json index dc7549599e..4a59d88b09 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/orgs_hub4j-test-org_teams-3.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testFetchingTeamFromGitHubInstanceThrowsException/mappings/orgs_hub4j-test-org_teams-2.json @@ -1,5 +1,5 @@ { - "id": "d833590f-9896-462c-846b-712b50377536", + "id": "ea1f3852-66f4-4238-b721-34f584b153dd", "name": "orgs_hub4j-test-org_teams", "request": { "url": "/orgs/hub4j-test-org/teams", @@ -12,34 +12,35 @@ }, "response": { "status": 200, - "bodyFileName": "orgs_hub4j-test-org_teams-3.json", + "bodyFileName": "orgs_hub4j-test-org_teams-2.json", "headers": { - "Date": "Tue, 17 Mar 2020 10:05:32 GMT", - "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", - "Status": "200 OK", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4936", - "X-RateLimit-Reset": "1584440312", + "Date": "Fri, 04 Mar 2022 19:26:44 GMT", + "Content-Type": "application/json; charset=utf-8", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"54e42fc30d88d2a30340b56bbe54f211\"", - "X-OAuth-Scopes": "admin:org, admin:public_key, admin:repo_hook, notifications, repo, user", + "ETag": "W/\"1964a2ad48a21e85f64539404f5b8da870c58d1e9f3f8cf1b2dd8b6969b2c909\"", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, gist, notifications, repo, user, workflow, write:discussion", "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", - "X-GitHub-Media-Type": "unknown, github.v3", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4997", + "X-RateLimit-Reset": "1646424320", + "X-RateLimit-Used": "3", + "X-RateLimit-Resource": "core", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", "X-Frame-Options": "deny", "X-Content-Type-Options": "nosniff", - "X-XSS-Protection": "1; mode=block", + "X-XSS-Protection": "0", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "FBBC:4FD5:1C7963:325E5F:5E70A0EC" + "X-GitHub-Request-Id": "B67A:2658:7E2214:85CE23:622267F4" } }, - "uuid": "d833590f-9896-462c-846b-712b50377536", + "uuid": "ea1f3852-66f4-4238-b721-34f584b153dd", "persistent": true, - "insertionIndex": 3 + "insertionIndex": 2 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/organizations_7544739_team_820406-7.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/organizations_7544739_team_820406-7.json deleted file mode 100644 index 1eca382b74..0000000000 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/organizations_7544739_team_820406-7.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "Core Developers", - "id": 820406, - "node_id": "MDQ6VGVhbTgyMDQwNg==", - "slug": "core-developers", - "description": "A random team", - "privacy": "secret", - "url": "https://api.github.com/organizations/7544739/team/820406", - "html_url": "https://github.com/orgs/hub4j-test-org/teams/core-developers", - "members_url": "https://api.github.com/organizations/7544739/team/820406/members{/member}", - "repositories_url": "https://api.github.com/organizations/7544739/team/820406/repos", - "permission": "pull", - "created_at": "2014-05-10T19:40:03Z", - "updated_at": "2014-05-10T19:40:03Z", - "members_count": 1, - "repos_count": 1, - "organization": { - "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": 26, - "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" - }, - "parent": null -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/orgs_hub4j-test-org_teams-3.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/orgs_hub4j-test-org_teams-3.json deleted file mode 100644 index d712f928dd..0000000000 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/orgs_hub4j-test-org_teams-3.json +++ /dev/null @@ -1,58 +0,0 @@ -[ - { - "name": "Core Developers", - "id": 820406, - "node_id": "MDQ6VGVhbTgyMDQwNg==", - "slug": "core-developers", - "description": "A random team", - "privacy": "secret", - "url": "https://api.github.com/organizations/7544739/team/820406", - "html_url": "https://github.com/orgs/hub4j-test-org/teams/core-developers", - "members_url": "https://api.github.com/organizations/7544739/team/820406/members{/member}", - "repositories_url": "https://api.github.com/organizations/7544739/team/820406/repos", - "permission": "pull", - "parent": null - }, - { - "name": "dummy-team", - "id": 3451996, - "node_id": "MDQ6VGVhbTM0NTE5OTY=", - "slug": "dummy-team", - "description": "Updated by API TestModified", - "privacy": "secret", - "url": "https://api.github.com/organizations/7544739/team/3451996", - "html_url": "https://github.com/orgs/hub4j-test-org/teams/dummy-team", - "members_url": "https://api.github.com/organizations/7544739/team/3451996/members{/member}", - "repositories_url": "https://api.github.com/organizations/7544739/team/3451996/repos", - "permission": "pull", - "parent": null - }, - { - "name": "Owners-team", - "id": 820404, - "node_id": "MDQ6VGVhbTgyMDQwNA==", - "slug": "owners-team", - "description": null, - "privacy": "secret", - "url": "https://api.github.com/organizations/7544739/team/820404", - "html_url": "https://github.com/orgs/hub4j-test-org/teams/owners-team", - "members_url": "https://api.github.com/organizations/7544739/team/820404/members{/member}", - "repositories_url": "https://api.github.com/organizations/7544739/team/820404/repos", - "permission": "admin", - "parent": null - }, - { - "name": "tricky-team", - "id": 3454508, - "node_id": "MDQ6VGVhbTM0NTQ1MDg=", - "slug": "tricky-team", - "description": "", - "privacy": "secret", - "url": "https://api.github.com/organizations/7544739/team/3454508", - "html_url": "https://github.com/orgs/hub4j-test-org/teams/tricky-team", - "members_url": "https://api.github.com/organizations/7544739/team/3454508/members{/member}", - "repositories_url": "https://api.github.com/organizations/7544739/team/3454508/repos", - "permission": "pull", - "parent": null - } -] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/teams_820406-8.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/teams_820406-8.json deleted file mode 100644 index 1eca382b74..0000000000 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/teams_820406-8.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "Core Developers", - "id": 820406, - "node_id": "MDQ6VGVhbTgyMDQwNg==", - "slug": "core-developers", - "description": "A random team", - "privacy": "secret", - "url": "https://api.github.com/organizations/7544739/team/820406", - "html_url": "https://github.com/orgs/hub4j-test-org/teams/core-developers", - "members_url": "https://api.github.com/organizations/7544739/team/820406/members{/member}", - "repositories_url": "https://api.github.com/organizations/7544739/team/820406/repos", - "permission": "pull", - "created_at": "2014-05-10T19:40:03Z", - "updated_at": "2014-05-10T19:40:03Z", - "members_count": 1, - "repos_count": 1, - "organization": { - "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": 26, - "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" - }, - "parent": null -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/user-1.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/user-1.json deleted file mode 100644 index 3ed6e3f008..0000000000 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/user-1.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "login": "ingwarsw", - "id": 5390156, - "node_id": "MDQ6VXNlcjUzOTAxNTY=", - "avatar_url": "https://avatars2.githubusercontent.com/u/5390156?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/ingwarsw", - "html_url": "https://github.com/ingwarsw", - "followers_url": "https://api.github.com/users/ingwarsw/followers", - "following_url": "https://api.github.com/users/ingwarsw/following{/other_user}", - "gists_url": "https://api.github.com/users/ingwarsw/gists{/gist_id}", - "starred_url": "https://api.github.com/users/ingwarsw/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/ingwarsw/subscriptions", - "organizations_url": "https://api.github.com/users/ingwarsw/orgs", - "repos_url": "https://api.github.com/users/ingwarsw/repos", - "events_url": "https://api.github.com/users/ingwarsw/events{/privacy}", - "received_events_url": "https://api.github.com/users/ingwarsw/received_events", - "type": "User", - "site_admin": false, - "name": "Karol Lassak", - "company": "Ingwar & co.", - "blog": "ingwar.eu.org", - "location": "Warsaw, Poland", - "email": "ingwar@ingwar.eu.org", - "hireable": true, - "bio": null, - "public_repos": 38, - "public_gists": 0, - "followers": 14, - "following": 3, - "created_at": "2013-09-05T09:58:28Z", - "updated_at": "2020-03-17T08:28:47Z", - "private_gists": 3, - "total_private_repos": 3, - "owned_private_repos": 3, - "disk_usage": 83478, - "collaborators": 4, - "two_factor_authentication": true, - "plan": { - "name": "free", - "space": 976562499, - "collaborators": 0, - "private_repos": 10000 - } -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/organizations_7544739_team_820406-7.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/organizations_7544739_team_820406-7.json deleted file mode 100644 index ab6a3d689d..0000000000 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/organizations_7544739_team_820406-7.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "id": "8b1ba756-0fb7-49bf-8cd8-0febdccefd7e", - "name": "organizations_7544739_team_820406", - "request": { - "url": "/organizations/7544739/team/820406", - "method": "GET", - "headers": { - "Accept": { - "equalTo": "application/vnd.github.v3+json" - } - } - }, - "response": { - "status": 200, - "bodyFileName": "organizations_7544739_team_820406-7.json", - "headers": { - "Server": "GitHub.com", - "Date": "Tue, 17 Mar 2020 10:16:04 GMT", - "Content-Type": "application/json; charset=utf-8", - "Status": "200 OK", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4906", - "X-RateLimit-Reset": "1584440312", - "Cache-Control": "private, max-age=60, s-maxage=60", - "Vary": [ - "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding, Accept, X-Requested-With" - ], - "ETag": "W/\"1201d96396c062b2208db689dc6a3887\"", - "Last-Modified": "Sat, 10 May 2014 19:40:03 GMT", - "X-OAuth-Scopes": "admin:org, admin:public_key, admin:repo_hook, notifications, repo, user", - "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", - "X-GitHub-Media-Type": "unknown, github.v3", - "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", - "X-Frame-Options": "deny", - "X-Content-Type-Options": "nosniff", - "X-XSS-Protection": "1; mode=block", - "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", - "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "FC63:2DE2:1A9560A:3DC8D98:5E70A364" - } - }, - "uuid": "8b1ba756-0fb7-49bf-8cd8-0febdccefd7e", - "persistent": true, - "insertionIndex": 7 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/organizations_7544739_teams_820406-6.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/organizations_7544739_teams_820406-6.json deleted file mode 100644 index 965e32b3d9..0000000000 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/organizations_7544739_teams_820406-6.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "id": "20a9519b-5770-4618-9df7-f514b6530e27", - "name": "organizations_7544739_teams_820406", - "request": { - "url": "/organizations/7544739/teams/820406", - "method": "GET", - "headers": { - "Accept": { - "equalTo": "application/vnd.github.v3+json" - } - } - }, - "response": { - "status": 404, - "body": "{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/teams/#get-team-by-name\"}", - "headers": { - "Server": "GitHub.com", - "Date": "Tue, 17 Mar 2020 10:13:13 GMT", - "Content-Type": "application/json; charset=utf-8", - "Status": "404 Not Found", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4913", - "X-RateLimit-Reset": "1584440312", - "X-OAuth-Scopes": "admin:org, admin:public_key, admin:repo_hook, notifications, repo, user", - "X-Accepted-OAuth-Scopes": "repo", - "X-GitHub-Media-Type": "unknown, github.v3", - "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", - "X-Frame-Options": "deny", - "X-Content-Type-Options": "nosniff", - "X-XSS-Protection": "1; mode=block", - "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", - "Content-Security-Policy": "default-src 'none'", - "Vary": "Accept-Encoding, Accept, X-Requested-With", - "X-GitHub-Request-Id": "FC2D:4C84:190B377:3D28627:5E70A2B8" - } - }, - "uuid": "20a9519b-5770-4618-9df7-f514b6530e27", - "persistent": true, - "insertionIndex": 6 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/organizations_hub4j-test-org_teams_820406-5.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/organizations_hub4j-test-org_teams_820406-5.json deleted file mode 100644 index 14225e605f..0000000000 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/organizations_hub4j-test-org_teams_820406-5.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "id": "e640076f-debc-47c6-8c25-d15ced6e3936", - "name": "organizations_hub4j-test-org_teams_820406", - "request": { - "url": "/organizations/hub4j-test-org/teams/820406", - "method": "GET", - "headers": { - "Accept": { - "equalTo": "application/vnd.github.v3+json" - } - } - }, - "response": { - "status": 404, - "body": "{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3\"}", - "headers": { - "Server": "GitHub.com", - "Date": "Tue, 17 Mar 2020 10:08:51 GMT", - "Content-Type": "application/json; charset=utf-8", - "Status": "404 Not Found", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4930", - "X-RateLimit-Reset": "1584440312", - "X-OAuth-Scopes": "admin:org, admin:public_key, admin:repo_hook, notifications, repo, user", - "X-Accepted-OAuth-Scopes": "repo", - "X-GitHub-Media-Type": "unknown, github.v3", - "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", - "X-Frame-Options": "deny", - "X-Content-Type-Options": "nosniff", - "X-XSS-Protection": "1; mode=block", - "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", - "Content-Security-Policy": "default-src 'none'", - "Vary": "Accept-Encoding, Accept, X-Requested-With", - "X-GitHub-Request-Id": "FBE6:1AA5:36F96FD:5B83B31:5E70A1B3" - } - }, - "uuid": "e640076f-debc-47c6-8c25-d15ced6e3936", - "persistent": true, - "insertionIndex": 5 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/orgs_hub4j-test-org_teams_820406-4.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/orgs_hub4j-test-org_teams_820406-4.json deleted file mode 100644 index e2d5ac2b36..0000000000 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/orgs_hub4j-test-org_teams_820406-4.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "id": "e77527a3-a2a2-455c-8724-e3d16e264ba6", - "name": "orgs_hub4j-test-org_teams_820406", - "request": { - "url": "/orgs/hub4j-test-org/teams/820406", - "method": "GET", - "headers": { - "Accept": { - "equalTo": "application/vnd.github.v3+json" - } - } - }, - "response": { - "status": 404, - "body": "{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/teams/#get-team-by-name\"}", - "headers": { - "Date": "Tue, 17 Mar 2020 10:05:32 GMT", - "Content-Type": "application/json; charset=utf-8", - "Server": "GitHub.com", - "Status": "404 Not Found", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4935", - "X-RateLimit-Reset": "1584440312", - "X-OAuth-Scopes": "admin:org, admin:public_key, admin:repo_hook, notifications, repo, user", - "X-Accepted-OAuth-Scopes": "repo", - "X-GitHub-Media-Type": "unknown, github.v3", - "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", - "X-Frame-Options": "deny", - "X-Content-Type-Options": "nosniff", - "X-XSS-Protection": "1; mode=block", - "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", - "Content-Security-Policy": "default-src 'none'", - "Vary": "Accept-Encoding, Accept, X-Requested-With", - "X-GitHub-Request-Id": "FBBC:4FD5:1C796C:325E6F:5E70A0EC" - } - }, - "uuid": "e77527a3-a2a2-455c-8724-e3d16e264ba6", - "persistent": true, - "insertionIndex": 4 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/teams_820406-8.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/teams_820406-8.json deleted file mode 100644 index 2e6afa7031..0000000000 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/teams_820406-8.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "id": "9302cc40-d07a-4ad2-b958-f035a849e3fb", - "name": "teams_820406", - "request": { - "url": "/teams/820406", - "method": "GET", - "headers": { - "Accept": { - "equalTo": "application/vnd.github.v3+json" - } - } - }, - "response": { - "status": 200, - "bodyFileName": "teams_820406-8.json", - "headers": { - "Server": "GitHub.com", - "Date": "Tue, 17 Mar 2020 21:35:48 GMT", - "Content-Type": "application/json; charset=utf-8", - "Status": "200 OK", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4991", - "X-RateLimit-Reset": "1584484224", - "Cache-Control": "private, max-age=60, s-maxage=60", - "Vary": [ - "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding, Accept, X-Requested-With" - ], - "ETag": "W/\"1201d96396c062b2208db689dc6a3887\"", - "Last-Modified": "Sat, 10 May 2014 19:40:03 GMT", - "X-OAuth-Scopes": "admin:org, admin:public_key, admin:repo_hook, notifications, repo, user", - "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", - "X-GitHub-Media-Type": "unknown, github.v3", - "Deprecation": "Sat, 01 Feb 2020 00:00:00 GMT", - "Sunset": "Mon, 01 Feb 2021 00:00:00 GMT", - "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": "CA8E:731C:FD772:25F150:5E7142B3", - "Link": "; rel=\"deprecation\"; type=\"text/html\", ; rel=\"alternate\"" - } - }, - "uuid": "9302cc40-d07a-4ad2-b958-f035a849e3fb", - "persistent": true, - "insertionIndex": 8 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/user-1.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/user-1.json deleted file mode 100644 index 7bc86b5562..0000000000 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/user-1.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "id": "59e094cf-1ec5-49f3-a544-a434298717e4", - "name": "user", - "request": { - "url": "/user", - "method": "GET", - "headers": { - "Accept": { - "equalTo": "application/vnd.github.v3+json" - } - } - }, - "response": { - "status": 200, - "bodyFileName": "user-1.json", - "headers": { - "Date": "Tue, 17 Mar 2020 10:05:30 GMT", - "Content-Type": "application/json; charset=utf-8", - "Server": "GitHub.com", - "Status": "200 OK", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4939", - "X-RateLimit-Reset": "1584440312", - "Cache-Control": "private, max-age=60, s-maxage=60", - "Vary": [ - "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding, Accept, X-Requested-With" - ], - "ETag": "W/\"9017502e8d08bc162064261819da0490\"", - "Last-Modified": "Tue, 17 Mar 2020 08:28:47 GMT", - "X-OAuth-Scopes": "admin:org, admin:public_key, admin:repo_hook, notifications, repo, user", - "X-Accepted-OAuth-Scopes": "", - "X-GitHub-Media-Type": "unknown, github.v3", - "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", - "X-Frame-Options": "deny", - "X-Content-Type-Options": "nosniff", - "X-XSS-Protection": "1; mode=block", - "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", - "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "FBBC:4FD5:1C7910:325DFA:5E70A0EA" - } - }, - "uuid": "59e094cf-1ec5-49f3-a544-a434298717e4", - "persistent": true, - "insertionIndex": 1 -} \ No newline at end of file