diff --git a/src/test/java/org/kohsuke/github/GHBranchProtectionTest.java b/src/test/java/org/kohsuke/github/GHBranchProtectionTest.java index 73e117bfe1..142d27492d 100755 --- a/src/test/java/org/kohsuke/github/GHBranchProtectionTest.java +++ b/src/test/java/org/kohsuke/github/GHBranchProtectionTest.java @@ -57,6 +57,7 @@ public void testEnableProtectionOnly() throws Exception { @Test public void testDisableProtectionOnly() throws Exception { GHBranchProtection protection = branch.enableProtection().enable(); + assertTrue(repo.getBranch(BRANCH).isProtected()); branch.disableProtection(); assertFalse(repo.getBranch(BRANCH).isProtected()); } diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/__files/repos_github-api-test-org_temp-testdisableprotectiononly-2.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/__files/repos_github-api-test-org_temp-testdisableprotectiononly-2.json new file mode 100644 index 0000000000..f1b57e821d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/__files/repos_github-api-test-org_temp-testdisableprotectiononly-2.json @@ -0,0 +1,126 @@ +{ + "id": 258288342, + "node_id": "MDEwOlJlcG9zaXRvcnkyNTgyODgzNDI=", + "name": "temp-testDisableProtectionOnly", + "full_name": "github-api-test-org/temp-testDisableProtectionOnly", + "private": false, + "owner": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api-test-org", + "html_url": "https://github.com/github-api-test-org", + "followers_url": "https://api.github.com/users/github-api-test-org/followers", + "following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/github-api-test-org/orgs", + "repos_url": "https://api.github.com/users/github-api-test-org/repos", + "events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/github-api-test-org/temp-testDisableProtectionOnly", + "description": "A test repository for testing the github-api project: temp-testDisableProtectionOnly", + "fork": false, + "url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly", + "forks_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/forks", + "keys_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/teams", + "hooks_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/hooks", + "issue_events_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/events", + "assignees_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/tags", + "blobs_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/languages", + "stargazers_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/stargazers", + "contributors_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/contributors", + "subscribers_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/subscribers", + "subscription_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/subscription", + "commits_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/merges", + "archive_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/downloads", + "issues_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/deployments", + "created_at": "2020-04-23T17:59:02Z", + "updated_at": "2020-04-23T17:59:06Z", + "pushed_at": "2020-04-23T17:59:04Z", + "git_url": "git://github.com/github-api-test-org/temp-testDisableProtectionOnly.git", + "ssh_url": "git@github.com:github-api-test-org/temp-testDisableProtectionOnly.git", + "clone_url": "https://github.com/github-api-test-org/temp-testDisableProtectionOnly.git", + "svn_url": "https://github.com/github-api-test-org/temp-testDisableProtectionOnly", + "homepage": "http://github-api.kohsuke.org/", + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "delete_branch_on_merge": false, + "organization": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api-test-org", + "html_url": "https://github.com/github-api-test-org", + "followers_url": "https://api.github.com/users/github-api-test-org/followers", + "following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/github-api-test-org/orgs", + "repos_url": "https://api.github.com/users/github-api-test-org/repos", + "events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 0, + "subscribers_count": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/__files/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-3.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/__files/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-3.json new file mode 100644 index 0000000000..0bd8857239 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/__files/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-3.json @@ -0,0 +1,89 @@ +{ + "name": "master", + "commit": { + "sha": "dd8ce25034e85973a8cfacb1b379571ea3b4a8a6", + "node_id": "MDY6Q29tbWl0MjU4Mjg4MzQyOmRkOGNlMjUwMzRlODU5NzNhOGNmYWNiMWIzNzk1NzFlYTNiNGE4YTY=", + "commit": { + "author": { + "name": "Liam Newman", + "email": "bitwiseman@gmail.com", + "date": "2020-04-23T17:59:03Z" + }, + "committer": { + "name": "GitHub", + "email": "noreply@github.com", + "date": "2020-04-23T17:59:03Z" + }, + "message": "Initial commit", + "tree": { + "sha": "e0f408fb90498b93fb29f15f65a716d635b935aa", + "url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/git/trees/e0f408fb90498b93fb29f15f65a716d635b935aa" + }, + "url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/git/commits/dd8ce25034e85973a8cfacb1b379571ea3b4a8a6", + "comment_count": 0, + "verification": { + "verified": true, + "reason": "valid", + "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBcBAABCAAQBQJeoddnCRBK7hj4Ov3rIwAAdHIIAIv1r34nroEHWPNwCvI3P/A7\ng3nDhupwv9OerOc+bvMeovLfsKIkpiHmz3qESI2ei5XL6ZNPffbhe1w7GG8ISF5g\ncJLQ84D+qk/rcOni3PJZj2n/3ChB+//lid6Op2O6TUuZ1omoxIeNzurIUJ7H0gux\nUB0siDrXMc5XXZw5kGQBWwVbc0HVB6lyxQ6s1Ct8w3KgcEGkxv97QsAVR7SvKir2\naI/uu0TB61KnsKh5igvGyT5i+a+fgMXsyV9i/qGSCvoueehSRa5XUHWD8hyDJOBG\nXwOzn696UNyl+0xZo/zHq2fyTeJY8siEyASpAh4KQkGbSHYNakLu+vxzwBB9U28=\n=3X5V\n-----END PGP SIGNATURE-----\n", + "payload": "tree e0f408fb90498b93fb29f15f65a716d635b935aa\nauthor Liam Newman 1587664743 -0700\ncommitter GitHub 1587664743 -0700\n\nInitial commit" + } + }, + "url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/commits/dd8ce25034e85973a8cfacb1b379571ea3b4a8a6", + "html_url": "https://github.com/github-api-test-org/temp-testDisableProtectionOnly/commit/dd8ce25034e85973a8cfacb1b379571ea3b4a8a6", + "comments_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/commits/dd8ce25034e85973a8cfacb1b379571ea3b4a8a6/comments", + "author": { + "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 + }, + "committer": { + "login": "web-flow", + "id": 19864447, + "node_id": "MDQ6VXNlcjE5ODY0NDQ3", + "avatar_url": "https://avatars3.githubusercontent.com/u/19864447?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/web-flow", + "html_url": "https://github.com/web-flow", + "followers_url": "https://api.github.com/users/web-flow/followers", + "following_url": "https://api.github.com/users/web-flow/following{/other_user}", + "gists_url": "https://api.github.com/users/web-flow/gists{/gist_id}", + "starred_url": "https://api.github.com/users/web-flow/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/web-flow/subscriptions", + "organizations_url": "https://api.github.com/users/web-flow/orgs", + "repos_url": "https://api.github.com/users/web-flow/repos", + "events_url": "https://api.github.com/users/web-flow/events{/privacy}", + "received_events_url": "https://api.github.com/users/web-flow/received_events", + "type": "User", + "site_admin": false + }, + "parents": [] + }, + "_links": { + "self": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/branches/master", + "html": "https://github.com/github-api-test-org/temp-testDisableProtectionOnly/tree/master" + }, + "protected": false, + "protection": { + "enabled": false, + "required_status_checks": { + "enforcement_level": "off", + "contexts": [] + } + }, + "protection_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/branches/master/protection" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/__files/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-5.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/__files/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-5.json new file mode 100644 index 0000000000..880cd173ea --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/__files/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-5.json @@ -0,0 +1,89 @@ +{ + "name": "master", + "commit": { + "sha": "dd8ce25034e85973a8cfacb1b379571ea3b4a8a6", + "node_id": "MDY6Q29tbWl0MjU4Mjg4MzQyOmRkOGNlMjUwMzRlODU5NzNhOGNmYWNiMWIzNzk1NzFlYTNiNGE4YTY=", + "commit": { + "author": { + "name": "Liam Newman", + "email": "bitwiseman@gmail.com", + "date": "2020-04-23T17:59:03Z" + }, + "committer": { + "name": "GitHub", + "email": "noreply@github.com", + "date": "2020-04-23T17:59:03Z" + }, + "message": "Initial commit", + "tree": { + "sha": "e0f408fb90498b93fb29f15f65a716d635b935aa", + "url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/git/trees/e0f408fb90498b93fb29f15f65a716d635b935aa" + }, + "url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/git/commits/dd8ce25034e85973a8cfacb1b379571ea3b4a8a6", + "comment_count": 0, + "verification": { + "verified": true, + "reason": "valid", + "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBcBAABCAAQBQJeoddnCRBK7hj4Ov3rIwAAdHIIAIv1r34nroEHWPNwCvI3P/A7\ng3nDhupwv9OerOc+bvMeovLfsKIkpiHmz3qESI2ei5XL6ZNPffbhe1w7GG8ISF5g\ncJLQ84D+qk/rcOni3PJZj2n/3ChB+//lid6Op2O6TUuZ1omoxIeNzurIUJ7H0gux\nUB0siDrXMc5XXZw5kGQBWwVbc0HVB6lyxQ6s1Ct8w3KgcEGkxv97QsAVR7SvKir2\naI/uu0TB61KnsKh5igvGyT5i+a+fgMXsyV9i/qGSCvoueehSRa5XUHWD8hyDJOBG\nXwOzn696UNyl+0xZo/zHq2fyTeJY8siEyASpAh4KQkGbSHYNakLu+vxzwBB9U28=\n=3X5V\n-----END PGP SIGNATURE-----\n", + "payload": "tree e0f408fb90498b93fb29f15f65a716d635b935aa\nauthor Liam Newman 1587664743 -0700\ncommitter GitHub 1587664743 -0700\n\nInitial commit" + } + }, + "url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/commits/dd8ce25034e85973a8cfacb1b379571ea3b4a8a6", + "html_url": "https://github.com/github-api-test-org/temp-testDisableProtectionOnly/commit/dd8ce25034e85973a8cfacb1b379571ea3b4a8a6", + "comments_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/commits/dd8ce25034e85973a8cfacb1b379571ea3b4a8a6/comments", + "author": { + "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 + }, + "committer": { + "login": "web-flow", + "id": 19864447, + "node_id": "MDQ6VXNlcjE5ODY0NDQ3", + "avatar_url": "https://avatars3.githubusercontent.com/u/19864447?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/web-flow", + "html_url": "https://github.com/web-flow", + "followers_url": "https://api.github.com/users/web-flow/followers", + "following_url": "https://api.github.com/users/web-flow/following{/other_user}", + "gists_url": "https://api.github.com/users/web-flow/gists{/gist_id}", + "starred_url": "https://api.github.com/users/web-flow/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/web-flow/subscriptions", + "organizations_url": "https://api.github.com/users/web-flow/orgs", + "repos_url": "https://api.github.com/users/web-flow/repos", + "events_url": "https://api.github.com/users/web-flow/events{/privacy}", + "received_events_url": "https://api.github.com/users/web-flow/received_events", + "type": "User", + "site_admin": false + }, + "parents": [] + }, + "_links": { + "self": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/branches/master", + "html": "https://github.com/github-api-test-org/temp-testDisableProtectionOnly/tree/master" + }, + "protected": true, + "protection": { + "enabled": true, + "required_status_checks": { + "enforcement_level": "off", + "contexts": [] + } + }, + "protection_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/branches/master/protection" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/__files/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-7.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/__files/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-7.json new file mode 100644 index 0000000000..0bd8857239 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/__files/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-7.json @@ -0,0 +1,89 @@ +{ + "name": "master", + "commit": { + "sha": "dd8ce25034e85973a8cfacb1b379571ea3b4a8a6", + "node_id": "MDY6Q29tbWl0MjU4Mjg4MzQyOmRkOGNlMjUwMzRlODU5NzNhOGNmYWNiMWIzNzk1NzFlYTNiNGE4YTY=", + "commit": { + "author": { + "name": "Liam Newman", + "email": "bitwiseman@gmail.com", + "date": "2020-04-23T17:59:03Z" + }, + "committer": { + "name": "GitHub", + "email": "noreply@github.com", + "date": "2020-04-23T17:59:03Z" + }, + "message": "Initial commit", + "tree": { + "sha": "e0f408fb90498b93fb29f15f65a716d635b935aa", + "url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/git/trees/e0f408fb90498b93fb29f15f65a716d635b935aa" + }, + "url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/git/commits/dd8ce25034e85973a8cfacb1b379571ea3b4a8a6", + "comment_count": 0, + "verification": { + "verified": true, + "reason": "valid", + "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBcBAABCAAQBQJeoddnCRBK7hj4Ov3rIwAAdHIIAIv1r34nroEHWPNwCvI3P/A7\ng3nDhupwv9OerOc+bvMeovLfsKIkpiHmz3qESI2ei5XL6ZNPffbhe1w7GG8ISF5g\ncJLQ84D+qk/rcOni3PJZj2n/3ChB+//lid6Op2O6TUuZ1omoxIeNzurIUJ7H0gux\nUB0siDrXMc5XXZw5kGQBWwVbc0HVB6lyxQ6s1Ct8w3KgcEGkxv97QsAVR7SvKir2\naI/uu0TB61KnsKh5igvGyT5i+a+fgMXsyV9i/qGSCvoueehSRa5XUHWD8hyDJOBG\nXwOzn696UNyl+0xZo/zHq2fyTeJY8siEyASpAh4KQkGbSHYNakLu+vxzwBB9U28=\n=3X5V\n-----END PGP SIGNATURE-----\n", + "payload": "tree e0f408fb90498b93fb29f15f65a716d635b935aa\nauthor Liam Newman 1587664743 -0700\ncommitter GitHub 1587664743 -0700\n\nInitial commit" + } + }, + "url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/commits/dd8ce25034e85973a8cfacb1b379571ea3b4a8a6", + "html_url": "https://github.com/github-api-test-org/temp-testDisableProtectionOnly/commit/dd8ce25034e85973a8cfacb1b379571ea3b4a8a6", + "comments_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/commits/dd8ce25034e85973a8cfacb1b379571ea3b4a8a6/comments", + "author": { + "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 + }, + "committer": { + "login": "web-flow", + "id": 19864447, + "node_id": "MDQ6VXNlcjE5ODY0NDQ3", + "avatar_url": "https://avatars3.githubusercontent.com/u/19864447?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/web-flow", + "html_url": "https://github.com/web-flow", + "followers_url": "https://api.github.com/users/web-flow/followers", + "following_url": "https://api.github.com/users/web-flow/following{/other_user}", + "gists_url": "https://api.github.com/users/web-flow/gists{/gist_id}", + "starred_url": "https://api.github.com/users/web-flow/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/web-flow/subscriptions", + "organizations_url": "https://api.github.com/users/web-flow/orgs", + "repos_url": "https://api.github.com/users/web-flow/repos", + "events_url": "https://api.github.com/users/web-flow/events{/privacy}", + "received_events_url": "https://api.github.com/users/web-flow/received_events", + "type": "User", + "site_admin": false + }, + "parents": [] + }, + "_links": { + "self": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/branches/master", + "html": "https://github.com/github-api-test-org/temp-testDisableProtectionOnly/tree/master" + }, + "protected": false, + "protection": { + "enabled": false, + "required_status_checks": { + "enforcement_level": "off", + "contexts": [] + } + }, + "protection_url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/branches/master/protection" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/__files/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master_protection-4.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/__files/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master_protection-4.json new file mode 100644 index 0000000000..910977f94d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/__files/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master_protection-4.json @@ -0,0 +1,16 @@ +{ + "url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/branches/master/protection", + "enforce_admins": { + "url": "https://api.github.com/repos/github-api-test-org/temp-testDisableProtectionOnly/branches/master/protection/enforce_admins", + "enabled": false + }, + "required_linear_history": { + "enabled": false + }, + "allow_force_pushes": { + "enabled": false + }, + "allow_deletions": { + "enabled": false + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/__files/user-1.json new file mode 100644 index 0000000000..c16e56c77f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/__files/user-1.json @@ -0,0 +1,45 @@ +{ + "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": 182, + "public_gists": 7, + "followers": 158, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2020-04-19T04:18:55Z", + "private_gists": 11, + "total_private_repos": 10, + "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/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/repos_github-api-test-org_temp-testdisableprotectiononly-2.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/repos_github-api-test-org_temp-testdisableprotectiononly-2.json new file mode 100644 index 0000000000..9abdf9bceb --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/repos_github-api-test-org_temp-testdisableprotectiononly-2.json @@ -0,0 +1,46 @@ +{ + "id": "7fa3e8d5-63ba-4f76-8548-13e9f41f86cf", + "name": "repos_github-api-test-org_temp-testdisableprotectiononly", + "request": { + "url": "/repos/github-api-test-org/temp-testDisableProtectionOnly", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api-test-org_temp-testdisableprotectiononly-2.json", + "headers": { + "Date": "Thu, 23 Apr 2020 17:59:07 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4908", + "X-RateLimit-Reset": "1587666972", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8e553a2c680e2cfce12ca4605a3832a9\"", + "Last-Modified": "Thu, 23 Apr 2020 17:59:06 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "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": "F68E:7228:10E85B:149297:5EA1D765" + } + }, + "uuid": "7fa3e8d5-63ba-4f76-8548-13e9f41f86cf", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-3.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-3.json new file mode 100644 index 0000000000..f316409f8f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-3.json @@ -0,0 +1,48 @@ +{ + "id": "1b81c7e8-f51d-42f3-bcfe-e0893ea2b29d", + "name": "repos_github-api-test-org_temp-testdisableprotectiononly_branches_master", + "request": { + "url": "/repos/github-api-test-org/temp-testDisableProtectionOnly/branches/master", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-3.json", + "headers": { + "Date": "Thu, 23 Apr 2020 17:59:08 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4907", + "X-RateLimit-Reset": "1587666973", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"7c45580fa5c0f80cd87da42c36815e58\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "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": "F68E:7228:10E86E:1495EB:5EA1D76B" + } + }, + "uuid": "1b81c7e8-f51d-42f3-bcfe-e0893ea2b29d", + "persistent": true, + "scenarioName": "scenario-1-repos-github-api-test-org-temp-testDisableProtectionOnly-branches-master", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-repos-github-api-test-org-temp-testDisableProtectionOnly-branches-master-2", + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-5.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-5.json new file mode 100644 index 0000000000..21a7a2f4c5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-5.json @@ -0,0 +1,48 @@ +{ + "id": "e5ca49c0-ac4e-4372-a3b7-128ed8ebff41", + "name": "repos_github-api-test-org_temp-testdisableprotectiononly_branches_master", + "request": { + "url": "/repos/github-api-test-org/temp-testDisableProtectionOnly/branches/master", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-5.json", + "headers": { + "Date": "Thu, 23 Apr 2020 17:59:08 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4905", + "X-RateLimit-Reset": "1587666973", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"e8757475d9b3e089a5a3cd83499a2ceb\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "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": "F68E:7228:10E8B0:14962A:5EA1D76C" + } + }, + "uuid": "e5ca49c0-ac4e-4372-a3b7-128ed8ebff41", + "persistent": true, + "scenarioName": "scenario-1-repos-github-api-test-org-temp-testDisableProtectionOnly-branches-master", + "requiredScenarioState": "scenario-1-repos-github-api-test-org-temp-testDisableProtectionOnly-branches-master-2", + "newScenarioState": "scenario-1-repos-github-api-test-org-temp-testDisableProtectionOnly-branches-master-3", + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-7.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-7.json new file mode 100644 index 0000000000..774e972ee2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-7.json @@ -0,0 +1,47 @@ +{ + "id": "e224c5e4-46a7-4ada-970d-946f4c31c8b4", + "name": "repos_github-api-test-org_temp-testdisableprotectiononly_branches_master", + "request": { + "url": "/repos/github-api-test-org/temp-testDisableProtectionOnly/branches/master", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api-test-org_temp-testdisableprotectiononly_branches_master-7.json", + "headers": { + "Date": "Thu, 23 Apr 2020 17:59:09 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4903", + "X-RateLimit-Reset": "1587666973", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"7c45580fa5c0f80cd87da42c36815e58\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "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": "F68E:7228:10E8F2:149684:5EA1D76D" + } + }, + "uuid": "e224c5e4-46a7-4ada-970d-946f4c31c8b4", + "persistent": true, + "scenarioName": "scenario-1-repos-github-api-test-org-temp-testDisableProtectionOnly-branches-master", + "requiredScenarioState": "scenario-1-repos-github-api-test-org-temp-testDisableProtectionOnly-branches-master-3", + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master_protection-4.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master_protection-4.json new file mode 100644 index 0000000000..c42d9473e2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master_protection-4.json @@ -0,0 +1,52 @@ +{ + "id": "9b035670-667b-480f-9a95-29acd553979f", + "name": "repos_github-api-test-org_temp-testdisableprotectiononly_branches_master_protection", + "request": { + "url": "/repos/github-api-test-org/temp-testDisableProtectionOnly/branches/master/protection", + "method": "PUT", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.luke-cage-preview+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"required_pull_request_reviews\":null,\"required_status_checks\":null,\"restrictions\":null,\"enforce_admins\":false}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api-test-org_temp-testdisableprotectiononly_branches_master_protection-4.json", + "headers": { + "Date": "Thu, 23 Apr 2020 17:59:08 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4906", + "X-RateLimit-Reset": "1587666973", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"f36d8723d6bf669eda1f3f436c55694e\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "github.luke-cage-preview; format=json", + "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": "F68E:7228:10E886:14960A:5EA1D76C" + } + }, + "uuid": "9b035670-667b-480f-9a95-29acd553979f", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master_protection-6.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master_protection-6.json new file mode 100644 index 0000000000..1515002c9c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/repos_github-api-test-org_temp-testdisableprotectiononly_branches_master_protection-6.json @@ -0,0 +1,38 @@ +{ + "id": "8ba747c1-29f2-4096-ad2e-5a148448adc2", + "name": "repos_github-api-test-org_temp-testdisableprotectiononly_branches_master_protection", + "request": { + "url": "/repos/github-api-test-org/temp-testDisableProtectionOnly/branches/master/protection", + "method": "DELETE", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 204, + "headers": { + "Date": "Thu, 23 Apr 2020 17:59:09 GMT", + "Server": "GitHub.com", + "Status": "204 No Content", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4904", + "X-RateLimit-Reset": "1587666973", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "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": "F68E:7228:10E8C7:14965A:5EA1D76C" + } + }, + "uuid": "8ba747c1-29f2-4096-ad2e-5a148448adc2", + "persistent": true, + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/user-1.json new file mode 100644 index 0000000000..3cae29ce3b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testDisableProtectionOnly/mappings/user-1.json @@ -0,0 +1,46 @@ +{ + "id": "4d428d73-9af7-49af-aadd-cefd9eeefeff", + "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-1.json", + "headers": { + "Date": "Thu, 23 Apr 2020 17:59:01 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4913", + "X-RateLimit-Reset": "1587666973", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"ab45a166d7cdaf4738db7876a0b1d296\"", + "Last-Modified": "Sun, 19 Apr 2020 04:18:55 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "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": "F68E:7228:10E570:149284:5EA1D765" + } + }, + "uuid": "4d428d73-9af7-49af-aadd-cefd9eeefeff", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file