diff --git a/src/main/java/org/kohsuke/github/GHOrganization.java b/src/main/java/org/kohsuke/github/GHOrganization.java index 5a8ba08857..2d955df874 100644 --- a/src/main/java/org/kohsuke/github/GHOrganization.java +++ b/src/main/java/org/kohsuke/github/GHOrganization.java @@ -128,6 +128,24 @@ public PagedIterable listTeams() throws IOException { .toIterable(GHTeam[].class, item -> item.wrapUp(this)); } + /** + * Gets a single team by ID. + * + * @param teamId + * id of the team that we want to query for + * @return the team + * @throws IOException + * the io exception + * + * @see documentation + */ + public GHTeam getTeam(int teamId) throws IOException { + return root.createRequest() + .withUrlPath(String.format("/organizations/%d/team/%d", id, teamId)) + .fetch(GHTeam.class) + .wrapUp(this); + } + /** * Finds a team that has the given name in its {@link GHTeam#getName()} * @@ -147,19 +165,19 @@ public GHTeam getTeamByName(String name) throws IOException { /** * Finds a team that has the given slug in its {@link GHTeam#getSlug()} - * + * * @param slug * the slug * @return the team by slug * @throws IOException * the io exception + * @see documentation */ public GHTeam getTeamBySlug(String slug) throws IOException { - for (GHTeam t : listTeams()) { - if (t.getSlug().equals(slug)) - return t; - } - return null; + return root.createRequest() + .withUrlPath(String.format("/orgs/%s/teams/%s", login, slug)) + .fetch(GHTeam.class) + .wrapUp(this); } /** diff --git a/src/main/java/org/kohsuke/github/GitHub.java b/src/main/java/org/kohsuke/github/GitHub.java index f7b13b4b63..56ed7d5ea3 100644 --- a/src/main/java/org/kohsuke/github/GitHub.java +++ b/src/main/java/org/kohsuke/github/GitHub.java @@ -724,7 +724,11 @@ public Map> getMyTeams() throws IOException { * @return the team * @throws IOException * the io exception + * + * @deprecated Use {@link GHOrganization#getTeam(int)} + * @see deprecation notice */ + @Deprecated public GHTeam getTeam(int id) throws IOException { return createRequest().withUrlPath("/teams/" + id).fetch(GHTeam.class).wrapUp(this); } diff --git a/src/test/java/org/kohsuke/github/AppTest.java b/src/test/java/org/kohsuke/github/AppTest.java index e1c18b3360..5041b4f6b7 100755 --- a/src/test/java/org/kohsuke/github/AppTest.java +++ b/src/test/java/org/kohsuke/github/AppTest.java @@ -234,16 +234,28 @@ private boolean shouldBelongToTeam(String organizationName, String teamName) thr return team.hasMember(gitHub.getMyself()); } - @Ignore("Needs mocking check") @Test public void testShouldFetchTeam() throws Exception { - GHOrganization j = gitHub.getOrganization(GITHUB_API_TEST_ORG); - GHTeam teamByName = j.getTeams().get("Core Developers"); + GHOrganization organization = gitHub.getOrganization(GITHUB_API_TEST_ORG); + GHTeam teamByName = organization.getTeams().get("Core Developers"); GHTeam teamById = gitHub.getTeam(teamByName.getId()); assertNotNull(teamById); - assertEquals(teamByName, teamById); + assertEquals(teamByName.getId(), teamById.getId()); + assertEquals(teamByName.getDescription(), teamById.getDescription()); + } + + @Test + public void testShouldFetchTeamFromOrganization() throws Exception { + GHOrganization organization = gitHub.getOrganization(GITHUB_API_TEST_ORG); + GHTeam teamByName = organization.getTeams().get("Core Developers"); + + GHTeam teamById = organization.getTeam(teamByName.getId()); + assertNotNull(teamById); + + assertEquals(teamByName.getId(), teamById.getId()); + assertEquals(teamByName.getDescription(), teamById.getDescription()); } @Ignore("Needs mocking check") diff --git a/src/test/java/org/kohsuke/github/WireMockStatusReporterTest.java b/src/test/java/org/kohsuke/github/WireMockStatusReporterTest.java index f09e96781f..b035f1d200 100644 --- a/src/test/java/org/kohsuke/github/WireMockStatusReporterTest.java +++ b/src/test/java/org/kohsuke/github/WireMockStatusReporterTest.java @@ -119,7 +119,8 @@ public void BasicBehaviors_whenProxying() throws Exception { assertThat(e, Matchers.instanceOf(GHFileNotFoundException.class)); assertThat(e.getMessage(), - equalTo("{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/repos/#get\"}")); + containsString( + "{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/repos/#get\"}")); } @Test diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testOrgTeamBySlug/__files/orgs_github-api-test-org_teams_core-developers-b7236bc9-4447-4721-acdb-7598066525d6.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testOrgTeamBySlug/__files/orgs_github-api-test-org_teams_core-developers-b7236bc9-4447-4721-acdb-7598066525d6.json new file mode 100644 index 0000000000..7f7d10b384 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testOrgTeamBySlug/__files/orgs_github-api-test-org_teams_core-developers-b7236bc9-4447-4721-acdb-7598066525d6.json @@ -0,0 +1,43 @@ +{ + "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/github-api-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": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "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/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/github-api-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/testOrgTeamBySlug/mappings/orgs_github-api-test-org_teams_core-developers-4-b7236b.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testOrgTeamBySlug/mappings/orgs_github-api-test-org_teams_core-developers-4-b7236b.json new file mode 100644 index 0000000000..91f767790f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testOrgTeamBySlug/mappings/orgs_github-api-test-org_teams_core-developers-4-b7236b.json @@ -0,0 +1,46 @@ +{ + "id": "b7236bc9-4447-4721-acdb-7598066525d6", + "name": "orgs_github-api-test-org_teams_core-developers", + "request": { + "url": "/orgs/github-api-test-org/teams/core-developers", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org_teams_core-developers-b7236bc9-4447-4721-acdb-7598066525d6.json", + "headers": { + "Date": "Tue, 17 Mar 2020 09:18:50 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4995", + "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": "F97C:520F:195318:2E8EA9:5E7095FA" + } + }, + "uuid": "b7236bc9-4447-4721-acdb-7598066525d6", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/organizations_7544739_team_820406-8b1ba756-0fb7-49bf-8cd8-0febdccefd7e.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/organizations_7544739_team_820406-8b1ba756-0fb7-49bf-8cd8-0febdccefd7e.json new file mode 100644 index 0000000000..7f7d10b384 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/organizations_7544739_team_820406-8b1ba756-0fb7-49bf-8cd8-0febdccefd7e.json @@ -0,0 +1,43 @@ +{ + "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/github-api-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": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "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/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/github-api-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/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org-37477eb5-c7c7-4246-b912-6d066ebcb09c.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/orgs_github-api-test-org-84aa5465-24ab-43e3-9655-e835c39bfa65.json similarity index 95% rename from src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org-37477eb5-c7c7-4246-b912-6d066ebcb09c.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/orgs_github-api-test-org-84aa5465-24ab-43e3-9655-e835c39bfa65.json index 61547e3d98..9c94208761 100644 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org-37477eb5-c7c7-4246-b912-6d066ebcb09c.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/orgs_github-api-test-org-84aa5465-24ab-43e3-9655-e835c39bfa65.json @@ -14,7 +14,7 @@ "is_verified": false, "has_organization_projects": true, "has_repository_projects": true, - "public_repos": 9, + "public_repos": 26, "public_gists": 0, "followers": 0, "following": 0, @@ -25,7 +25,7 @@ "total_private_repos": 0, "owned_private_repos": 0, "private_gists": 0, - "disk_usage": 132, + "disk_usage": 147, "collaborators": 0, "billing_email": "kk@kohsuke.org", "default_repository_permission": "none", @@ -35,7 +35,7 @@ "name": "free", "space": 976562499, "private_repos": 0, - "filled_seats": 3, + "filled_seats": 13, "seats": 0 } } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/orgs_github-api-test-org_teams-d833590f-9896-462c-846b-712b50377536.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/orgs_github-api-test-org_teams-d833590f-9896-462c-846b-712b50377536.json new file mode 100644 index 0000000000..d11e271bc3 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/orgs_github-api-test-org_teams-d833590f-9896-462c-846b-712b50377536.json @@ -0,0 +1,58 @@ +[ + { + "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/github-api-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/github-api-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/github-api-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/github-api-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-9302cc40-d07a-4ad2-b958-f035a849e3fb.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/teams_820406-9302cc40-d07a-4ad2-b958-f035a849e3fb.json new file mode 100644 index 0000000000..7f7d10b384 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/teams_820406-9302cc40-d07a-4ad2-b958-f035a849e3fb.json @@ -0,0 +1,43 @@ +{ + "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/github-api-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": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "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/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/github-api-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-59e094cf-1ec5-49f3-a544-a434298717e4.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/user-59e094cf-1ec5-49f3-a544-a434298717e4.json new file mode 100644 index 0000000000..3ed6e3f008 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/__files/user-59e094cf-1ec5-49f3-a544-a434298717e4.json @@ -0,0 +1,45 @@ +{ + "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-8b1ba7.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/organizations_7544739_team_820406-7-8b1ba7.json new file mode 100644 index 0000000000..7c0f4b2123 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/organizations_7544739_team_820406-7-8b1ba7.json @@ -0,0 +1,46 @@ +{ + "id": "8b1ba756-0fb7-49bf-8cd8-0febdccefd7e", + "name": "organizations_7544739_team_820406", + "request": { + "url": "/organizations/7544739/team/820406", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "organizations_7544739_team_820406-8b1ba756-0fb7-49bf-8cd8-0febdccefd7e.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-20a951.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/organizations_7544739_teams_820406-6-20a951.json new file mode 100644 index 0000000000..9f6905a0df --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/organizations_7544739_teams_820406-6-20a951.json @@ -0,0 +1,40 @@ +{ + "id": "20a9519b-5770-4618-9df7-f514b6530e27", + "name": "organizations_7544739_teams_820406", + "request": { + "url": "/organizations/7544739/teams/820406", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "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_github-api-test-org_teams_820406-5-e64007.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/organizations_github-api-test-org_teams_820406-5-e64007.json new file mode 100644 index 0000000000..919fd40984 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/organizations_github-api-test-org_teams_820406-5-e64007.json @@ -0,0 +1,40 @@ +{ + "id": "e640076f-debc-47c6-8c25-d15ced6e3936", + "name": "organizations_github-api-test-org_teams_820406", + "request": { + "url": "/organizations/github-api-test-org/teams/820406", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "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/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org-2-37477e.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/orgs_github-api-test-org-2-84aa54.json similarity index 56% rename from src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org-2-37477e.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/orgs_github-api-test-org-2-84aa54.json index e67c1c538d..63d44b6939 100644 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org-2-37477e.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/orgs_github-api-test-org-2-84aa54.json @@ -1,5 +1,5 @@ { - "id": "37477eb5-c7c7-4246-b912-6d066ebcb09c", + "id": "84aa5465-24ab-43e3-9655-e835c39bfa65", "name": "orgs_github-api-test-org", "request": { "url": "/orgs/github-api-test-org", @@ -12,37 +12,35 @@ }, "response": { "status": 200, - "bodyFileName": "orgs_github-api-test-org-37477eb5-c7c7-4246-b912-6d066ebcb09c.json", + "bodyFileName": "orgs_github-api-test-org-84aa5465-24ab-43e3-9655-e835c39bfa65.json", "headers": { - "Date": "Thu, 03 Oct 2019 21:51:10 GMT", + "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": "4950", - "X-RateLimit-Reset": "1570141865", + "X-RateLimit-Remaining": "4937", + "X-RateLimit-Reset": "1584440312", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"d36965e157281b2a309c39e4c2343a55\"", + "ETag": "W/\"9d4203e09aeffc9b5325c2a5355275b5\"", "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", - "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "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", - "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": "CD3D:6B2E:176196E:1B9D60F:5D966D4D" + "X-GitHub-Request-Id": "FBBC:4FD5:1C7954:325E0B:5E70A0EA" } }, - "uuid": "37477eb5-c7c7-4246-b912-6d066ebcb09c", + "uuid": "84aa5465-24ab-43e3-9655-e835c39bfa65", "persistent": true, "insertionIndex": 2 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org_teams-7-0bdd94.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/orgs_github-api-test-org_teams-3-d83359.json similarity index 51% rename from src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org_teams-7-0bdd94.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/orgs_github-api-test-org_teams-3-d83359.json index d5600a2c5a..d83d384eca 100644 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org_teams-7-0bdd94.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/orgs_github-api-test-org_teams-3-d83359.json @@ -1,5 +1,5 @@ { - "id": "0bdd9437-644e-4895-8d01-c0b718bfab0b", + "id": "d833590f-9896-462c-846b-712b50377536", "name": "orgs_github-api-test-org_teams", "request": { "url": "/orgs/github-api-test-org/teams", @@ -12,38 +12,34 @@ }, "response": { "status": 200, - "bodyFileName": "orgs_github-api-test-org_teams-0bdd9437-644e-4895-8d01-c0b718bfab0b.json", + "bodyFileName": "orgs_github-api-test-org_teams-d833590f-9896-462c-846b-712b50377536.json", "headers": { - "Date": "Thu, 03 Oct 2019 21:51:11 GMT", + "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": "4945", - "X-RateLimit-Reset": "1570141865", + "X-RateLimit-Remaining": "4936", + "X-RateLimit-Reset": "1584440312", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"d73a82173554b9946f9c6dc2ec80456a\"", - "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "ETag": "W/\"54e42fc30d88d2a30340b56bbe54f211\"", + "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", - "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": "CD3D:6B2E:1761A37:1B9D747:5D966D4F" + "X-GitHub-Request-Id": "FBBC:4FD5:1C7963:325E5F:5E70A0EC" } }, - "uuid": "0bdd9437-644e-4895-8d01-c0b718bfab0b", + "uuid": "d833590f-9896-462c-846b-712b50377536", "persistent": true, - "scenarioName": "scenario-1-orgs-github-api-test-org-teams", - "requiredScenarioState": "scenario-1-orgs-github-api-test-org-teams-3", - "insertionIndex": 7 + "insertionIndex": 3 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/orgs_github-api-test-org_teams_820406-4-e77527.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/orgs_github-api-test-org_teams_820406-4-e77527.json new file mode 100644 index 0000000000..265a5df92a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/orgs_github-api-test-org_teams_820406-4-e77527.json @@ -0,0 +1,40 @@ +{ + "id": "e77527a3-a2a2-455c-8724-e3d16e264ba6", + "name": "orgs_github-api-test-org_teams_820406", + "request": { + "url": "/orgs/github-api-test-org/teams/820406", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "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-9302cc.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/teams_820406-8-9302cc.json new file mode 100644 index 0000000000..a4c14cf1de --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/teams_820406-8-9302cc.json @@ -0,0 +1,49 @@ +{ + "id": "9302cc40-d07a-4ad2-b958-f035a849e3fb", + "name": "teams_820406", + "request": { + "url": "/teams/820406", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "teams_820406-9302cc40-d07a-4ad2-b958-f035a849e3fb.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/GHTeamTest/wiremock/testSetDescription/mappings/user-1-74e41f.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/user-1-59e094.json similarity index 53% rename from src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/user-1-74e41f.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/user-1-59e094.json index e289911260..03eb5c98f9 100644 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/user-1-74e41f.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeam/mappings/user-1-59e094.json @@ -1,5 +1,5 @@ { - "id": "74e41fbf-488d-4195-afb9-bc12d23332cd", + "id": "59e094cf-1ec5-49f3-a544-a434298717e4", "name": "user", "request": { "url": "/user", @@ -12,37 +12,35 @@ }, "response": { "status": 200, - "bodyFileName": "user-74e41fbf-488d-4195-afb9-bc12d23332cd.json", + "bodyFileName": "user-59e094cf-1ec5-49f3-a544-a434298717e4.json", "headers": { - "Date": "Thu, 03 Oct 2019 21:51:09 GMT", + "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": "4952", - "X-RateLimit-Reset": "1570141865", + "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-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", - "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", - "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "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", - "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": "CD3D:6B2E:1761911:1B9D5E4:5D966D4D" + "X-GitHub-Request-Id": "FBBC:4FD5:1C7910:325DFA:5E70A0EA" } }, - "uuid": "74e41fbf-488d-4195-afb9-bc12d23332cd", + "uuid": "59e094cf-1ec5-49f3-a544-a434298717e4", "persistent": true, "insertionIndex": 1 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/__files/organizations_7544739_team_820406-ba773c31-6b20-4c65-9c67-e9fd89ea6bdd.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/__files/organizations_7544739_team_820406-ba773c31-6b20-4c65-9c67-e9fd89ea6bdd.json new file mode 100644 index 0000000000..7f7d10b384 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/__files/organizations_7544739_team_820406-ba773c31-6b20-4c65-9c67-e9fd89ea6bdd.json @@ -0,0 +1,43 @@ +{ + "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/github-api-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": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "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/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/github-api-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/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org-ecf0c232-2c2b-4580-b12c-ddc025656f64.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/__files/orgs_github-api-test-org-1e6ccae5-0db6-47c0-89bc-5c1f2d862b63.json similarity index 95% rename from src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org-ecf0c232-2c2b-4580-b12c-ddc025656f64.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/__files/orgs_github-api-test-org-1e6ccae5-0db6-47c0-89bc-5c1f2d862b63.json index 61547e3d98..97f95f3f4e 100644 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org-ecf0c232-2c2b-4580-b12c-ddc025656f64.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/__files/orgs_github-api-test-org-1e6ccae5-0db6-47c0-89bc-5c1f2d862b63.json @@ -14,7 +14,7 @@ "is_verified": false, "has_organization_projects": true, "has_repository_projects": true, - "public_repos": 9, + "public_repos": 26, "public_gists": 0, "followers": 0, "following": 0, @@ -25,7 +25,7 @@ "total_private_repos": 0, "owned_private_repos": 0, "private_gists": 0, - "disk_usage": 132, + "disk_usage": 147, "collaborators": 0, "billing_email": "kk@kohsuke.org", "default_repository_permission": "none", @@ -35,7 +35,7 @@ "name": "free", "space": 976562499, "private_repos": 0, - "filled_seats": 3, + "filled_seats": 14, "seats": 0 } } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/__files/orgs_github-api-test-org_teams-e2aa00b9-f24e-4650-8341-7f08ec5aea99.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/__files/orgs_github-api-test-org_teams-e2aa00b9-f24e-4650-8341-7f08ec5aea99.json new file mode 100644 index 0000000000..d11e271bc3 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/__files/orgs_github-api-test-org_teams-e2aa00b9-f24e-4650-8341-7f08ec5aea99.json @@ -0,0 +1,58 @@ +[ + { + "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/github-api-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/github-api-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/github-api-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/github-api-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/testShouldFetchTeamFromOrganization/__files/user-09eec5a0-4b1d-4afe-85d3-5413eb288548.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/__files/user-09eec5a0-4b1d-4afe-85d3-5413eb288548.json new file mode 100644 index 0000000000..3ed6e3f008 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/__files/user-09eec5a0-4b1d-4afe-85d3-5413eb288548.json @@ -0,0 +1,45 @@ +{ + "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/testShouldFetchTeamFromOrganization/mappings/organizations_7544739_team_820406-4-ba773c.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/mappings/organizations_7544739_team_820406-4-ba773c.json new file mode 100644 index 0000000000..6f46dc1ddd --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/mappings/organizations_7544739_team_820406-4-ba773c.json @@ -0,0 +1,46 @@ +{ + "id": "ba773c31-6b20-4c65-9c67-e9fd89ea6bdd", + "name": "organizations_7544739_team_820406", + "request": { + "url": "/organizations/7544739/team/820406", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "organizations_7544739_team_820406-ba773c31-6b20-4c65-9c67-e9fd89ea6bdd.json", + "headers": { + "Server": "GitHub.com", + "Date": "Tue, 17 Mar 2020 21:36:28 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4986", + "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", + "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": "CA95:081B:10E156:25E8CE:5E7142DB" + } + }, + "uuid": "ba773c31-6b20-4c65-9c67-e9fd89ea6bdd", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org-2-ecf0c2.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/mappings/orgs_github-api-test-org-2-1e6cca.json similarity index 51% rename from src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org-2-ecf0c2.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/mappings/orgs_github-api-test-org-2-1e6cca.json index 48f4ce19ae..746cac5026 100644 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org-2-ecf0c2.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/mappings/orgs_github-api-test-org-2-1e6cca.json @@ -1,5 +1,5 @@ { - "id": "ecf0c232-2c2b-4580-b12c-ddc025656f64", + "id": "1e6ccae5-0db6-47c0-89bc-5c1f2d862b63", "name": "orgs_github-api-test-org", "request": { "url": "/orgs/github-api-test-org", @@ -12,37 +12,35 @@ }, "response": { "status": 200, - "bodyFileName": "orgs_github-api-test-org-ecf0c232-2c2b-4580-b12c-ddc025656f64.json", + "bodyFileName": "orgs_github-api-test-org-1e6ccae5-0db6-47c0-89bc-5c1f2d862b63.json", "headers": { - "Date": "Sun, 26 Jan 2020 10:43:12 GMT", - "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", + "Date": "Tue, 17 Mar 2020 21:36:27 GMT", + "Content-Type": "application/json; charset=utf-8", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4925", - "X-RateLimit-Reset": "1580037742", + "X-RateLimit-Remaining": "4988", + "X-RateLimit-Reset": "1584484223", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"d211113b4423739223ae7cb0b5ef2b04\"", - "Last-Modified": "Mon, 07 Oct 2019 20:06:18 GMT", - "X-OAuth-Scopes": "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, read:packages, repo, user, workflow, write:discussion, write:packages", + "ETag": "W/\"3aa57f9a6ec0d8e1d1dfbcb665852c3a\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 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", - "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": "F148:392DB:A5E2033:C6B41E4:5E2D6D3F" + "X-GitHub-Request-Id": "CA95:081B:10E13F:25E832:5E7142DA" } }, - "uuid": "ecf0c232-2c2b-4580-b12c-ddc025656f64", + "uuid": "1e6ccae5-0db6-47c0-89bc-5c1f2d862b63", "persistent": true, "insertionIndex": 2 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/mappings/orgs_github-api-test-org_teams-3-e2aa00.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/mappings/orgs_github-api-test-org_teams-3-e2aa00.json new file mode 100644 index 0000000000..5e3489042d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/mappings/orgs_github-api-test-org_teams-3-e2aa00.json @@ -0,0 +1,45 @@ +{ + "id": "e2aa00b9-f24e-4650-8341-7f08ec5aea99", + "name": "orgs_github-api-test-org_teams", + "request": { + "url": "/orgs/github-api-test-org/teams", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org_teams-e2aa00b9-f24e-4650-8341-7f08ec5aea99.json", + "headers": { + "Server": "GitHub.com", + "Date": "Tue, 17 Mar 2020 21:36:27 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4987", + "X-RateLimit-Reset": "1584484223", + "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", + "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": "CA95:081B:10E14F:25E8B9:5E7142DB" + } + }, + "uuid": "e2aa00b9-f24e-4650-8341-7f08ec5aea99", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/user-1-bc58c4.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/mappings/user-1-09eec5.json similarity index 50% rename from src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/user-1-bc58c4.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/mappings/user-1-09eec5.json index 41e39e0c5f..a3cde0029b 100644 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/user-1-bc58c4.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testShouldFetchTeamFromOrganization/mappings/user-1-09eec5.json @@ -1,5 +1,5 @@ { - "id": "bc58c48e-2441-4377-aa9a-e58df4073c39", + "id": "09eec5a0-4b1d-4afe-85d3-5413eb288548", "name": "user", "request": { "url": "/user", @@ -12,37 +12,35 @@ }, "response": { "status": 200, - "bodyFileName": "user-bc58c48e-2441-4377-aa9a-e58df4073c39.json", + "bodyFileName": "user-09eec5a0-4b1d-4afe-85d3-5413eb288548.json", "headers": { - "Date": "Sun, 26 Jan 2020 10:43:11 GMT", - "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", + "Date": "Tue, 17 Mar 2020 21:36:26 GMT", + "Content-Type": "application/json; charset=utf-8", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4927", - "X-RateLimit-Reset": "1580037742", + "X-RateLimit-Remaining": "4990", + "X-RateLimit-Reset": "1584484223", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"761a302984106642d104212e9973a925\"", - "Last-Modified": "Sun, 26 Jan 2020 08:50:30 GMT", - "X-OAuth-Scopes": "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, read:packages, repo, user, workflow, write:discussion, write:packages", + "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", - "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": "F148:392DB:A5E1E1E:C6B40DF:5E2D6D3F" + "X-GitHub-Request-Id": "CA95:081B:10E0FE:25E811:5E7142DA" } }, - "uuid": "bc58c48e-2441-4377-aa9a-e58df4073c39", + "uuid": "09eec5a0-4b1d-4afe-85d3-5413eb288548", "persistent": true, "insertionIndex": 1 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/testPullRequestTeamReviewRequests/__files/orgs_github-api-test-org_teams_dummy-team-7052eece-1708-4d47-8f66-5d45136c43e6.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/testPullRequestTeamReviewRequests/__files/orgs_github-api-test-org_teams_dummy-team-7052eece-1708-4d47-8f66-5d45136c43e6.json new file mode 100644 index 0000000000..69eb9b02ee --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/testPullRequestTeamReviewRequests/__files/orgs_github-api-test-org_teams_dummy-team-7052eece-1708-4d47-8f66-5d45136c43e6.json @@ -0,0 +1,43 @@ +{ + "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/github-api-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", + "created_at": "2019-10-03T21:46:12Z", + "updated_at": "2020-03-17T09:12:26Z", + "members_count": 1, + "repos_count": 1, + "organization": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "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/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/github-api-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/GHPullRequestTest/wiremock/testPullRequestTeamReviewRequests/mappings/orgs_github-api-test-org_teams_dummy-team-9-7052ee.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/testPullRequestTeamReviewRequests/mappings/orgs_github-api-test-org_teams_dummy-team-9-7052ee.json new file mode 100644 index 0000000000..1a26fedf73 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/testPullRequestTeamReviewRequests/mappings/orgs_github-api-test-org_teams_dummy-team-9-7052ee.json @@ -0,0 +1,46 @@ +{ + "id": "7052eece-1708-4d47-8f66-5d45136c43e6", + "name": "orgs_github-api-test-org_teams_dummy-team", + "request": { + "url": "/orgs/github-api-test-org/teams/dummy-team", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org_teams_dummy-team-7052eece-1708-4d47-8f66-5d45136c43e6.json", + "headers": { + "Server": "GitHub.com", + "Date": "Tue, 17 Mar 2020 09:19:41 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4990", + "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/\"3760fae93c6e9cb6c970a0e6bdbcaf53\"", + "Last-Modified": "Tue, 17 Mar 2020 09:12:26 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": "F98A:4C84:18DACD9:3CB7D53:5E70962D" + } + }, + "uuid": "7052eece-1708-4d47-8f66-5d45136c43e6", + "persistent": true, + "insertionIndex": 9 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org-3211dfd0-5228-4cdc-aea3-ab67437f3fd4.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org-3211dfd0-5228-4cdc-aea3-ab67437f3fd4.json new file mode 100644 index 0000000000..9c94208761 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org-3211dfd0-5228-4cdc-aea3-ab67437f3fd4.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "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/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/github-api-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": 147, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 13, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org_teams-0bdd9437-644e-4895-8d01-c0b718bfab0b.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org_teams-0bdd9437-644e-4895-8d01-c0b718bfab0b.json deleted file mode 100644 index 735846096f..0000000000 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org_teams-0bdd9437-644e-4895-8d01-c0b718bfab0b.json +++ /dev/null @@ -1,41 +0,0 @@ -[ - { - "name": "Owners", - "id": 820404, - "node_id": "MDQ6VGVhbTgyMDQwNA==", - "slug": "owners", - "description": null, - "privacy": "secret", - "url": "https://api.github.com/teams/820404", - "html_url": "https://github.com/orgs/github-api-test-org/teams/owners", - "members_url": "https://api.github.com/teams/820404/members{/member}", - "repositories_url": "https://api.github.com/teams/820404/repos", - "permission": "admin" - }, - { - "name": "Core Developers", - "id": 820406, - "node_id": "MDQ6VGVhbTgyMDQwNg==", - "slug": "core-developers", - "description": "A random team", - "privacy": "secret", - "url": "https://api.github.com/teams/820406", - "html_url": "https://github.com/orgs/github-api-test-org/teams/core-developers", - "members_url": "https://api.github.com/teams/820406/members{/member}", - "repositories_url": "https://api.github.com/teams/820406/repos", - "permission": "pull" - }, - { - "name": "dummy-team", - "id": 3451996, - "node_id": "MDQ6VGVhbTM0NTE5OTY=", - "slug": "dummy-team", - "description": "Updated by API TestModified", - "privacy": "closed", - "url": "https://api.github.com/teams/3451996", - "html_url": "https://github.com/orgs/github-api-test-org/teams/dummy-team", - "members_url": "https://api.github.com/teams/3451996/members{/member}", - "repositories_url": "https://api.github.com/teams/3451996/repos", - "permission": "pull" - } -] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org_teams-68c43ac4-fc58-45c5-a11d-1c8b40865abe.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org_teams-68c43ac4-fc58-45c5-a11d-1c8b40865abe.json deleted file mode 100644 index 44352d9b94..0000000000 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org_teams-68c43ac4-fc58-45c5-a11d-1c8b40865abe.json +++ /dev/null @@ -1,41 +0,0 @@ -[ - { - "name": "Owners", - "id": 820404, - "node_id": "MDQ6VGVhbTgyMDQwNA==", - "slug": "owners", - "description": null, - "privacy": "secret", - "url": "https://api.github.com/teams/820404", - "html_url": "https://github.com/orgs/github-api-test-org/teams/owners", - "members_url": "https://api.github.com/teams/820404/members{/member}", - "repositories_url": "https://api.github.com/teams/820404/repos", - "permission": "admin" - }, - { - "name": "Core Developers", - "id": 820406, - "node_id": "MDQ6VGVhbTgyMDQwNg==", - "slug": "core-developers", - "description": "A random team", - "privacy": "secret", - "url": "https://api.github.com/teams/820406", - "html_url": "https://github.com/orgs/github-api-test-org/teams/core-developers", - "members_url": "https://api.github.com/teams/820406/members{/member}", - "repositories_url": "https://api.github.com/teams/820406/repos", - "permission": "pull" - }, - { - "name": "dummy-team", - "id": 3451996, - "node_id": "MDQ6VGVhbTM0NTE5OTY=", - "slug": "dummy-team", - "description": "Updated by API Test", - "privacy": "closed", - "url": "https://api.github.com/teams/3451996", - "html_url": "https://github.com/orgs/github-api-test-org/teams/dummy-team", - "members_url": "https://api.github.com/teams/3451996/members{/member}", - "repositories_url": "https://api.github.com/teams/3451996/repos", - "permission": "pull" - } -] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org_teams-a484e2dd-2e6c-4f40-b6f1-d706dfdfa3d9.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org_teams-a484e2dd-2e6c-4f40-b6f1-d706dfdfa3d9.json deleted file mode 100644 index 735846096f..0000000000 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org_teams-a484e2dd-2e6c-4f40-b6f1-d706dfdfa3d9.json +++ /dev/null @@ -1,41 +0,0 @@ -[ - { - "name": "Owners", - "id": 820404, - "node_id": "MDQ6VGVhbTgyMDQwNA==", - "slug": "owners", - "description": null, - "privacy": "secret", - "url": "https://api.github.com/teams/820404", - "html_url": "https://github.com/orgs/github-api-test-org/teams/owners", - "members_url": "https://api.github.com/teams/820404/members{/member}", - "repositories_url": "https://api.github.com/teams/820404/repos", - "permission": "admin" - }, - { - "name": "Core Developers", - "id": 820406, - "node_id": "MDQ6VGVhbTgyMDQwNg==", - "slug": "core-developers", - "description": "A random team", - "privacy": "secret", - "url": "https://api.github.com/teams/820406", - "html_url": "https://github.com/orgs/github-api-test-org/teams/core-developers", - "members_url": "https://api.github.com/teams/820406/members{/member}", - "repositories_url": "https://api.github.com/teams/820406/repos", - "permission": "pull" - }, - { - "name": "dummy-team", - "id": 3451996, - "node_id": "MDQ6VGVhbTM0NTE5OTY=", - "slug": "dummy-team", - "description": "Updated by API TestModified", - "privacy": "closed", - "url": "https://api.github.com/teams/3451996", - "html_url": "https://github.com/orgs/github-api-test-org/teams/dummy-team", - "members_url": "https://api.github.com/teams/3451996/members{/member}", - "repositories_url": "https://api.github.com/teams/3451996/repos", - "permission": "pull" - } -] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org_teams_dummy-team-32b16e2a-e453-4e91-9442-08073572a327.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org_teams_dummy-team-32b16e2a-e453-4e91-9442-08073572a327.json new file mode 100644 index 0000000000..bc49473d04 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org_teams_dummy-team-32b16e2a-e453-4e91-9442-08073572a327.json @@ -0,0 +1,43 @@ +{ + "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/github-api-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", + "created_at": "2019-10-03T21:46:12Z", + "updated_at": "2020-03-17T09:12:23Z", + "members_count": 1, + "repos_count": 1, + "organization": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "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/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/github-api-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/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org_teams_dummy-team-32efe61a-4308-46c2-a349-010050ec8685.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org_teams_dummy-team-32efe61a-4308-46c2-a349-010050ec8685.json new file mode 100644 index 0000000000..e8ebdc309b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org_teams_dummy-team-32efe61a-4308-46c2-a349-010050ec8685.json @@ -0,0 +1,43 @@ +{ + "name": "dummy-team", + "id": 3451996, + "node_id": "MDQ6VGVhbTM0NTE5OTY=", + "slug": "dummy-team", + "description": "Updated by API Test", + "privacy": "secret", + "url": "https://api.github.com/organizations/7544739/team/3451996", + "html_url": "https://github.com/orgs/github-api-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", + "created_at": "2019-10-03T21:46:12Z", + "updated_at": "2020-03-17T09:12:22Z", + "members_count": 1, + "repos_count": 1, + "organization": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "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/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/github-api-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/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org_teams_dummy-team-b239719e-8610-449b-91bd-a35f4cc00424.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org_teams_dummy-team-b239719e-8610-449b-91bd-a35f4cc00424.json new file mode 100644 index 0000000000..188354f972 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/orgs_github-api-test-org_teams_dummy-team-b239719e-8610-449b-91bd-a35f4cc00424.json @@ -0,0 +1,43 @@ +{ + "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/github-api-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", + "created_at": "2019-10-03T21:46:12Z", + "updated_at": "2020-03-17T09:06:57Z", + "members_count": 1, + "repos_count": 1, + "organization": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "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/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/github-api-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/GHTeamTest/wiremock/testSetDescription/__files/teams_3451996-f0db2900-a58f-48e3-abde-f1e1c42a153d.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/teams_3451996-a8678668-24d0-4f75-b5a3-da720a764dd6.json similarity index 78% rename from src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/teams_3451996-f0db2900-a58f-48e3-abde-f1e1c42a153d.json rename to src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/teams_3451996-a8678668-24d0-4f75-b5a3-da720a764dd6.json index c868b22527..a98a938574 100644 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/teams_3451996-f0db2900-a58f-48e3-abde-f1e1c42a153d.json +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/teams_3451996-a8678668-24d0-4f75-b5a3-da720a764dd6.json @@ -4,16 +4,17 @@ "node_id": "MDQ6VGVhbTM0NTE5OTY=", "slug": "dummy-team", "description": "Updated by API Test", - "privacy": "closed", - "url": "https://api.github.com/teams/3451996", + "privacy": "secret", + "url": "https://api.github.com/organizations/7544739/team/3451996", "html_url": "https://github.com/orgs/github-api-test-org/teams/dummy-team", - "members_url": "https://api.github.com/teams/3451996/members{/member}", - "repositories_url": "https://api.github.com/teams/3451996/repos", + "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, "created_at": "2019-10-03T21:46:12Z", - "updated_at": "2019-10-03T21:51:10Z", + "updated_at": "2020-03-17T09:12:22Z", "members_count": 1, - "repos_count": 0, + "repos_count": 1, "organization": { "login": "github-api-test-org", "id": 7544739, @@ -30,7 +31,7 @@ "is_verified": false, "has_organization_projects": true, "has_repository_projects": true, - "public_repos": 9, + "public_repos": 26, "public_gists": 0, "followers": 0, "following": 0, diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/teams_3618279-f0948c22-babf-430d-beb6-2daf5efd7541.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/teams_3451996-de9b6c26-1f63-4cc3-b4f6-6691f9bf180c.json similarity index 60% rename from src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/teams_3618279-f0948c22-babf-430d-beb6-2daf5efd7541.json rename to src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/teams_3451996-de9b6c26-1f63-4cc3-b4f6-6691f9bf180c.json index 31cf5c08b8..22383dfab2 100644 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/teams_3618279-f0948c22-babf-430d-beb6-2daf5efd7541.json +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/teams_3451996-de9b6c26-1f63-4cc3-b4f6-6691f9bf180c.json @@ -1,24 +1,24 @@ { "name": "dummy-team", - "id": 3618279, - "node_id": "MDQ6VGVhbTM2MTgyNzk=", + "id": 3451996, + "node_id": "MDQ6VGVhbTM0NTE5OTY=", "slug": "dummy-team", - "description": "", + "description": "Updated by API TestModified", "privacy": "secret", - "url": "https://api.github.com/organizations/49127317/team/3618279", + "url": "https://api.github.com/organizations/7544739/team/3451996", "html_url": "https://github.com/orgs/github-api-test-org/teams/dummy-team", - "members_url": "https://api.github.com/organizations/49127317/team/3618279/members{/member}", - "repositories_url": "https://api.github.com/organizations/49127317/team/3618279/repos", + "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, - "created_at": "2020-01-26T10:31:35Z", - "updated_at": "2020-01-26T10:43:14Z", + "created_at": "2019-10-03T21:46:12Z", + "updated_at": "2020-03-17T09:12:23Z", "members_count": 1, - "repos_count": 0, + "repos_count": 1, "organization": { "login": "github-api-test-org", - "id": 49127317, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjQ5MTI3MzE3", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", "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", @@ -26,18 +26,18 @@ "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/49127317?v=4", + "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": 5, + "public_repos": 26, "public_gists": 0, "followers": 0, "following": 0, "html_url": "https://github.com/github-api-test-org", - "created_at": "2019-03-31T17:42:10Z", - "updated_at": "2019-10-07T20:06:18Z", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", "type": "Organization" } } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/user-74e41fbf-488d-4195-afb9-bc12d23332cd.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/user-74e41fbf-488d-4195-afb9-bc12d23332cd.json deleted file mode 100644 index 41fc9e3d00..0000000000 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/user-74e41fbf-488d-4195-afb9-bc12d23332cd.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "login": "bitwiseman", - "id": 1958953, - "node_id": "MDQ6VXNlcjE5NTg5NTM=", - "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/bitwiseman", - "html_url": "https://github.com/bitwiseman", - "followers_url": "https://api.github.com/users/bitwiseman/followers", - "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", - "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", - "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", - "organizations_url": "https://api.github.com/users/bitwiseman/orgs", - "repos_url": "https://api.github.com/users/bitwiseman/repos", - "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", - "received_events_url": "https://api.github.com/users/bitwiseman/received_events", - "type": "User", - "site_admin": false, - "name": "Liam Newman", - "company": "Cloudbees, Inc.", - "blog": "", - "location": "Seattle, WA, USA", - "email": "bitwiseman@gmail.com", - "hireable": null, - "bio": "https://twitter.com/bitwiseman", - "public_repos": 168, - "public_gists": 4, - "followers": 136, - "following": 9, - "created_at": "2012-07-11T20:38:33Z", - "updated_at": "2019-09-24T19:32:29Z", - "private_gists": 7, - "total_private_repos": 9, - "owned_private_repos": 0, - "disk_usage": 33697, - "collaborators": 0, - "two_factor_authentication": true, - "plan": { - "name": "free", - "space": 976562499, - "collaborators": 0, - "private_repos": 10000 - } -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/user-fd7e486f-6713-462f-955f-7fcb8535064e.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/user-fd7e486f-6713-462f-955f-7fcb8535064e.json new file mode 100644 index 0000000000..3ed6e3f008 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/user-fd7e486f-6713-462f-955f-7fcb8535064e.json @@ -0,0 +1,45 @@ +{ + "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/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org-2-3211df.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org-2-3211df.json new file mode 100644 index 0000000000..db34680fb3 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org-2-3211df.json @@ -0,0 +1,46 @@ +{ + "id": "3211dfd0-5228-4cdc-aea3-ab67437f3fd4", + "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-3211dfd0-5228-4cdc-aea3-ab67437f3fd4.json", + "headers": { + "Date": "Tue, 17 Mar 2020 09:12:21 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4445", + "X-RateLimit-Reset": "1584436621", + "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", + "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": "F8C7:46E1:A3A21:151ED4:5E709474" + } + }, + "uuid": "3211dfd0-5228-4cdc-aea3-ab67437f3fd4", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org_teams-3-a484e2.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org_teams_dummy-team-3-b23971.json similarity index 51% rename from src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org_teams-3-a484e2.json rename to src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org_teams_dummy-team-3-b23971.json index e3f4d90504..d4b420386b 100644 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org_teams-3-a484e2.json +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org_teams_dummy-team-3-b23971.json @@ -1,8 +1,8 @@ { - "id": "a484e2dd-2e6c-4f40-b6f1-d706dfdfa3d9", - "name": "orgs_github-api-test-org_teams", + "id": "b239719e-8610-449b-91bd-a35f4cc00424", + "name": "orgs_github-api-test-org_teams_dummy-team", "request": { - "url": "/orgs/github-api-test-org/teams", + "url": "/orgs/github-api-test-org/teams/dummy-team", "method": "GET", "headers": { "Accept": { @@ -12,39 +12,38 @@ }, "response": { "status": 200, - "bodyFileName": "orgs_github-api-test-org_teams-a484e2dd-2e6c-4f40-b6f1-d706dfdfa3d9.json", + "bodyFileName": "orgs_github-api-test-org_teams_dummy-team-b239719e-8610-449b-91bd-a35f4cc00424.json", "headers": { - "Date": "Thu, 03 Oct 2019 21:51:10 GMT", + "Date": "Tue, 17 Mar 2020 09:12:22 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4949", - "X-RateLimit-Reset": "1570141865", + "X-RateLimit-Remaining": "4444", + "X-RateLimit-Reset": "1584436622", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"d73a82173554b9946f9c6dc2ec80456a\"", - "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "ETag": "W/\"a3be19ac98441e2833990a01948c5bbd\"", + "Last-Modified": "Tue, 17 Mar 2020 09:06:57 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", - "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": "CD3D:6B2E:1761989:1B9D677:5D966D4E" + "X-GitHub-Request-Id": "F8C7:46E1:A3A28:151EF6:5E709475" } }, - "uuid": "a484e2dd-2e6c-4f40-b6f1-d706dfdfa3d9", + "uuid": "b239719e-8610-449b-91bd-a35f4cc00424", "persistent": true, - "scenarioName": "scenario-1-orgs-github-api-test-org-teams", + "scenarioName": "scenario-1-orgs-github-api-test-org-teams-dummy-team", "requiredScenarioState": "Started", - "newScenarioState": "scenario-1-orgs-github-api-test-org-teams-2", + "newScenarioState": "scenario-1-orgs-github-api-test-org-teams-dummy-team-2", "insertionIndex": 3 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org_teams-5-68c43a.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org_teams_dummy-team-5-32efe6.json similarity index 52% rename from src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org_teams-5-68c43a.json rename to src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org_teams_dummy-team-5-32efe6.json index 34bea55df9..f5805676a4 100644 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org_teams-5-68c43a.json +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org_teams_dummy-team-5-32efe6.json @@ -1,8 +1,8 @@ { - "id": "68c43ac4-fc58-45c5-a11d-1c8b40865abe", - "name": "orgs_github-api-test-org_teams", + "id": "32efe61a-4308-46c2-a349-010050ec8685", + "name": "orgs_github-api-test-org_teams_dummy-team", "request": { - "url": "/orgs/github-api-test-org/teams", + "url": "/orgs/github-api-test-org/teams/dummy-team", "method": "GET", "headers": { "Accept": { @@ -12,39 +12,38 @@ }, "response": { "status": 200, - "bodyFileName": "orgs_github-api-test-org_teams-68c43ac4-fc58-45c5-a11d-1c8b40865abe.json", + "bodyFileName": "orgs_github-api-test-org_teams_dummy-team-32efe61a-4308-46c2-a349-010050ec8685.json", "headers": { - "Date": "Thu, 03 Oct 2019 21:51:11 GMT", + "Date": "Tue, 17 Mar 2020 09:12:22 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4947", - "X-RateLimit-Reset": "1570141865", + "X-RateLimit-Remaining": "4442", + "X-RateLimit-Reset": "1584436621", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"0ccc06ab48d951052103023fd054c3e4\"", - "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "ETag": "W/\"75d86f6a186a1443ab68cf325a05da6a\"", + "Last-Modified": "Tue, 17 Mar 2020 09:12:22 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", - "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": "CD3D:6B2E:17619ED:1B9D6DA:5D966D4F" + "X-GitHub-Request-Id": "F8C7:46E1:A3A3F:151F13:5E709476" } }, - "uuid": "68c43ac4-fc58-45c5-a11d-1c8b40865abe", + "uuid": "32efe61a-4308-46c2-a349-010050ec8685", "persistent": true, - "scenarioName": "scenario-1-orgs-github-api-test-org-teams", - "requiredScenarioState": "scenario-1-orgs-github-api-test-org-teams-2", - "newScenarioState": "scenario-1-orgs-github-api-test-org-teams-3", + "scenarioName": "scenario-1-orgs-github-api-test-org-teams-dummy-team", + "requiredScenarioState": "scenario-1-orgs-github-api-test-org-teams-dummy-team-2", + "newScenarioState": "scenario-1-orgs-github-api-test-org-teams-dummy-team-3", "insertionIndex": 5 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org_teams_dummy-team-7-32b16e.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org_teams_dummy-team-7-32b16e.json new file mode 100644 index 0000000000..da7330dcf4 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/orgs_github-api-test-org_teams_dummy-team-7-32b16e.json @@ -0,0 +1,48 @@ +{ + "id": "32b16e2a-e453-4e91-9442-08073572a327", + "name": "orgs_github-api-test-org_teams_dummy-team", + "request": { + "url": "/orgs/github-api-test-org/teams/dummy-team", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org_teams_dummy-team-32b16e2a-e453-4e91-9442-08073572a327.json", + "headers": { + "Date": "Tue, 17 Mar 2020 09:12:23 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4440", + "X-RateLimit-Reset": "1584436621", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"b8ddc7cdc32515a463c5e60f9f253dd1\"", + "Last-Modified": "Tue, 17 Mar 2020 09:12:23 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": "F8C7:46E1:A3A4D:151F20:5E709477" + } + }, + "uuid": "32b16e2a-e453-4e91-9442-08073572a327", + "persistent": true, + "scenarioName": "scenario-1-orgs-github-api-test-org-teams-dummy-team", + "requiredScenarioState": "scenario-1-orgs-github-api-test-org-teams-dummy-team-3", + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/teams_3451996-4-f0db29.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/teams_3451996-4-a86786.json similarity index 57% rename from src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/teams_3451996-4-f0db29.json rename to src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/teams_3451996-4-a86786.json index 7253eb878b..d71783e3a3 100644 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/teams_3451996-4-f0db29.json +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/teams_3451996-4-a86786.json @@ -1,54 +1,55 @@ { - "id": "f0db2900-a58f-48e3-abde-f1e1c42a153d", + "id": "a8678668-24d0-4f75-b5a3-da720a764dd6", "name": "teams_3451996", "request": { "url": "/teams/3451996", "method": "PATCH", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, "bodyPatterns": [ { "equalToJson": "{\"description\":\"Updated by API Test\"}", "ignoreArrayOrder": true, "ignoreExtraElements": true } - ], - "headers": { - "Accept": { - "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" - } - } + ] }, "response": { "status": 200, - "bodyFileName": "teams_3451996-f0db2900-a58f-48e3-abde-f1e1c42a153d.json", + "bodyFileName": "teams_3451996-a8678668-24d0-4f75-b5a3-da720a764dd6.json", "headers": { - "Date": "Thu, 03 Oct 2019 21:51:11 GMT", + "Date": "Tue, 17 Mar 2020 09:12:22 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4948", - "X-RateLimit-Reset": "1570141865", + "X-RateLimit-Remaining": "4443", + "X-RateLimit-Reset": "1584436621", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"047f21e560182f4fae4984f06a6a46e2\"", - "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "ETag": "W/\"6d0f4cb5dd3a7f45b3267da728da2e09\"", + "X-OAuth-Scopes": "admin:org, admin:public_key, admin:repo_hook, notifications, repo, user", "X-Accepted-OAuth-Scopes": "admin:org, 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": "*", + "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": "CD3D:6B2E:17619A6:1B9D697:5D966D4E" + "X-GitHub-Request-Id": "F8C7:46E1:A3A32:151F01:5E709476", + "Link": "; rel=\"deprecation\"; type=\"text/html\", ; rel=\"alternate\"" } }, - "uuid": "f0db2900-a58f-48e3-abde-f1e1c42a153d", + "uuid": "a8678668-24d0-4f75-b5a3-da720a764dd6", "persistent": true, "insertionIndex": 4 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/teams_3451996-6-5ffee5.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/teams_3451996-6-de9b6c.json similarity index 57% rename from src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/teams_3451996-6-5ffee5.json rename to src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/teams_3451996-6-de9b6c.json index 09d17186a7..6cd3df1425 100644 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/teams_3451996-6-5ffee5.json +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/teams_3451996-6-de9b6c.json @@ -1,54 +1,55 @@ { - "id": "5ffee54e-5b33-40f8-8eed-22f6474383bb", + "id": "de9b6c26-1f63-4cc3-b4f6-6691f9bf180c", "name": "teams_3451996", "request": { "url": "/teams/3451996", "method": "PATCH", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, "bodyPatterns": [ { "equalToJson": "{\"description\":\"Updated by API TestModified\"}", "ignoreArrayOrder": true, "ignoreExtraElements": true } - ], - "headers": { - "Accept": { - "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" - } - } + ] }, "response": { "status": 200, - "bodyFileName": "teams_3451996-5ffee54e-5b33-40f8-8eed-22f6474383bb.json", + "bodyFileName": "teams_3451996-de9b6c26-1f63-4cc3-b4f6-6691f9bf180c.json", "headers": { - "Date": "Thu, 03 Oct 2019 21:51:11 GMT", + "Date": "Tue, 17 Mar 2020 09:12:23 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4946", - "X-RateLimit-Reset": "1570141865", + "X-RateLimit-Remaining": "4441", + "X-RateLimit-Reset": "1584436622", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"49aed5d505fd19b6d2f60b14848e762c\"", - "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "ETag": "W/\"c406eaf9f146399b1f43691171336958\"", + "X-OAuth-Scopes": "admin:org, admin:public_key, admin:repo_hook, notifications, repo, user", "X-Accepted-OAuth-Scopes": "admin:org, 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": "*", + "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": "CD3D:6B2E:17619FF:1B9D706:5D966D4F" + "X-GitHub-Request-Id": "F8C7:46E1:A3A43:151F17:5E709476", + "Link": "; rel=\"deprecation\"; type=\"text/html\", ; rel=\"alternate\"" } }, - "uuid": "5ffee54e-5b33-40f8-8eed-22f6474383bb", + "uuid": "de9b6c26-1f63-4cc3-b4f6-6691f9bf180c", "persistent": true, "insertionIndex": 6 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/user-1-fd7e48.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/user-1-fd7e48.json new file mode 100644 index 0000000000..3d6c546c36 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/mappings/user-1-fd7e48.json @@ -0,0 +1,46 @@ +{ + "id": "fd7e486f-6713-462f-955f-7fcb8535064e", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-fd7e486f-6713-462f-955f-7fcb8535064e.json", + "headers": { + "Date": "Tue, 17 Mar 2020 09:12:20 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4447", + "X-RateLimit-Reset": "1584436621", + "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": "F8C7:46E1:A3A09:151ECC:5E709474" + } + }, + "uuid": "fd7e486f-6713-462f-955f-7fcb8535064e", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org-daa5182f-9078-4e4d-ab7e-3b9c54383a8c.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org-daa5182f-9078-4e4d-ab7e-3b9c54383a8c.json new file mode 100644 index 0000000000..9c94208761 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org-daa5182f-9078-4e4d-ab7e-3b9c54383a8c.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "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/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/github-api-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": 147, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 13, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org_teams-6cee550b-e151-4598-8736-68d408a7028f.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org_teams-6cee550b-e151-4598-8736-68d408a7028f.json deleted file mode 100644 index 68fe73ac38..0000000000 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org_teams-6cee550b-e151-4598-8736-68d408a7028f.json +++ /dev/null @@ -1,58 +0,0 @@ -[ - { - "name": "Core Developers", - "id": 3617900, - "node_id": "MDQ6VGVhbTM2MTc5MDA=", - "slug": "core-developers", - "description": "", - "privacy": "closed", - "url": "https://api.github.com/organizations/49127317/team/3617900", - "html_url": "https://github.com/orgs/github-api-test-org/teams/core-developers", - "members_url": "https://api.github.com/organizations/49127317/team/3617900/members{/member}", - "repositories_url": "https://api.github.com/organizations/49127317/team/3617900/repos", - "permission": "pull", - "parent": null - }, - { - "name": "dummy-team", - "id": 3618279, - "node_id": "MDQ6VGVhbTM2MTgyNzk=", - "slug": "dummy-team", - "description": "", - "privacy": "secret", - "url": "https://api.github.com/organizations/49127317/team/3618279", - "html_url": "https://github.com/orgs/github-api-test-org/teams/dummy-team", - "members_url": "https://api.github.com/organizations/49127317/team/3618279/members{/member}", - "repositories_url": "https://api.github.com/organizations/49127317/team/3618279/repos", - "permission": "pull", - "parent": null - }, - { - "name": "slack-plugin Developers", - "id": 3618268, - "node_id": "MDQ6VGVhbTM2MTgyNjg=", - "slug": "slack-plugin-developers", - "description": null, - "privacy": "closed", - "url": "https://api.github.com/organizations/49127317/team/3618268", - "html_url": "https://github.com/orgs/github-api-test-org/teams/slack-plugin-developers", - "members_url": "https://api.github.com/organizations/49127317/team/3618268/members{/member}", - "repositories_url": "https://api.github.com/organizations/49127317/team/3618268/repos", - "permission": "pull", - "parent": null - }, - { - "name": "bitwiseman-team", - "id": 3617890, - "node_id": "MDQ6VGVhbTM2MTc4OTA=", - "slug": "bitwiseman-team", - "description": "", - "privacy": "secret", - "url": "https://api.github.com/organizations/49127317/team/3617890", - "html_url": "https://github.com/orgs/github-api-test-org/teams/bitwiseman-team", - "members_url": "https://api.github.com/organizations/49127317/team/3617890/members{/member}", - "repositories_url": "https://api.github.com/organizations/49127317/team/3617890/repos", - "permission": "pull", - "parent": null - } -] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org_teams-9ce59a51-f556-4b3d-ac00-a4bf313ae3a8.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org_teams-9ce59a51-f556-4b3d-ac00-a4bf313ae3a8.json deleted file mode 100644 index 527c770b7a..0000000000 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org_teams-9ce59a51-f556-4b3d-ac00-a4bf313ae3a8.json +++ /dev/null @@ -1,58 +0,0 @@ -[ - { - "name": "Core Developers", - "id": 3617900, - "node_id": "MDQ6VGVhbTM2MTc5MDA=", - "slug": "core-developers", - "description": "", - "privacy": "closed", - "url": "https://api.github.com/organizations/49127317/team/3617900", - "html_url": "https://github.com/orgs/github-api-test-org/teams/core-developers", - "members_url": "https://api.github.com/organizations/49127317/team/3617900/members{/member}", - "repositories_url": "https://api.github.com/organizations/49127317/team/3617900/repos", - "permission": "pull", - "parent": null - }, - { - "name": "dummy-team", - "id": 3618279, - "node_id": "MDQ6VGVhbTM2MTgyNzk=", - "slug": "dummy-team", - "description": "", - "privacy": "closed", - "url": "https://api.github.com/organizations/49127317/team/3618279", - "html_url": "https://github.com/orgs/github-api-test-org/teams/dummy-team", - "members_url": "https://api.github.com/organizations/49127317/team/3618279/members{/member}", - "repositories_url": "https://api.github.com/organizations/49127317/team/3618279/repos", - "permission": "pull", - "parent": null - }, - { - "name": "slack-plugin Developers", - "id": 3618268, - "node_id": "MDQ6VGVhbTM2MTgyNjg=", - "slug": "slack-plugin-developers", - "description": null, - "privacy": "closed", - "url": "https://api.github.com/organizations/49127317/team/3618268", - "html_url": "https://github.com/orgs/github-api-test-org/teams/slack-plugin-developers", - "members_url": "https://api.github.com/organizations/49127317/team/3618268/members{/member}", - "repositories_url": "https://api.github.com/organizations/49127317/team/3618268/repos", - "permission": "pull", - "parent": null - }, - { - "name": "bitwiseman-team", - "id": 3617890, - "node_id": "MDQ6VGVhbTM2MTc4OTA=", - "slug": "bitwiseman-team", - "description": "", - "privacy": "secret", - "url": "https://api.github.com/organizations/49127317/team/3617890", - "html_url": "https://github.com/orgs/github-api-test-org/teams/bitwiseman-team", - "members_url": "https://api.github.com/organizations/49127317/team/3617890/members{/member}", - "repositories_url": "https://api.github.com/organizations/49127317/team/3617890/repos", - "permission": "pull", - "parent": null - } -] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org_teams-9f5e2094-9034-4769-bb8c-0d82ff6db9c5.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org_teams-9f5e2094-9034-4769-bb8c-0d82ff6db9c5.json deleted file mode 100644 index 68fe73ac38..0000000000 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org_teams-9f5e2094-9034-4769-bb8c-0d82ff6db9c5.json +++ /dev/null @@ -1,58 +0,0 @@ -[ - { - "name": "Core Developers", - "id": 3617900, - "node_id": "MDQ6VGVhbTM2MTc5MDA=", - "slug": "core-developers", - "description": "", - "privacy": "closed", - "url": "https://api.github.com/organizations/49127317/team/3617900", - "html_url": "https://github.com/orgs/github-api-test-org/teams/core-developers", - "members_url": "https://api.github.com/organizations/49127317/team/3617900/members{/member}", - "repositories_url": "https://api.github.com/organizations/49127317/team/3617900/repos", - "permission": "pull", - "parent": null - }, - { - "name": "dummy-team", - "id": 3618279, - "node_id": "MDQ6VGVhbTM2MTgyNzk=", - "slug": "dummy-team", - "description": "", - "privacy": "secret", - "url": "https://api.github.com/organizations/49127317/team/3618279", - "html_url": "https://github.com/orgs/github-api-test-org/teams/dummy-team", - "members_url": "https://api.github.com/organizations/49127317/team/3618279/members{/member}", - "repositories_url": "https://api.github.com/organizations/49127317/team/3618279/repos", - "permission": "pull", - "parent": null - }, - { - "name": "slack-plugin Developers", - "id": 3618268, - "node_id": "MDQ6VGVhbTM2MTgyNjg=", - "slug": "slack-plugin-developers", - "description": null, - "privacy": "closed", - "url": "https://api.github.com/organizations/49127317/team/3618268", - "html_url": "https://github.com/orgs/github-api-test-org/teams/slack-plugin-developers", - "members_url": "https://api.github.com/organizations/49127317/team/3618268/members{/member}", - "repositories_url": "https://api.github.com/organizations/49127317/team/3618268/repos", - "permission": "pull", - "parent": null - }, - { - "name": "bitwiseman-team", - "id": 3617890, - "node_id": "MDQ6VGVhbTM2MTc4OTA=", - "slug": "bitwiseman-team", - "description": "", - "privacy": "secret", - "url": "https://api.github.com/organizations/49127317/team/3617890", - "html_url": "https://github.com/orgs/github-api-test-org/teams/bitwiseman-team", - "members_url": "https://api.github.com/organizations/49127317/team/3617890/members{/member}", - "repositories_url": "https://api.github.com/organizations/49127317/team/3617890/repos", - "permission": "pull", - "parent": null - } -] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org_teams_dummy-team-2b66312b-5707-492e-81cd-55b9f49b65f1.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org_teams_dummy-team-2b66312b-5707-492e-81cd-55b9f49b65f1.json new file mode 100644 index 0000000000..bc49473d04 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org_teams_dummy-team-2b66312b-5707-492e-81cd-55b9f49b65f1.json @@ -0,0 +1,43 @@ +{ + "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/github-api-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", + "created_at": "2019-10-03T21:46:12Z", + "updated_at": "2020-03-17T09:12:23Z", + "members_count": 1, + "repos_count": 1, + "organization": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "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/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/github-api-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/GHTeamTest/wiremock/testSetPrivacy/__files/teams_3618279-c20ae9c8-4d3b-4c67-bac6-c33c9ad7ac3e.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org_teams_dummy-team-47d338fd-8730-4953-94f1-2261a3d6e6a3.json similarity index 59% rename from src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/teams_3618279-c20ae9c8-4d3b-4c67-bac6-c33c9ad7ac3e.json rename to src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org_teams_dummy-team-47d338fd-8730-4953-94f1-2261a3d6e6a3.json index 66f7c6941f..30a2418540 100644 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/teams_3618279-c20ae9c8-4d3b-4c67-bac6-c33c9ad7ac3e.json +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org_teams_dummy-team-47d338fd-8730-4953-94f1-2261a3d6e6a3.json @@ -1,24 +1,23 @@ { "name": "dummy-team", - "id": 3618279, - "node_id": "MDQ6VGVhbTM2MTgyNzk=", + "id": 3451996, + "node_id": "MDQ6VGVhbTM0NTE5OTY=", "slug": "dummy-team", - "description": "", + "description": "Updated by API TestModified", "privacy": "closed", - "url": "https://api.github.com/organizations/49127317/team/3618279", + "url": "https://api.github.com/organizations/7544739/team/3451996", "html_url": "https://github.com/orgs/github-api-test-org/teams/dummy-team", - "members_url": "https://api.github.com/organizations/49127317/team/3618279/members{/member}", - "repositories_url": "https://api.github.com/organizations/49127317/team/3618279/repos", + "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, - "created_at": "2020-01-26T10:31:35Z", - "updated_at": "2020-01-26T10:43:13Z", + "created_at": "2019-10-03T21:46:12Z", + "updated_at": "2020-03-17T09:12:25Z", "members_count": 1, - "repos_count": 0, + "repos_count": 1, "organization": { "login": "github-api-test-org", - "id": 49127317, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjQ5MTI3MzE3", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", "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", @@ -26,18 +25,19 @@ "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/49127317?v=4", + "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": 5, + "public_repos": 26, "public_gists": 0, "followers": 0, "following": 0, "html_url": "https://github.com/github-api-test-org", - "created_at": "2019-03-31T17:42:10Z", - "updated_at": "2019-10-07T20:06:18Z", + "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/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org_teams_dummy-team-a73705e3-9d60-41e7-be95-b417ea3eb75d.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org_teams_dummy-team-a73705e3-9d60-41e7-be95-b417ea3eb75d.json new file mode 100644 index 0000000000..69eb9b02ee --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/orgs_github-api-test-org_teams_dummy-team-a73705e3-9d60-41e7-be95-b417ea3eb75d.json @@ -0,0 +1,43 @@ +{ + "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/github-api-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", + "created_at": "2019-10-03T21:46:12Z", + "updated_at": "2020-03-17T09:12:26Z", + "members_count": 1, + "repos_count": 1, + "organization": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "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/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/github-api-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/GHTeamTest/wiremock/testSetPrivacy/__files/teams_3451996-51846d5d-d6ae-4a92-b608-ecaa62c3b73b.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/teams_3451996-51846d5d-d6ae-4a92-b608-ecaa62c3b73b.json new file mode 100644 index 0000000000..da504756ec --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/teams_3451996-51846d5d-d6ae-4a92-b608-ecaa62c3b73b.json @@ -0,0 +1,43 @@ +{ + "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/github-api-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, + "created_at": "2019-10-03T21:46:12Z", + "updated_at": "2020-03-17T09:12:26Z", + "members_count": 1, + "repos_count": 1, + "organization": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "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/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/github-api-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization" + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/teams_3451996-5ffee54e-5b33-40f8-8eed-22f6474383bb.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/teams_3451996-70263be8-4b8a-4f60-9e0a-da31aae7519f.json similarity index 80% rename from src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/teams_3451996-5ffee54e-5b33-40f8-8eed-22f6474383bb.json rename to src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/teams_3451996-70263be8-4b8a-4f60-9e0a-da31aae7519f.json index 555fd3511c..e53c14e835 100644 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetDescription/__files/teams_3451996-5ffee54e-5b33-40f8-8eed-22f6474383bb.json +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/teams_3451996-70263be8-4b8a-4f60-9e0a-da31aae7519f.json @@ -5,15 +5,16 @@ "slug": "dummy-team", "description": "Updated by API TestModified", "privacy": "closed", - "url": "https://api.github.com/teams/3451996", + "url": "https://api.github.com/organizations/7544739/team/3451996", "html_url": "https://github.com/orgs/github-api-test-org/teams/dummy-team", - "members_url": "https://api.github.com/teams/3451996/members{/member}", - "repositories_url": "https://api.github.com/teams/3451996/repos", + "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, "created_at": "2019-10-03T21:46:12Z", - "updated_at": "2019-10-03T21:51:11Z", + "updated_at": "2020-03-17T09:12:25Z", "members_count": 1, - "repos_count": 0, + "repos_count": 1, "organization": { "login": "github-api-test-org", "id": 7544739, @@ -30,7 +31,7 @@ "is_verified": false, "has_organization_projects": true, "has_repository_projects": true, - "public_repos": 9, + "public_repos": 26, "public_gists": 0, "followers": 0, "following": 0, diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/user-ba4c373b-e7b2-498a-adc1-e63cacdd50cb.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/user-ba4c373b-e7b2-498a-adc1-e63cacdd50cb.json new file mode 100644 index 0000000000..3ed6e3f008 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/user-ba4c373b-e7b2-498a-adc1-e63cacdd50cb.json @@ -0,0 +1,45 @@ +{ + "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/GHTeamTest/wiremock/testSetPrivacy/__files/user-bc58c48e-2441-4377-aa9a-e58df4073c39.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/user-bc58c48e-2441-4377-aa9a-e58df4073c39.json deleted file mode 100644 index 95d5b69c08..0000000000 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/__files/user-bc58c48e-2441-4377-aa9a-e58df4073c39.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "login": "bitwiseman", - "id": 21194782, - "node_id": "MDQ6VXNlcjIxMTk0Nzgy", - "avatar_url": "https://avatars3.githubusercontent.com/u/21194782?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/bitwiseman", - "html_url": "https://github.com/bitwiseman", - "followers_url": "https://api.github.com/users/bitwiseman/followers", - "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", - "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", - "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", - "organizations_url": "https://api.github.com/users/bitwiseman/orgs", - "repos_url": "https://api.github.com/users/bitwiseman/repos", - "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", - "received_events_url": "https://api.github.com/users/bitwiseman/received_events", - "type": "User", - "site_admin": false, - "name": "Tim Jacomb", - "company": "@KainosSoftwareLtd", - "blog": "", - "location": "UK", - "email": null, - "hireable": null, - "bio": "Software engineer and development best practices advocate.", - "public_repos": 137, - "public_gists": 17, - "followers": 17, - "following": 2, - "created_at": "2016-08-23T10:16:42Z", - "updated_at": "2020-01-26T08:50:30Z", - "private_gists": 11, - "total_private_repos": 6, - "owned_private_repos": 3, - "disk_usage": 33230, - "collaborators": 2, - "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/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org-2-daa518.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org-2-daa518.json new file mode 100644 index 0000000000..f2d8ba98bc --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org-2-daa518.json @@ -0,0 +1,46 @@ +{ + "id": "daa5182f-9078-4e4d-ab7e-3b9c54383a8c", + "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-daa5182f-9078-4e4d-ab7e-3b9c54383a8c.json", + "headers": { + "Date": "Tue, 17 Mar 2020 09:12:24 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4437", + "X-RateLimit-Reset": "1584436621", + "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", + "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": "F8CD:0B9D:AAA22:159549:5E709478" + } + }, + "uuid": "daa5182f-9078-4e4d-ab7e-3b9c54383a8c", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org_teams-3-6cee55.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org_teams-3-6cee55.json deleted file mode 100644 index 5982f5287c..0000000000 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org_teams-3-6cee55.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "id": "6cee550b-e151-4598-8736-68d408a7028f", - "name": "orgs_github-api-test-org_teams", - "request": { - "url": "/orgs/github-api-test-org/teams", - "method": "GET", - "headers": { - "Accept": { - "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" - } - } - }, - "response": { - "status": 200, - "bodyFileName": "orgs_github-api-test-org_teams-6cee550b-e151-4598-8736-68d408a7028f.json", - "headers": { - "Date": "Sun, 26 Jan 2020 10:43:12 GMT", - "Content-Type": "application/json; charset=utf-8", - "Server": "GitHub.com", - "Status": "200 OK", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4924", - "X-RateLimit-Reset": "1580037742", - "Cache-Control": "private, max-age=60, s-maxage=60", - "Vary": [ - "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding", - "Accept-Encoding" - ], - "ETag": "W/\"2f6ea4e871ffd4cd3d81fa6ef489e9cf\"", - "X-OAuth-Scopes": "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, read:packages, repo, user, workflow, write:discussion, write:packages", - "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", - "X-GitHub-Media-Type": "unknown, github.v3", - "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": "F148:392DB:A5E20A6:C6B43DB:5E2D6D40" - } - }, - "uuid": "6cee550b-e151-4598-8736-68d408a7028f", - "persistent": true, - "scenarioName": "scenario-1-orgs-github-api-test-org-teams", - "requiredScenarioState": "Started", - "newScenarioState": "scenario-1-orgs-github-api-test-org-teams-2", - "insertionIndex": 3 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org_teams-7-9f5e20.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org_teams-7-9f5e20.json deleted file mode 100644 index 59565ebb00..0000000000 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org_teams-7-9f5e20.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "id": "9f5e2094-9034-4769-bb8c-0d82ff6db9c5", - "name": "orgs_github-api-test-org_teams", - "request": { - "url": "/orgs/github-api-test-org/teams", - "method": "GET", - "headers": { - "Accept": { - "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" - } - } - }, - "response": { - "status": 200, - "bodyFileName": "orgs_github-api-test-org_teams-9f5e2094-9034-4769-bb8c-0d82ff6db9c5.json", - "headers": { - "Date": "Sun, 26 Jan 2020 10:43:14 GMT", - "Content-Type": "application/json; charset=utf-8", - "Server": "GitHub.com", - "Status": "200 OK", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4920", - "X-RateLimit-Reset": "1580037742", - "Cache-Control": "private, max-age=60, s-maxage=60", - "Vary": [ - "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding", - "Accept-Encoding" - ], - "ETag": "W/\"2f6ea4e871ffd4cd3d81fa6ef489e9cf\"", - "X-OAuth-Scopes": "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, read:packages, repo, user, workflow, write:discussion, write:packages", - "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", - "X-GitHub-Media-Type": "unknown, github.v3", - "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": "F148:392DB:A5E23AF:C6B474B:5E2D6D42" - } - }, - "uuid": "9f5e2094-9034-4769-bb8c-0d82ff6db9c5", - "persistent": true, - "scenarioName": "scenario-1-orgs-github-api-test-org-teams", - "requiredScenarioState": "scenario-1-orgs-github-api-test-org-teams-3", - "insertionIndex": 7 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org_teams_dummy-team-3-2b6631.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org_teams_dummy-team-3-2b6631.json new file mode 100644 index 0000000000..38a9e3010c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org_teams_dummy-team-3-2b6631.json @@ -0,0 +1,49 @@ +{ + "id": "2b66312b-5707-492e-81cd-55b9f49b65f1", + "name": "orgs_github-api-test-org_teams_dummy-team", + "request": { + "url": "/orgs/github-api-test-org/teams/dummy-team", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org_teams_dummy-team-2b66312b-5707-492e-81cd-55b9f49b65f1.json", + "headers": { + "Date": "Tue, 17 Mar 2020 09:12:25 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4436", + "X-RateLimit-Reset": "1584436622", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"b8ddc7cdc32515a463c5e60f9f253dd1\"", + "Last-Modified": "Tue, 17 Mar 2020 09:12:23 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": "F8CD:0B9D:AAA25:159552:5E709478" + } + }, + "uuid": "2b66312b-5707-492e-81cd-55b9f49b65f1", + "persistent": true, + "scenarioName": "scenario-1-orgs-github-api-test-org-teams-dummy-team", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-orgs-github-api-test-org-teams-dummy-team-2", + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org_teams-5-9ce59a.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org_teams_dummy-team-5-47d338.json similarity index 50% rename from src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org_teams-5-9ce59a.json rename to src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org_teams_dummy-team-5-47d338.json index 973f719de0..bb58019964 100644 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org_teams-5-9ce59a.json +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org_teams_dummy-team-5-47d338.json @@ -1,8 +1,8 @@ { - "id": "9ce59a51-f556-4b3d-ac00-a4bf313ae3a8", - "name": "orgs_github-api-test-org_teams", + "id": "47d338fd-8730-4953-94f1-2261a3d6e6a3", + "name": "orgs_github-api-test-org_teams_dummy-team", "request": { - "url": "/orgs/github-api-test-org/teams", + "url": "/orgs/github-api-test-org/teams/dummy-team", "method": "GET", "headers": { "Accept": { @@ -12,39 +12,38 @@ }, "response": { "status": 200, - "bodyFileName": "orgs_github-api-test-org_teams-9ce59a51-f556-4b3d-ac00-a4bf313ae3a8.json", + "bodyFileName": "orgs_github-api-test-org_teams_dummy-team-47d338fd-8730-4953-94f1-2261a3d6e6a3.json", "headers": { - "Date": "Sun, 26 Jan 2020 10:43:13 GMT", + "Date": "Tue, 17 Mar 2020 09:12:26 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4922", - "X-RateLimit-Reset": "1580037742", + "X-RateLimit-Remaining": "4434", + "X-RateLimit-Reset": "1584436622", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"c1b31aa926aa74612905022fb6686f05\"", - "X-OAuth-Scopes": "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, read:packages, repo, user, workflow, write:discussion, write:packages", + "ETag": "W/\"619dbe2e4e0378bda45903a72aae4856\"", + "Last-Modified": "Tue, 17 Mar 2020 09:12:25 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", - "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": "F148:392DB:A5E224B:C6B45CC:5E2D6D41" + "X-GitHub-Request-Id": "F8CD:0B9D:AAA3D:15956A:5E709479" } }, - "uuid": "9ce59a51-f556-4b3d-ac00-a4bf313ae3a8", + "uuid": "47d338fd-8730-4953-94f1-2261a3d6e6a3", "persistent": true, - "scenarioName": "scenario-1-orgs-github-api-test-org-teams", - "requiredScenarioState": "scenario-1-orgs-github-api-test-org-teams-2", - "newScenarioState": "scenario-1-orgs-github-api-test-org-teams-3", + "scenarioName": "scenario-1-orgs-github-api-test-org-teams-dummy-team", + "requiredScenarioState": "scenario-1-orgs-github-api-test-org-teams-dummy-team-2", + "newScenarioState": "scenario-1-orgs-github-api-test-org-teams-dummy-team-3", "insertionIndex": 5 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org_teams_dummy-team-7-a73705.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org_teams_dummy-team-7-a73705.json new file mode 100644 index 0000000000..5458b6e9c2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/orgs_github-api-test-org_teams_dummy-team-7-a73705.json @@ -0,0 +1,48 @@ +{ + "id": "a73705e3-9d60-41e7-be95-b417ea3eb75d", + "name": "orgs_github-api-test-org_teams_dummy-team", + "request": { + "url": "/orgs/github-api-test-org/teams/dummy-team", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org_teams_dummy-team-a73705e3-9d60-41e7-be95-b417ea3eb75d.json", + "headers": { + "Date": "Tue, 17 Mar 2020 09:12:26 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4432", + "X-RateLimit-Reset": "1584436621", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"3760fae93c6e9cb6c970a0e6bdbcaf53\"", + "Last-Modified": "Tue, 17 Mar 2020 09:12:26 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": "F8CD:0B9D:AAA56:159586:5E70947A" + } + }, + "uuid": "a73705e3-9d60-41e7-be95-b417ea3eb75d", + "persistent": true, + "scenarioName": "scenario-1-orgs-github-api-test-org-teams-dummy-team", + "requiredScenarioState": "scenario-1-orgs-github-api-test-org-teams-dummy-team-3", + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/teams_3618279-4-c20ae9.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/teams_3451996-4-70263b.json similarity index 53% rename from src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/teams_3618279-4-c20ae9.json rename to src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/teams_3451996-4-70263b.json index 7b0ecb9450..f56edd69d6 100644 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/teams_3618279-4-c20ae9.json +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/teams_3451996-4-70263b.json @@ -1,8 +1,8 @@ { - "id": "c20ae9c8-4d3b-4c67-bac6-c33c9ad7ac3e", - "name": "teams_3618279", + "id": "70263be8-4b8a-4f60-9e0a-da31aae7519f", + "name": "teams_3451996", "request": { - "url": "/teams/3618279", + "url": "/teams/3451996", "method": "PATCH", "headers": { "Accept": { @@ -19,36 +19,37 @@ }, "response": { "status": 200, - "bodyFileName": "teams_3618279-c20ae9c8-4d3b-4c67-bac6-c33c9ad7ac3e.json", + "bodyFileName": "teams_3451996-70263be8-4b8a-4f60-9e0a-da31aae7519f.json", "headers": { - "Date": "Sun, 26 Jan 2020 10:43:13 GMT", + "Date": "Tue, 17 Mar 2020 09:12:25 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4923", - "X-RateLimit-Reset": "1580037742", + "X-RateLimit-Remaining": "4435", + "X-RateLimit-Reset": "1584436621", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"3ac724b425d03a7e376d9ed5b8d309b6\"", - "X-OAuth-Scopes": "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, read:packages, repo, user, workflow, write:discussion, write:packages", + "ETag": "W/\"2fe6e6489fcf0675c858e5ea4b20b84d\"", + "X-OAuth-Scopes": "admin:org, admin:public_key, admin:repo_hook, notifications, repo, user", "X-Accepted-OAuth-Scopes": "admin:org, 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": "*", + "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": "F148:392DB:A5E211C:C6B4468:5E2D6D40" + "X-GitHub-Request-Id": "F8CD:0B9D:AAA2A:159557:5E709479", + "Link": "; rel=\"deprecation\"; type=\"text/html\", ; rel=\"alternate\"" } }, - "uuid": "c20ae9c8-4d3b-4c67-bac6-c33c9ad7ac3e", + "uuid": "70263be8-4b8a-4f60-9e0a-da31aae7519f", "persistent": true, "insertionIndex": 4 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/teams_3618279-6-f0948c.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/teams_3451996-6-51846d.json similarity index 53% rename from src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/teams_3618279-6-f0948c.json rename to src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/teams_3451996-6-51846d.json index 0543b6324e..3aa0ada9d1 100644 --- a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/teams_3618279-6-f0948c.json +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/teams_3451996-6-51846d.json @@ -1,8 +1,8 @@ { - "id": "f0948c22-babf-430d-beb6-2daf5efd7541", - "name": "teams_3618279", + "id": "51846d5d-d6ae-4a92-b608-ecaa62c3b73b", + "name": "teams_3451996", "request": { - "url": "/teams/3618279", + "url": "/teams/3451996", "method": "PATCH", "headers": { "Accept": { @@ -19,36 +19,37 @@ }, "response": { "status": 200, - "bodyFileName": "teams_3618279-f0948c22-babf-430d-beb6-2daf5efd7541.json", + "bodyFileName": "teams_3451996-51846d5d-d6ae-4a92-b608-ecaa62c3b73b.json", "headers": { - "Date": "Sun, 26 Jan 2020 10:43:14 GMT", + "Date": "Tue, 17 Mar 2020 09:12:26 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4921", - "X-RateLimit-Reset": "1580037743", + "X-RateLimit-Remaining": "4433", + "X-RateLimit-Reset": "1584436621", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"ba2374df0a799986650ab0776b0ddede\"", - "X-OAuth-Scopes": "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, read:packages, repo, user, workflow, write:discussion, write:packages", + "ETag": "W/\"6921bb0eae21f588783eaca69c02f0e0\"", + "X-OAuth-Scopes": "admin:org, admin:public_key, admin:repo_hook, notifications, repo, user", "X-Accepted-OAuth-Scopes": "admin:org, 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": "*", + "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": "F148:392DB:A5E22BB:C6B464B:5E2D6D41" + "X-GitHub-Request-Id": "F8CD:0B9D:AAA42:159570:5E70947A", + "Link": "; rel=\"deprecation\"; type=\"text/html\", ; rel=\"alternate\"" } }, - "uuid": "f0948c22-babf-430d-beb6-2daf5efd7541", + "uuid": "51846d5d-d6ae-4a92-b608-ecaa62c3b73b", "persistent": true, "insertionIndex": 6 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/user-1-ba4c37.json b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/user-1-ba4c37.json new file mode 100644 index 0000000000..340c7cf202 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHTeamTest/wiremock/testSetPrivacy/mappings/user-1-ba4c37.json @@ -0,0 +1,46 @@ +{ + "id": "ba4c373b-e7b2-498a-adc1-e63cacdd50cb", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-ba4c373b-e7b2-498a-adc1-e63cacdd50cb.json", + "headers": { + "Date": "Tue, 17 Mar 2020 09:12:24 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4439", + "X-RateLimit-Reset": "1584436621", + "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": "F8CD:0B9D:AAA18:159545:5E709478" + } + }, + "uuid": "ba4c373b-e7b2-498a-adc1-e63cacdd50cb", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file