type, T instance, int timeouts) throws IOException
return type.cast(Array.newInstance(type.getComponentType(), 0));
}
- // Response code 202 means the statistics are still being cached.
+ // Response code 202 means data is being generated still being cached.
+ // This happens in for statistics:
// See https://developer.github.com/v3/repos/statistics/#a-word-about-caching
+ // And for fork creation:
+ // See https://developer.github.com/v3/repos/forks/#create-a-fork
if (responseCode == 202) {
- LOGGER.log(INFO, "The statistics are still being generated. Please try again in 5 seconds.");
+ if (uc.getURL().toString().endsWith("/forks")) {
+ LOGGER.log(INFO, "The fork is being created. Please try again in 5 seconds.");
+ } else if (uc.getURL().toString().endsWith("/statistics")) {
+ LOGGER.log(INFO, "The statistics are being generated. Please try again in 5 seconds.");
+ } else {
+ LOGGER.log(INFO,
+ "Received 202 from " + uc.getURL().toString() + " . Please try again in 5 seconds.");
+ }
// Maybe throw an exception instead?
return null;
}
diff --git a/src/main/java/org/kohsuke/github/example/dataobject/ReadOnlyObjects.java b/src/main/java/org/kohsuke/github/example/dataobject/ReadOnlyObjects.java
index aaec14d1b5..c9e96613bd 100644
--- a/src/main/java/org/kohsuke/github/example/dataobject/ReadOnlyObjects.java
+++ b/src/main/java/org/kohsuke/github/example/dataobject/ReadOnlyObjects.java
@@ -4,11 +4,12 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
-import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import javax.annotation.Nonnull;
+
/**
* {@link org.kohsuke.github.GHMeta} wraps the list of GitHub's IP addresses.
*
@@ -547,4 +548,4 @@ public List getImporter() {
return importer;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/kohsuke/github/extras/OkHttpConnector.java b/src/main/java/org/kohsuke/github/extras/OkHttpConnector.java
index 43c2da4c19..9c54c71cb7 100644
--- a/src/main/java/org/kohsuke/github/extras/OkHttpConnector.java
+++ b/src/main/java/org/kohsuke/github/extras/OkHttpConnector.java
@@ -4,17 +4,13 @@
import com.squareup.okhttp.ConnectionSpec;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.OkUrlFactory;
-
import org.kohsuke.github.HttpConnector;
import java.io.IOException;
-
import java.net.HttpURLConnection;
import java.net.URL;
-
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
-
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
diff --git a/src/main/java/org/kohsuke/github/extras/okhttp3/ObsoleteUrlFactory.java b/src/main/java/org/kohsuke/github/extras/okhttp3/ObsoleteUrlFactory.java
index 3c453ed119..ba38334d0c 100644
--- a/src/main/java/org/kohsuke/github/extras/okhttp3/ObsoleteUrlFactory.java
+++ b/src/main/java/org/kohsuke/github/extras/okhttp3/ObsoleteUrlFactory.java
@@ -1,5 +1,25 @@
package org.kohsuke.github.extras.okhttp3;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import okhttp3.Call;
+import okhttp3.Callback;
+import okhttp3.Dispatcher;
+import okhttp3.Handshake;
+import okhttp3.Headers;
+import okhttp3.HttpUrl;
+import okhttp3.Interceptor;
+import okhttp3.MediaType;
+import okhttp3.OkHttpClient;
+import okhttp3.Protocol;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+import okio.Buffer;
+import okio.BufferedSink;
+import okio.Okio;
+import okio.Pipe;
+import okio.Timeout;
+
/*
* Copyright (C) 2014 Square, Inc.
*
@@ -15,7 +35,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
@@ -40,31 +59,12 @@
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
+
import javax.annotation.Nullable;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLSocketFactory;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import okhttp3.Call;
-import okhttp3.Callback;
-import okhttp3.Dispatcher;
-import okhttp3.Handshake;
-import okhttp3.Headers;
-import okhttp3.HttpUrl;
-import okhttp3.Interceptor;
-import okhttp3.MediaType;
-import okhttp3.OkHttpClient;
-import okhttp3.Protocol;
-import okhttp3.Request;
-import okhttp3.RequestBody;
-import okhttp3.Response;
-import okio.Buffer;
-import okio.BufferedSink;
-import okio.Okio;
-import okio.Pipe;
-import okio.Timeout;
-
import static java.net.HttpURLConnection.HTTP_NOT_MODIFIED;
import static java.net.HttpURLConnection.HTTP_NO_CONTENT;
@@ -1366,4 +1366,4 @@ static final class UnexpectedException extends IOException {
super(cause);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/kohsuke/github/extras/okhttp3/OkHttpConnector.java b/src/main/java/org/kohsuke/github/extras/okhttp3/OkHttpConnector.java
index d9bd2b0273..ebfc09ad6e 100644
--- a/src/main/java/org/kohsuke/github/extras/okhttp3/OkHttpConnector.java
+++ b/src/main/java/org/kohsuke/github/extras/okhttp3/OkHttpConnector.java
@@ -3,13 +3,11 @@
import com.squareup.okhttp.CacheControl;
import okhttp3.ConnectionSpec;
import okhttp3.OkHttpClient;
-
import org.kohsuke.github.HttpConnector;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
-
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -81,4 +79,4 @@ public HttpURLConnection connect(URL url) throws IOException {
private List TlsConnectionSpecs() {
return Arrays.asList(ConnectionSpec.MODERN_TLS, ConnectionSpec.CLEARTEXT);
}
-}
\ No newline at end of file
+}
diff --git a/src/test/java/org/kohsuke/github/AbstractGitHubApiTestBase.java b/src/test/java/org/kohsuke/github/AbstractGitHubApiTestBase.java
index 797362e500..ff5d5955ae 100644
--- a/src/test/java/org/kohsuke/github/AbstractGitHubApiTestBase.java
+++ b/src/test/java/org/kohsuke/github/AbstractGitHubApiTestBase.java
@@ -1,17 +1,8 @@
package org.kohsuke.github;
-import java.io.FileInputStream;
-import java.util.Properties;
-
-import org.apache.commons.io.IOUtils;
-import org.junit.Assert;
-import org.junit.Assume;
import org.junit.Before;
import org.kohsuke.randname.RandomNameGenerator;
-import java.io.File;
-import java.io.IOException;
-
import static org.junit.Assume.assumeTrue;
/**
diff --git a/src/test/java/org/kohsuke/github/AppTest.java b/src/test/java/org/kohsuke/github/AppTest.java
index 64edd87280..fd223bb287 100755
--- a/src/test/java/org/kohsuke/github/AppTest.java
+++ b/src/test/java/org/kohsuke/github/AppTest.java
@@ -2,8 +2,6 @@
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-
import org.apache.commons.io.IOUtils;
import org.junit.Ignore;
import org.junit.Test;
diff --git a/src/test/java/org/kohsuke/github/GHBranchProtectionTest.java b/src/test/java/org/kohsuke/github/GHBranchProtectionTest.java
index ee6c62695e..7f15ea61c9 100644
--- a/src/test/java/org/kohsuke/github/GHBranchProtectionTest.java
+++ b/src/test/java/org/kohsuke/github/GHBranchProtectionTest.java
@@ -6,10 +6,8 @@
import org.kohsuke.github.GHBranchProtection.RequiredReviews;
import org.kohsuke.github.GHBranchProtection.RequiredStatusChecks;
-import java.io.FileNotFoundException;
-
-public class GHBranchProtectionTest extends AbstractGitHubApiTestBase {
- private static final String BRANCH = "bp-test";
+public class GHBranchProtectionTest extends AbstractGitHubWireMockTest {
+ private static final String BRANCH = "master";
private static final String BRANCH_REF = "heads/" + BRANCH;
private GHBranch branch;
@@ -17,32 +15,9 @@ public class GHBranchProtectionTest extends AbstractGitHubApiTestBase {
private GHRepository repo;
@Before
- @Override
public void setUp() throws Exception {
- super.setUp();
-
- repo = gitHub.getRepository("github-api-test-org/GHContentIntegrationTest").fork();
-
- try {
- repo.getRef(BRANCH_REF);
- } catch (FileNotFoundException e) {
- repo.createRef("refs/" + BRANCH_REF, repo.getBranch("master").getSHA1());
- }
-
- branch = repo.getBranch(BRANCH);
-
- if (branch.isProtected()) {
- GHBranchProtection protection = branch.getProtection();
- if (protection.getRequiredSignatures()) {
- protection.disableSignedCommits();
- }
-
- assertFalse(protection.getRequiredSignatures());
- branch.disableProtection();
- }
-
+ repo = getTempRepository();
branch = repo.getBranch(BRANCH);
- assertFalse(branch.isProtected());
}
@Test
diff --git a/src/test/java/org/kohsuke/github/GHContentIntegrationTest.java b/src/test/java/org/kohsuke/github/GHContentIntegrationTest.java
index 9b3d9334f6..4b4b591353 100644
--- a/src/test/java/org/kohsuke/github/GHContentIntegrationTest.java
+++ b/src/test/java/org/kohsuke/github/GHContentIntegrationTest.java
@@ -1,6 +1,5 @@
package org.kohsuke.github;
-import org.apache.commons.io.IOUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/src/test/java/org/kohsuke/github/GHDeploymentTest.java b/src/test/java/org/kohsuke/github/GHDeploymentTest.java
index 1c228c7aad..b2dc602b15 100644
--- a/src/test/java/org/kohsuke/github/GHDeploymentTest.java
+++ b/src/test/java/org/kohsuke/github/GHDeploymentTest.java
@@ -3,6 +3,7 @@
import org.junit.Test;
import java.io.IOException;
+
import static org.junit.Assert.assertNotNull;
/**
diff --git a/src/test/java/org/kohsuke/github/GistTest.java b/src/test/java/org/kohsuke/github/GHGistTest.java
similarity index 94%
rename from src/test/java/org/kohsuke/github/GistTest.java
rename to src/test/java/org/kohsuke/github/GHGistTest.java
index ed11bc5284..beae248f27 100644
--- a/src/test/java/org/kohsuke/github/GistTest.java
+++ b/src/test/java/org/kohsuke/github/GHGistTest.java
@@ -1,17 +1,15 @@
package org.kohsuke.github;
-import com.github.tomakehurst.wiremock.stubbing.Scenario;
import org.junit.Test;
import static com.github.tomakehurst.wiremock.client.WireMock.*;
import static org.hamcrest.Matchers.notNullValue;
-
import static org.hamcrest.core.Is.is;
/**
* @author Kohsuke Kawaguchi
*/
-public class GistTest extends AbstractGitHubWireMockTest {
+public class GHGistTest extends AbstractGitHubWireMockTest {
@Test
public void lifecycleTest() throws Exception {
// CRUD operation
diff --git a/src/test/java/org/kohsuke/github/GHHookTest.java b/src/test/java/org/kohsuke/github/GHHookTest.java
index 087560ef8b..d527097821 100644
--- a/src/test/java/org/kohsuke/github/GHHookTest.java
+++ b/src/test/java/org/kohsuke/github/GHHookTest.java
@@ -13,7 +13,6 @@
import static java.util.Collections.singletonMap;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.hasKey;
-import static org.hamcrest.Matchers.hasValue;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
import static org.junit.Assert.assertThat;
diff --git a/src/test/java/org/kohsuke/github/GHIssueEventTest.java b/src/test/java/org/kohsuke/github/GHIssueEventTest.java
index 82417e3219..e65f7d59c5 100644
--- a/src/test/java/org/kohsuke/github/GHIssueEventTest.java
+++ b/src/test/java/org/kohsuke/github/GHIssueEventTest.java
@@ -1,8 +1,9 @@
package org.kohsuke.github;
+import org.junit.Test;
+
import java.io.IOException;
import java.util.List;
-import org.junit.Test;
/**
* @author Martin van Zijl
diff --git a/src/test/java/org/kohsuke/github/GHOrganizationTest.java b/src/test/java/org/kohsuke/github/GHOrganizationTest.java
index 808d3b91be..11d5adb663 100644
--- a/src/test/java/org/kohsuke/github/GHOrganizationTest.java
+++ b/src/test/java/org/kohsuke/github/GHOrganizationTest.java
@@ -1,6 +1,5 @@
package org.kohsuke.github;
-import com.jcraft.jsch.IO;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
diff --git a/src/test/java/org/kohsuke/github/GHRateLimitTest.java b/src/test/java/org/kohsuke/github/GHRateLimitTest.java
index bf7e49f1a3..2aa9e78bf5 100644
--- a/src/test/java/org/kohsuke/github/GHRateLimitTest.java
+++ b/src/test/java/org/kohsuke/github/GHRateLimitTest.java
@@ -2,16 +2,10 @@
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
import com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;
-import com.github.tomakehurst.wiremock.matching.RequestPatternBuilder;
-import okhttp3.Cache;
-import okhttp3.OkHttpClient;
-import org.apache.commons.io.FileUtils;
import org.hamcrest.CoreMatchers;
-import org.junit.Before;
import org.junit.Test;
import org.kohsuke.github.extras.okhttp3.OkHttpConnector;
-import java.io.File;
import java.io.IOException;
import java.util.Date;
diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java
index 9eb62c8d8e..6bfc2fd1b7 100644
--- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java
+++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java
@@ -1,7 +1,6 @@
package org.kohsuke.github;
import org.apache.commons.io.IOUtils;
-import org.junit.Ignore;
import org.junit.Test;
import java.io.FileNotFoundException;
@@ -12,7 +11,6 @@
import static org.hamcrest.Matchers.*;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
import static org.junit.Assert.*;
-import static org.junit.Assume.assumeFalse;
/**
* @author Liam Newman
@@ -329,4 +327,4 @@ public void testSetTopics() throws Exception {
repo.setTopics(topics);
assertTrue("Topics can be set to empty", repo.listTopics().isEmpty());
}
-}
\ No newline at end of file
+}
diff --git a/src/test/java/org/kohsuke/github/GHTeamTest.java b/src/test/java/org/kohsuke/github/GHTeamTest.java
index 8fbe267abb..742d89a3b7 100644
--- a/src/test/java/org/kohsuke/github/GHTeamTest.java
+++ b/src/test/java/org/kohsuke/github/GHTeamTest.java
@@ -3,7 +3,6 @@
import org.junit.Test;
import java.io.IOException;
-import java.util.Random;
public class GHTeamTest extends AbstractGitHubWireMockTest {
diff --git a/src/test/java/org/kohsuke/github/GitHubStaticTest.java b/src/test/java/org/kohsuke/github/GitHubStaticTest.java
index 83bed2f043..8066dd9f1a 100644
--- a/src/test/java/org/kohsuke/github/GitHubStaticTest.java
+++ b/src/test/java/org/kohsuke/github/GitHubStaticTest.java
@@ -1,7 +1,5 @@
package org.kohsuke.github;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import org.eclipse.jgit.api.Git;
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/kohsuke/github/GitHubTest.java b/src/test/java/org/kohsuke/github/GitHubTest.java
index f89d1faa5c..6b4d3b7a02 100644
--- a/src/test/java/org/kohsuke/github/GitHubTest.java
+++ b/src/test/java/org/kohsuke/github/GitHubTest.java
@@ -1,12 +1,12 @@
package org.kohsuke.github;
-import java.io.IOException;
-import java.util.*;
-
import com.google.common.collect.Iterables;
import org.junit.Test;
import org.kohsuke.github.example.dataobject.ReadOnlyObjects;
+import java.io.IOException;
+import java.util.*;
+
import static org.hamcrest.CoreMatchers.*;
/**
diff --git a/src/test/java/org/kohsuke/github/Github2faTest.java b/src/test/java/org/kohsuke/github/Github2faTest.java
index 7681a50680..fb3c9cb6bf 100644
--- a/src/test/java/org/kohsuke/github/Github2faTest.java
+++ b/src/test/java/org/kohsuke/github/Github2faTest.java
@@ -1,11 +1,11 @@
package org.kohsuke.github;
+import org.junit.Test;
+
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
-import org.junit.Test;
-
/**
* @author Kevin Harrington mad.hephaestus@gmail.com
*/
diff --git a/src/test/java/org/kohsuke/github/PayloadRule.java b/src/test/java/org/kohsuke/github/PayloadRule.java
index 665186a361..063441ccc2 100644
--- a/src/test/java/org/kohsuke/github/PayloadRule.java
+++ b/src/test/java/org/kohsuke/github/PayloadRule.java
@@ -1,5 +1,10 @@
package org.kohsuke.github;
+import org.apache.commons.io.IOUtils;
+import org.junit.rules.TestRule;
+import org.junit.runner.Description;
+import org.junit.runners.model.Statement;
+
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
@@ -7,11 +12,6 @@
import java.io.Reader;
import java.nio.charset.Charset;
-import org.apache.commons.io.IOUtils;
-import org.junit.rules.TestRule;
-import org.junit.runner.Description;
-import org.junit.runners.model.Statement;
-
/**
* @author Stephen Connolly
*/
diff --git a/src/test/java/org/kohsuke/github/WireMockStatusReporterTest.java b/src/test/java/org/kohsuke/github/WireMockStatusReporterTest.java
index ca69393c24..843becc145 100644
--- a/src/test/java/org/kohsuke/github/WireMockStatusReporterTest.java
+++ b/src/test/java/org/kohsuke/github/WireMockStatusReporterTest.java
@@ -1,6 +1,5 @@
package org.kohsuke.github;
-import org.kohsuke.github.junit.WireMockRule;
import org.hamcrest.Matchers;
import org.junit.Ignore;
import org.junit.Test;
diff --git a/src/test/java/org/kohsuke/github/extras/OkHttpConnectorTest.java b/src/test/java/org/kohsuke/github/extras/OkHttpConnectorTest.java
index c9bdda95ec..00f85bdfd2 100644
--- a/src/test/java/org/kohsuke/github/extras/OkHttpConnectorTest.java
+++ b/src/test/java/org/kohsuke/github/extras/OkHttpConnectorTest.java
@@ -2,10 +2,9 @@
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
import com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;
-import com.github.tomakehurst.wiremock.matching.RequestPatternBuilder;
-import com.squareup.okhttp.OkUrlFactory;
import com.squareup.okhttp.Cache;
import com.squareup.okhttp.OkHttpClient;
+import com.squareup.okhttp.OkUrlFactory;
import org.apache.commons.io.FileUtils;
import org.junit.Before;
import org.junit.Ignore;
diff --git a/src/test/java/org/kohsuke/github/junit/GitHubWireMockRule.java b/src/test/java/org/kohsuke/github/junit/GitHubWireMockRule.java
index 66f1c04e7b..e53f6e4331 100644
--- a/src/test/java/org/kohsuke/github/junit/GitHubWireMockRule.java
+++ b/src/test/java/org/kohsuke/github/junit/GitHubWireMockRule.java
@@ -1,10 +1,8 @@
package org.kohsuke.github.junit;
import com.github.tomakehurst.wiremock.WireMockServer;
-import com.github.tomakehurst.wiremock.client.VerificationException;
import com.github.tomakehurst.wiremock.client.WireMock;
import com.github.tomakehurst.wiremock.common.FileSource;
-import com.github.tomakehurst.wiremock.core.Options;
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
import com.github.tomakehurst.wiremock.extension.Parameters;
import com.github.tomakehurst.wiremock.extension.ResponseTransformer;
@@ -12,11 +10,6 @@
import com.github.tomakehurst.wiremock.matching.RequestPatternBuilder;
import com.github.tomakehurst.wiremock.verification.*;
import com.google.gson.*;
-import org.junit.rules.MethodRule;
-import org.junit.rules.TestRule;
-import org.junit.runner.Description;
-import org.junit.runners.model.FrameworkMethod;
-import org.junit.runners.model.Statement;
import java.io.File;
import java.io.IOException;
@@ -24,7 +17,6 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collection;
-import java.util.List;
import java.util.Map;
import static com.github.tomakehurst.wiremock.client.WireMock.*;
diff --git a/src/test/java/org/kohsuke/github/junit/WireMockRule.java b/src/test/java/org/kohsuke/github/junit/WireMockRule.java
index 2f5dc3c3f8..4ddc9d00ba 100644
--- a/src/test/java/org/kohsuke/github/junit/WireMockRule.java
+++ b/src/test/java/org/kohsuke/github/junit/WireMockRule.java
@@ -7,14 +7,9 @@
import com.github.tomakehurst.wiremock.client.WireMock;
import com.github.tomakehurst.wiremock.common.*;
import com.github.tomakehurst.wiremock.core.*;
-import com.github.tomakehurst.wiremock.extension.Extension;
import com.github.tomakehurst.wiremock.global.GlobalSettings;
import com.github.tomakehurst.wiremock.global.GlobalSettingsHolder;
-import com.github.tomakehurst.wiremock.http.CaseInsensitiveKey;
-import com.github.tomakehurst.wiremock.http.HttpServerFactory;
import com.github.tomakehurst.wiremock.http.RequestListener;
-import com.github.tomakehurst.wiremock.http.ThreadPoolFactory;
-import com.github.tomakehurst.wiremock.http.trafficlistener.WiremockNetworkTrafficListener;
import com.github.tomakehurst.wiremock.junit.Stubbing;
import com.github.tomakehurst.wiremock.matching.RequestPattern;
import com.github.tomakehurst.wiremock.matching.RequestPatternBuilder;
@@ -23,27 +18,20 @@
import com.github.tomakehurst.wiremock.recording.RecordSpecBuilder;
import com.github.tomakehurst.wiremock.recording.RecordingStatusResult;
import com.github.tomakehurst.wiremock.recording.SnapshotRecordResult;
-import com.github.tomakehurst.wiremock.security.Authenticator;
-import com.github.tomakehurst.wiremock.standalone.JsonFileMappingsSource;
import com.github.tomakehurst.wiremock.standalone.MappingsLoader;
-import com.github.tomakehurst.wiremock.standalone.MappingsSource;
import com.github.tomakehurst.wiremock.stubbing.ServeEvent;
import com.github.tomakehurst.wiremock.stubbing.StubImport;
import com.github.tomakehurst.wiremock.stubbing.StubMapping;
import com.github.tomakehurst.wiremock.verification.*;
-
-import java.io.File;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import com.github.tomakehurst.wiremock.verification.notmatched.NotMatchedRenderer;
import org.junit.rules.MethodRule;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.Statement;
-import wiremock.com.google.common.base.Optional;
+
+import java.io.File;
+import java.util.List;
+import java.util.UUID;
/**
* @author Liam Newman
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/__files/repos_github-api-test-org_temp-testenablebranchprotections-02ee4913-4f10-4403-9f86-c911719d8b88.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/__files/repos_github-api-test-org_temp-testenablebranchprotections-02ee4913-4f10-4403-9f86-c911719d8b88.json
new file mode 100644
index 0000000000..c9f0d6061d
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/__files/repos_github-api-test-org_temp-testenablebranchprotections-02ee4913-4f10-4403-9f86-c911719d8b88.json
@@ -0,0 +1,124 @@
+{
+ "id": 222596043,
+ "node_id": "MDEwOlJlcG9zaXRvcnkyMjI1OTYwNDM=",
+ "name": "temp-testEnableBranchProtections",
+ "full_name": "github-api-test-org/temp-testEnableBranchProtections",
+ "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-testEnableBranchProtections",
+ "description": "A test repository for testing the github-api project: temp-testEnableBranchProtections",
+ "fork": false,
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections",
+ "forks_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/forks",
+ "keys_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/keys{/key_id}",
+ "collaborators_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/collaborators{/collaborator}",
+ "teams_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/teams",
+ "hooks_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/hooks",
+ "issue_events_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/issues/events{/number}",
+ "events_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/events",
+ "assignees_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/assignees{/user}",
+ "branches_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/branches{/branch}",
+ "tags_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/tags",
+ "blobs_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/git/blobs{/sha}",
+ "git_tags_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/git/tags{/sha}",
+ "git_refs_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/git/refs{/sha}",
+ "trees_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/git/trees{/sha}",
+ "statuses_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/statuses/{sha}",
+ "languages_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/languages",
+ "stargazers_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/stargazers",
+ "contributors_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/contributors",
+ "subscribers_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/subscribers",
+ "subscription_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/subscription",
+ "commits_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/commits{/sha}",
+ "git_commits_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/git/commits{/sha}",
+ "comments_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/comments{/number}",
+ "issue_comment_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/issues/comments{/number}",
+ "contents_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/contents/{+path}",
+ "compare_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/compare/{base}...{head}",
+ "merges_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/merges",
+ "archive_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/{archive_format}{/ref}",
+ "downloads_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/downloads",
+ "issues_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/issues{/number}",
+ "pulls_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/pulls{/number}",
+ "milestones_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/milestones{/number}",
+ "notifications_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/notifications{?since,all,participating}",
+ "labels_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/labels{/name}",
+ "releases_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/releases{/id}",
+ "deployments_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/deployments",
+ "created_at": "2019-11-19T03:01:26Z",
+ "updated_at": "2019-11-19T03:01:31Z",
+ "pushed_at": "2019-11-19T03:01:27Z",
+ "git_url": "git://github.com/github-api-test-org/temp-testEnableBranchProtections.git",
+ "ssh_url": "git@github.com:github-api-test-org/temp-testEnableBranchProtections.git",
+ "clone_url": "https://github.com/github-api-test-org/temp-testEnableBranchProtections.git",
+ "svn_url": "https://github.com/github-api-test-org/temp-testEnableBranchProtections",
+ "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
+ },
+ "allow_squash_merge": true,
+ "allow_merge_commit": true,
+ "allow_rebase_merge": true,
+ "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": 4
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/__files/repos_github-api-test-org_temp-testenablebranchprotections_branches_master-040c1d69-d6af-4a94-b583-7d18957bad10.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/__files/repos_github-api-test-org_temp-testenablebranchprotections_branches_master-040c1d69-d6af-4a94-b583-7d18957bad10.json
new file mode 100644
index 0000000000..6f6492ef01
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/__files/repos_github-api-test-org_temp-testenablebranchprotections_branches_master-040c1d69-d6af-4a94-b583-7d18957bad10.json
@@ -0,0 +1,89 @@
+{
+ "name": "master",
+ "commit": {
+ "sha": "298ffff9c7928b06e9b74d01ae8a34ab98e9b4c2",
+ "node_id": "MDY6Q29tbWl0MjIyNTk2MDQzOjI5OGZmZmY5Yzc5MjhiMDZlOWI3NGQwMWFlOGEzNGFiOThlOWI0YzI=",
+ "commit": {
+ "author": {
+ "name": "Liam Newman",
+ "email": "bitwiseman@gmail.com",
+ "date": "2019-11-19T03:01:27Z"
+ },
+ "committer": {
+ "name": "GitHub",
+ "email": "noreply@github.com",
+ "date": "2019-11-19T03:01:27Z"
+ },
+ "message": "Initial commit",
+ "tree": {
+ "sha": "3858cfba073ecd82947ddca0dc3613584db75e4c",
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/git/trees/3858cfba073ecd82947ddca0dc3613584db75e4c"
+ },
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/git/commits/298ffff9c7928b06e9b74d01ae8a34ab98e9b4c2",
+ "comment_count": 0,
+ "verification": {
+ "verified": true,
+ "reason": "valid",
+ "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBcBAABCAAQBQJd01sHCRBK7hj4Ov3rIwAAdHIIABgp0lFAcHc2m3RCcuCUqfMl\nzfgjjYNYsqyWgwWeB0c44naL8nqhF/a80KlY4+1T2gVR8GOSZNyC8ewDH/6V+X3q\n5MzjTNJBk2ks5oA4bz2fgdsE7fm8kKDZQRqL9+BN4JF9MNps4M2+nR5Rg4sBm2+A\nSZHcdfzZ6ll0ptcTGl7403Xe9irj/V6iymycUapbK4+RHBotrN6kbBGZtjILempU\nMbYrIuqteQF3B2p9FSXFCJ8SpAL/Cq/GkpGvEbYIPdQ2IFQ6ImiRSf6eNTvSXxtG\nLJygBJsaRCH81FEhBfUnbP+stB9x4dloj/yhPLd6BXv1VCuzT2h9roYtaemjb7c=\n=ycC3\n-----END PGP SIGNATURE-----\n",
+ "payload": "tree 3858cfba073ecd82947ddca0dc3613584db75e4c\nauthor Liam Newman 1574132487 -0800\ncommitter GitHub 1574132487 -0800\n\nInitial commit"
+ }
+ },
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/commits/298ffff9c7928b06e9b74d01ae8a34ab98e9b4c2",
+ "html_url": "https://github.com/github-api-test-org/temp-testEnableBranchProtections/commit/298ffff9c7928b06e9b74d01ae8a34ab98e9b4c2",
+ "comments_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/commits/298ffff9c7928b06e9b74d01ae8a34ab98e9b4c2/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-testEnableBranchProtections/branches/master",
+ "html": "https://github.com/github-api-test-org/temp-testEnableBranchProtections/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-testEnableBranchProtections/branches/master/protection"
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/__files/repos_github-api-test-org_temp-testenablebranchprotections_branches_master_protection-aa97cf7b-7c9d-4c01-b7c5-bccc62b30873.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/__files/repos_github-api-test-org_temp-testenablebranchprotections_branches_master_protection-aa97cf7b-7c9d-4c01-b7c5-bccc62b30873.json
new file mode 100644
index 0000000000..36fb6cf9bd
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/__files/repos_github-api-test-org_temp-testenablebranchprotections_branches_master_protection-aa97cf7b-7c9d-4c01-b7c5-bccc62b30873.json
@@ -0,0 +1,21 @@
+{
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/branches/master/protection",
+ "required_status_checks": {
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/branches/master/protection/required_status_checks",
+ "strict": true,
+ "contexts": [
+ "test-status-check"
+ ],
+ "contexts_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/branches/master/protection/required_status_checks/contexts"
+ },
+ "required_pull_request_reviews": {
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/branches/master/protection/required_pull_request_reviews",
+ "dismiss_stale_reviews": true,
+ "require_code_owner_reviews": true,
+ "required_approving_review_count": 2
+ },
+ "enforce_admins": {
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableBranchProtections/branches/master/protection/enforce_admins",
+ "enabled": true
+ }
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/__files/user-c38b2b92-6669-42ee-838f-7422bb4f300d.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/__files/user-c38b2b92-6669-42ee-838f-7422bb4f300d.json
new file mode 100644
index 0000000000..6f84c075f5
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/__files/user-c38b2b92-6669-42ee-838f-7422bb4f300d.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": 176,
+ "public_gists": 7,
+ "followers": 140,
+ "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/GHBranchProtectionTest/wiremock/testEnableBranchProtections/mappings/repos_github-api-test-org_temp-testenablebranchprotections-2-02ee49.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/mappings/repos_github-api-test-org_temp-testenablebranchprotections-2-02ee49.json
new file mode 100644
index 0000000000..834aa92e8e
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/mappings/repos_github-api-test-org_temp-testenablebranchprotections-2-02ee49.json
@@ -0,0 +1,43 @@
+{
+ "id": "02ee4913-4f10-4403-9f86-c911719d8b88",
+ "name": "repos_github-api-test-org_temp-testenablebranchprotections",
+ "request": {
+ "url": "/repos/github-api-test-org/temp-testEnableBranchProtections",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "repos_github-api-test-org_temp-testenablebranchprotections-02ee4913-4f10-4403-9f86-c911719d8b88.json",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:32 GMT",
+ "Content-Type": "application/json; charset=utf-8",
+ "Server": "GitHub.com",
+ "Status": "200 OK",
+ "X-RateLimit-Limit": "5000",
+ "X-RateLimit-Remaining": "4937",
+ "X-RateLimit-Reset": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"85ef7d73fa0d8de7e964cdc69d1648a0\"",
+ "Last-Modified": "Tue, 19 Nov 2019 03:01:31 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",
+ "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": "C495:6994:5EFFF:6F6AF:5DD35B05"
+ }
+ },
+ "uuid": "02ee4913-4f10-4403-9f86-c911719d8b88",
+ "persistent": true,
+ "insertionIndex": 2
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/mappings/repos_github-api-test-org_temp-testenablebranchprotections_branches_master-3-040c1d.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/mappings/repos_github-api-test-org_temp-testenablebranchprotections_branches_master-3-040c1d.json
new file mode 100644
index 0000000000..0e79036a26
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/mappings/repos_github-api-test-org_temp-testenablebranchprotections_branches_master-3-040c1d.json
@@ -0,0 +1,42 @@
+{
+ "id": "040c1d69-d6af-4a94-b583-7d18957bad10",
+ "name": "repos_github-api-test-org_temp-testenablebranchprotections_branches_master",
+ "request": {
+ "url": "/repos/github-api-test-org/temp-testEnableBranchProtections/branches/master",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "repos_github-api-test-org_temp-testenablebranchprotections_branches_master-040c1d69-d6af-4a94-b583-7d18957bad10.json",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:32 GMT",
+ "Content-Type": "application/json; charset=utf-8",
+ "Server": "GitHub.com",
+ "Status": "200 OK",
+ "X-RateLimit-Limit": "5000",
+ "X-RateLimit-Remaining": "4936",
+ "X-RateLimit-Reset": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"b4b2b52ee5173543cc0d41dfff61781c\"",
+ "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",
+ "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": "C495:6994:5F01F:6FB32:5DD35B0C"
+ }
+ },
+ "uuid": "040c1d69-d6af-4a94-b583-7d18957bad10",
+ "persistent": true,
+ "insertionIndex": 3
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/mappings/repos_github-api-test-org_temp-testenablebranchprotections_branches_master_protection-4-aa97cf.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/mappings/repos_github-api-test-org_temp-testenablebranchprotections_branches_master_protection-4-aa97cf.json
new file mode 100644
index 0000000000..090479e8d6
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/mappings/repos_github-api-test-org_temp-testenablebranchprotections_branches_master_protection-4-aa97cf.json
@@ -0,0 +1,49 @@
+{
+ "id": "aa97cf7b-7c9d-4c01-b7c5-bccc62b30873",
+ "name": "repos_github-api-test-org_temp-testenablebranchprotections_branches_master_protection",
+ "request": {
+ "url": "/repos/github-api-test-org/temp-testEnableBranchProtections/branches/master/protection",
+ "method": "PUT",
+ "bodyPatterns": [
+ {
+ "equalToJson": "{\"required_pull_request_reviews\":{\"required_approving_review_count\":2,\"require_code_owner_reviews\":true,\"dismiss_stale_reviews\":true},\"required_status_checks\":{\"contexts\":[\"test-status-check\"],\"strict\":true},\"restrictions\":null,\"enforce_admins\":true}",
+ "ignoreArrayOrder": true,
+ "ignoreExtraElements": true
+ }
+ ]
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "repos_github-api-test-org_temp-testenablebranchprotections_branches_master_protection-aa97cf7b-7c9d-4c01-b7c5-bccc62b30873.json",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:32 GMT",
+ "Content-Type": "application/json; charset=utf-8",
+ "Server": "GitHub.com",
+ "Status": "200 OK",
+ "X-RateLimit-Limit": "5000",
+ "X-RateLimit-Remaining": "4935",
+ "X-RateLimit-Reset": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"51724a4f269fbb64510394b0e2b948b3\"",
+ "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",
+ "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": "C495:6994:5F041:6FB54:5DD35B0C"
+ }
+ },
+ "uuid": "aa97cf7b-7c9d-4c01-b7c5-bccc62b30873",
+ "persistent": true,
+ "insertionIndex": 4
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/mappings/user-1-c38b2b.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/mappings/user-1-c38b2b.json
new file mode 100644
index 0000000000..1c3c09fb22
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableBranchProtections/mappings/user-1-c38b2b.json
@@ -0,0 +1,43 @@
+{
+ "id": "c38b2b92-6669-42ee-838f-7422bb4f300d",
+ "name": "user",
+ "request": {
+ "url": "/user",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "user-c38b2b92-6669-42ee-838f-7422bb4f300d.json",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:25 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": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"a7d3d02f0490e723eacdd27e24979424\"",
+ "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",
+ "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": "C495:6994:5EC24:6F69A:5DD35B04"
+ }
+ },
+ "uuid": "c38b2b92-6669-42ee-838f-7422bb4f300d",
+ "persistent": true,
+ "insertionIndex": 1
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/__files/repos_github-api-test-org_temp-testenableprotectiononly-bc30994e-6cf0-42fa-b6e8-7c21803346f0.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/__files/repos_github-api-test-org_temp-testenableprotectiononly-bc30994e-6cf0-42fa-b6e8-7c21803346f0.json
new file mode 100644
index 0000000000..a253c10ac1
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/__files/repos_github-api-test-org_temp-testenableprotectiononly-bc30994e-6cf0-42fa-b6e8-7c21803346f0.json
@@ -0,0 +1,124 @@
+{
+ "id": 222596090,
+ "node_id": "MDEwOlJlcG9zaXRvcnkyMjI1OTYwOTA=",
+ "name": "temp-testEnableProtectionOnly",
+ "full_name": "github-api-test-org/temp-testEnableProtectionOnly",
+ "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-testEnableProtectionOnly",
+ "description": "A test repository for testing the github-api project: temp-testEnableProtectionOnly",
+ "fork": false,
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly",
+ "forks_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/forks",
+ "keys_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/keys{/key_id}",
+ "collaborators_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/collaborators{/collaborator}",
+ "teams_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/teams",
+ "hooks_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/hooks",
+ "issue_events_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/issues/events{/number}",
+ "events_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/events",
+ "assignees_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/assignees{/user}",
+ "branches_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/branches{/branch}",
+ "tags_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/tags",
+ "blobs_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/git/blobs{/sha}",
+ "git_tags_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/git/tags{/sha}",
+ "git_refs_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/git/refs{/sha}",
+ "trees_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/git/trees{/sha}",
+ "statuses_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/statuses/{sha}",
+ "languages_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/languages",
+ "stargazers_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/stargazers",
+ "contributors_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/contributors",
+ "subscribers_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/subscribers",
+ "subscription_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/subscription",
+ "commits_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/commits{/sha}",
+ "git_commits_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/git/commits{/sha}",
+ "comments_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/comments{/number}",
+ "issue_comment_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/issues/comments{/number}",
+ "contents_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/contents/{+path}",
+ "compare_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/compare/{base}...{head}",
+ "merges_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/merges",
+ "archive_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/{archive_format}{/ref}",
+ "downloads_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/downloads",
+ "issues_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/issues{/number}",
+ "pulls_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/pulls{/number}",
+ "milestones_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/milestones{/number}",
+ "notifications_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/notifications{?since,all,participating}",
+ "labels_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/labels{/name}",
+ "releases_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/releases{/id}",
+ "deployments_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/deployments",
+ "created_at": "2019-11-19T03:01:43Z",
+ "updated_at": "2019-11-19T03:01:49Z",
+ "pushed_at": "2019-11-19T03:01:45Z",
+ "git_url": "git://github.com/github-api-test-org/temp-testEnableProtectionOnly.git",
+ "ssh_url": "git@github.com:github-api-test-org/temp-testEnableProtectionOnly.git",
+ "clone_url": "https://github.com/github-api-test-org/temp-testEnableProtectionOnly.git",
+ "svn_url": "https://github.com/github-api-test-org/temp-testEnableProtectionOnly",
+ "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
+ },
+ "allow_squash_merge": true,
+ "allow_merge_commit": true,
+ "allow_rebase_merge": true,
+ "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": 4
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/__files/repos_github-api-test-org_temp-testenableprotectiononly_branches_master-88328244-0928-4737-b1a5-674c59027a58.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/__files/repos_github-api-test-org_temp-testenableprotectiononly_branches_master-88328244-0928-4737-b1a5-674c59027a58.json
new file mode 100644
index 0000000000..d1efd113fc
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/__files/repos_github-api-test-org_temp-testenableprotectiononly_branches_master-88328244-0928-4737-b1a5-674c59027a58.json
@@ -0,0 +1,89 @@
+{
+ "name": "master",
+ "commit": {
+ "sha": "b9a9b314add8ca449fc2de050518c0fad721a60c",
+ "node_id": "MDY6Q29tbWl0MjIyNTk2MDkwOmI5YTliMzE0YWRkOGNhNDQ5ZmMyZGUwNTA1MThjMGZhZDcyMWE2MGM=",
+ "commit": {
+ "author": {
+ "name": "Liam Newman",
+ "email": "bitwiseman@gmail.com",
+ "date": "2019-11-19T03:01:44Z"
+ },
+ "committer": {
+ "name": "GitHub",
+ "email": "noreply@github.com",
+ "date": "2019-11-19T03:01:44Z"
+ },
+ "message": "Initial commit",
+ "tree": {
+ "sha": "c9119b8fcff0b781ab9fd8faf418c42c08593560",
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/git/trees/c9119b8fcff0b781ab9fd8faf418c42c08593560"
+ },
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/git/commits/b9a9b314add8ca449fc2de050518c0fad721a60c",
+ "comment_count": 0,
+ "verification": {
+ "verified": true,
+ "reason": "valid",
+ "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBcBAABCAAQBQJd01sYCRBK7hj4Ov3rIwAAdHIIAILysEwjSJK+Ks9FXnOnzhPY\nM1KpvTeWF1B7HfuExazu185ER/0pvyI6A9WArZaCYoit1tTLFVkUiT0Elnoi+6Wi\nOEbdFmKoIaOf6htKq6GREtT6aCGyLoW9k3kfYuJdRpn5Wu2lgI085pJZc08XsLmj\nTjlK1NvxGKqHJ2tn2wzxfz3AizJhpMn2JEIx8yEHkXBCQLNq9D6f8MyAQRuv6TVd\nVfKgyJGhB6ndz8D+7vXxxDYFw5PAqcOsm8IBHnNTxzwZoNxZ0cTXWPkgZqyRbny1\nN/qRQ3ERkOP0z4hJimXkVYUAgVRUwIVMVwc8TvlluVLZrCYCHRcGKbhD+uH66QM=\n=Cu8z\n-----END PGP SIGNATURE-----\n",
+ "payload": "tree c9119b8fcff0b781ab9fd8faf418c42c08593560\nauthor Liam Newman 1574132504 -0800\ncommitter GitHub 1574132504 -0800\n\nInitial commit"
+ }
+ },
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/commits/b9a9b314add8ca449fc2de050518c0fad721a60c",
+ "html_url": "https://github.com/github-api-test-org/temp-testEnableProtectionOnly/commit/b9a9b314add8ca449fc2de050518c0fad721a60c",
+ "comments_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/commits/b9a9b314add8ca449fc2de050518c0fad721a60c/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-testEnableProtectionOnly/branches/master",
+ "html": "https://github.com/github-api-test-org/temp-testEnableProtectionOnly/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-testEnableProtectionOnly/branches/master/protection"
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/__files/repos_github-api-test-org_temp-testenableprotectiononly_branches_master-90ab1b21-6ee8-4607-bcf5-f14061c3936f.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/__files/repos_github-api-test-org_temp-testenableprotectiononly_branches_master-90ab1b21-6ee8-4607-bcf5-f14061c3936f.json
new file mode 100644
index 0000000000..be28272ae2
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/__files/repos_github-api-test-org_temp-testenableprotectiononly_branches_master-90ab1b21-6ee8-4607-bcf5-f14061c3936f.json
@@ -0,0 +1,89 @@
+{
+ "name": "master",
+ "commit": {
+ "sha": "b9a9b314add8ca449fc2de050518c0fad721a60c",
+ "node_id": "MDY6Q29tbWl0MjIyNTk2MDkwOmI5YTliMzE0YWRkOGNhNDQ5ZmMyZGUwNTA1MThjMGZhZDcyMWE2MGM=",
+ "commit": {
+ "author": {
+ "name": "Liam Newman",
+ "email": "bitwiseman@gmail.com",
+ "date": "2019-11-19T03:01:44Z"
+ },
+ "committer": {
+ "name": "GitHub",
+ "email": "noreply@github.com",
+ "date": "2019-11-19T03:01:44Z"
+ },
+ "message": "Initial commit",
+ "tree": {
+ "sha": "c9119b8fcff0b781ab9fd8faf418c42c08593560",
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/git/trees/c9119b8fcff0b781ab9fd8faf418c42c08593560"
+ },
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/git/commits/b9a9b314add8ca449fc2de050518c0fad721a60c",
+ "comment_count": 0,
+ "verification": {
+ "verified": true,
+ "reason": "valid",
+ "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBcBAABCAAQBQJd01sYCRBK7hj4Ov3rIwAAdHIIAILysEwjSJK+Ks9FXnOnzhPY\nM1KpvTeWF1B7HfuExazu185ER/0pvyI6A9WArZaCYoit1tTLFVkUiT0Elnoi+6Wi\nOEbdFmKoIaOf6htKq6GREtT6aCGyLoW9k3kfYuJdRpn5Wu2lgI085pJZc08XsLmj\nTjlK1NvxGKqHJ2tn2wzxfz3AizJhpMn2JEIx8yEHkXBCQLNq9D6f8MyAQRuv6TVd\nVfKgyJGhB6ndz8D+7vXxxDYFw5PAqcOsm8IBHnNTxzwZoNxZ0cTXWPkgZqyRbny1\nN/qRQ3ERkOP0z4hJimXkVYUAgVRUwIVMVwc8TvlluVLZrCYCHRcGKbhD+uH66QM=\n=Cu8z\n-----END PGP SIGNATURE-----\n",
+ "payload": "tree c9119b8fcff0b781ab9fd8faf418c42c08593560\nauthor Liam Newman 1574132504 -0800\ncommitter GitHub 1574132504 -0800\n\nInitial commit"
+ }
+ },
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/commits/b9a9b314add8ca449fc2de050518c0fad721a60c",
+ "html_url": "https://github.com/github-api-test-org/temp-testEnableProtectionOnly/commit/b9a9b314add8ca449fc2de050518c0fad721a60c",
+ "comments_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/commits/b9a9b314add8ca449fc2de050518c0fad721a60c/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-testEnableProtectionOnly/branches/master",
+ "html": "https://github.com/github-api-test-org/temp-testEnableProtectionOnly/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-testEnableProtectionOnly/branches/master/protection"
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/__files/repos_github-api-test-org_temp-testenableprotectiononly_branches_master_protection-857c661d-4431-4504-9088-c0bbf3a8d667.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/__files/repos_github-api-test-org_temp-testenableprotectiononly_branches_master_protection-857c661d-4431-4504-9088-c0bbf3a8d667.json
new file mode 100644
index 0000000000..15ca7f2682
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/__files/repos_github-api-test-org_temp-testenableprotectiononly_branches_master_protection-857c661d-4431-4504-9088-c0bbf3a8d667.json
@@ -0,0 +1,7 @@
+{
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/branches/master/protection",
+ "enforce_admins": {
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableProtectionOnly/branches/master/protection/enforce_admins",
+ "enabled": false
+ }
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/__files/user-100e4407-70e6-4ea4-aad4-70d93d35dd38.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/__files/user-100e4407-70e6-4ea4-aad4-70d93d35dd38.json
new file mode 100644
index 0000000000..6f84c075f5
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/__files/user-100e4407-70e6-4ea4-aad4-70d93d35dd38.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": 176,
+ "public_gists": 7,
+ "followers": 140,
+ "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/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/mappings/repos_github-api-test-org_temp-testenableprotectiononly-2-bc3099.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/mappings/repos_github-api-test-org_temp-testenableprotectiononly-2-bc3099.json
new file mode 100644
index 0000000000..ac0603dffa
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/mappings/repos_github-api-test-org_temp-testenableprotectiononly-2-bc3099.json
@@ -0,0 +1,43 @@
+{
+ "id": "bc30994e-6cf0-42fa-b6e8-7c21803346f0",
+ "name": "repos_github-api-test-org_temp-testenableprotectiononly",
+ "request": {
+ "url": "/repos/github-api-test-org/temp-testEnableProtectionOnly",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "repos_github-api-test-org_temp-testenableprotectiononly-bc30994e-6cf0-42fa-b6e8-7c21803346f0.json",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:49 GMT",
+ "Content-Type": "application/json; charset=utf-8",
+ "Server": "GitHub.com",
+ "Status": "200 OK",
+ "X-RateLimit-Limit": "5000",
+ "X-RateLimit-Remaining": "4911",
+ "X-RateLimit-Reset": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"5a52275541e01dfed3bd8a7c449f6b0f\"",
+ "Last-Modified": "Tue, 19 Nov 2019 03:01:49 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",
+ "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": "C4A6:4FEE:63367:740CA:5DD35B16"
+ }
+ },
+ "uuid": "bc30994e-6cf0-42fa-b6e8-7c21803346f0",
+ "persistent": true,
+ "insertionIndex": 2
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/mappings/repos_github-api-test-org_temp-testenableprotectiononly_branches_master-3-883282.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/mappings/repos_github-api-test-org_temp-testenableprotectiononly_branches_master-3-883282.json
new file mode 100644
index 0000000000..54e19738d9
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/mappings/repos_github-api-test-org_temp-testenableprotectiononly_branches_master-3-883282.json
@@ -0,0 +1,45 @@
+{
+ "id": "88328244-0928-4737-b1a5-674c59027a58",
+ "name": "repos_github-api-test-org_temp-testenableprotectiononly_branches_master",
+ "request": {
+ "url": "/repos/github-api-test-org/temp-testEnableProtectionOnly/branches/master",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "repos_github-api-test-org_temp-testenableprotectiononly_branches_master-88328244-0928-4737-b1a5-674c59027a58.json",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:50 GMT",
+ "Content-Type": "application/json; charset=utf-8",
+ "Server": "GitHub.com",
+ "Status": "200 OK",
+ "X-RateLimit-Limit": "5000",
+ "X-RateLimit-Remaining": "4910",
+ "X-RateLimit-Reset": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"e50899adde0516ef560b178cfb58c9f4\"",
+ "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",
+ "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": "C4A6:4FEE:6338F:74499:5DD35B1D"
+ }
+ },
+ "uuid": "88328244-0928-4737-b1a5-674c59027a58",
+ "persistent": true,
+ "scenarioName": "scenario-1-repos-github-api-test-org-temp-testEnableProtectionOnly-branches-master",
+ "requiredScenarioState": "Started",
+ "newScenarioState": "scenario-1-repos-github-api-test-org-temp-testEnableProtectionOnly-branches-master-2",
+ "insertionIndex": 3
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/mappings/repos_github-api-test-org_temp-testenableprotectiononly_branches_master-5-90ab1b.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/mappings/repos_github-api-test-org_temp-testenableprotectiononly_branches_master-5-90ab1b.json
new file mode 100644
index 0000000000..7e410f2def
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/mappings/repos_github-api-test-org_temp-testenableprotectiononly_branches_master-5-90ab1b.json
@@ -0,0 +1,44 @@
+{
+ "id": "90ab1b21-6ee8-4607-bcf5-f14061c3936f",
+ "name": "repos_github-api-test-org_temp-testenableprotectiononly_branches_master",
+ "request": {
+ "url": "/repos/github-api-test-org/temp-testEnableProtectionOnly/branches/master",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "repos_github-api-test-org_temp-testenableprotectiononly_branches_master-90ab1b21-6ee8-4607-bcf5-f14061c3936f.json",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:50 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": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"6e892f7878965d871f858924a9515a9a\"",
+ "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",
+ "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": "C4A6:4FEE:633CF:744E4:5DD35B1E"
+ }
+ },
+ "uuid": "90ab1b21-6ee8-4607-bcf5-f14061c3936f",
+ "persistent": true,
+ "scenarioName": "scenario-1-repos-github-api-test-org-temp-testEnableProtectionOnly-branches-master",
+ "requiredScenarioState": "scenario-1-repos-github-api-test-org-temp-testEnableProtectionOnly-branches-master-2",
+ "insertionIndex": 5
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/mappings/repos_github-api-test-org_temp-testenableprotectiononly_branches_master_protection-4-857c66.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/mappings/repos_github-api-test-org_temp-testenableprotectiononly_branches_master_protection-4-857c66.json
new file mode 100644
index 0000000000..30591e0826
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/mappings/repos_github-api-test-org_temp-testenableprotectiononly_branches_master_protection-4-857c66.json
@@ -0,0 +1,49 @@
+{
+ "id": "857c661d-4431-4504-9088-c0bbf3a8d667",
+ "name": "repos_github-api-test-org_temp-testenableprotectiononly_branches_master_protection",
+ "request": {
+ "url": "/repos/github-api-test-org/temp-testEnableProtectionOnly/branches/master/protection",
+ "method": "PUT",
+ "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-testenableprotectiononly_branches_master_protection-857c661d-4431-4504-9088-c0bbf3a8d667.json",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:50 GMT",
+ "Content-Type": "application/json; charset=utf-8",
+ "Server": "GitHub.com",
+ "Status": "200 OK",
+ "X-RateLimit-Limit": "5000",
+ "X-RateLimit-Remaining": "4909",
+ "X-RateLimit-Reset": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"48347246916d88cb97b0bff8a430e78c\"",
+ "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",
+ "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": "C4A6:4FEE:633A5:744B7:5DD35B1E"
+ }
+ },
+ "uuid": "857c661d-4431-4504-9088-c0bbf3a8d667",
+ "persistent": true,
+ "insertionIndex": 4
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/mappings/user-1-100e44.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/mappings/user-1-100e44.json
new file mode 100644
index 0000000000..49eec8a122
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableProtectionOnly/mappings/user-1-100e44.json
@@ -0,0 +1,43 @@
+{
+ "id": "100e4407-70e6-4ea4-aad4-70d93d35dd38",
+ "name": "user",
+ "request": {
+ "url": "/user",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "user-100e4407-70e6-4ea4-aad4-70d93d35dd38.json",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:42 GMT",
+ "Content-Type": "application/json; charset=utf-8",
+ "Server": "GitHub.com",
+ "Status": "200 OK",
+ "X-RateLimit-Limit": "5000",
+ "X-RateLimit-Remaining": "4919",
+ "X-RateLimit-Reset": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"a7d3d02f0490e723eacdd27e24979424\"",
+ "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",
+ "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": "C4A6:4FEE:63031:740B3:5DD35B16"
+ }
+ },
+ "uuid": "100e4407-70e6-4ea4-aad4-70d93d35dd38",
+ "persistent": true,
+ "insertionIndex": 1
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/__files/repos_github-api-test-org_temp-testenablerequirereviewsonly-318e0aa4-9fc4-4f30-8174-400001f1bae4.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/__files/repos_github-api-test-org_temp-testenablerequirereviewsonly-318e0aa4-9fc4-4f30-8174-400001f1bae4.json
new file mode 100644
index 0000000000..4d24749b25
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/__files/repos_github-api-test-org_temp-testenablerequirereviewsonly-318e0aa4-9fc4-4f30-8174-400001f1bae4.json
@@ -0,0 +1,124 @@
+{
+ "id": 222596057,
+ "node_id": "MDEwOlJlcG9zaXRvcnkyMjI1OTYwNTc=",
+ "name": "temp-testEnableRequireReviewsOnly",
+ "full_name": "github-api-test-org/temp-testEnableRequireReviewsOnly",
+ "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-testEnableRequireReviewsOnly",
+ "description": "A test repository for testing the github-api project: temp-testEnableRequireReviewsOnly",
+ "fork": false,
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly",
+ "forks_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/forks",
+ "keys_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/keys{/key_id}",
+ "collaborators_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/collaborators{/collaborator}",
+ "teams_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/teams",
+ "hooks_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/hooks",
+ "issue_events_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/issues/events{/number}",
+ "events_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/events",
+ "assignees_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/assignees{/user}",
+ "branches_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/branches{/branch}",
+ "tags_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/tags",
+ "blobs_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/git/blobs{/sha}",
+ "git_tags_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/git/tags{/sha}",
+ "git_refs_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/git/refs{/sha}",
+ "trees_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/git/trees{/sha}",
+ "statuses_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/statuses/{sha}",
+ "languages_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/languages",
+ "stargazers_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/stargazers",
+ "contributors_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/contributors",
+ "subscribers_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/subscribers",
+ "subscription_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/subscription",
+ "commits_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/commits{/sha}",
+ "git_commits_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/git/commits{/sha}",
+ "comments_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/comments{/number}",
+ "issue_comment_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/issues/comments{/number}",
+ "contents_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/contents/{+path}",
+ "compare_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/compare/{base}...{head}",
+ "merges_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/merges",
+ "archive_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/{archive_format}{/ref}",
+ "downloads_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/downloads",
+ "issues_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/issues{/number}",
+ "pulls_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/pulls{/number}",
+ "milestones_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/milestones{/number}",
+ "notifications_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/notifications{?since,all,participating}",
+ "labels_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/labels{/name}",
+ "releases_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/releases{/id}",
+ "deployments_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/deployments",
+ "created_at": "2019-11-19T03:01:34Z",
+ "updated_at": "2019-11-19T03:01:40Z",
+ "pushed_at": "2019-11-19T03:01:36Z",
+ "git_url": "git://github.com/github-api-test-org/temp-testEnableRequireReviewsOnly.git",
+ "ssh_url": "git@github.com:github-api-test-org/temp-testEnableRequireReviewsOnly.git",
+ "clone_url": "https://github.com/github-api-test-org/temp-testEnableRequireReviewsOnly.git",
+ "svn_url": "https://github.com/github-api-test-org/temp-testEnableRequireReviewsOnly",
+ "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
+ },
+ "allow_squash_merge": true,
+ "allow_merge_commit": true,
+ "allow_rebase_merge": true,
+ "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": 4
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/__files/repos_github-api-test-org_temp-testenablerequirereviewsonly_branches_master-0e0c4c56-198f-4d87-b13e-b146cad7ffdb.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/__files/repos_github-api-test-org_temp-testenablerequirereviewsonly_branches_master-0e0c4c56-198f-4d87-b13e-b146cad7ffdb.json
new file mode 100644
index 0000000000..e22e3f01c4
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/__files/repos_github-api-test-org_temp-testenablerequirereviewsonly_branches_master-0e0c4c56-198f-4d87-b13e-b146cad7ffdb.json
@@ -0,0 +1,89 @@
+{
+ "name": "master",
+ "commit": {
+ "sha": "d32e320555f9d47f78e64fc3889e567d5eebee8e",
+ "node_id": "MDY6Q29tbWl0MjIyNTk2MDU3OmQzMmUzMjA1NTVmOWQ0N2Y3OGU2NGZjMzg4OWU1NjdkNWVlYmVlOGU=",
+ "commit": {
+ "author": {
+ "name": "Liam Newman",
+ "email": "bitwiseman@gmail.com",
+ "date": "2019-11-19T03:01:35Z"
+ },
+ "committer": {
+ "name": "GitHub",
+ "email": "noreply@github.com",
+ "date": "2019-11-19T03:01:35Z"
+ },
+ "message": "Initial commit",
+ "tree": {
+ "sha": "32d1abb4db4e0b5f067f13f8ec544e62126ef47a",
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/git/trees/32d1abb4db4e0b5f067f13f8ec544e62126ef47a"
+ },
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/git/commits/d32e320555f9d47f78e64fc3889e567d5eebee8e",
+ "comment_count": 0,
+ "verification": {
+ "verified": true,
+ "reason": "valid",
+ "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBcBAABCAAQBQJd01sPCRBK7hj4Ov3rIwAAdHIIADGTF2CM1Q6wUw3RB/sKFvl2\npKkcGV3+0W4+Clnx1k1b60TbjD8hnq+ZtkWxvo3QmUplUapunHoj4zrUkqmzwOVg\nKrCwsvBzSJoRxbKN5j04wCTwB9oUSCEPxs9UxolqCOumwa+GzLv2t4EjGeDEf09S\n18C9Dg9+eiIMaXbO+HXOkltj4V9BTI8+IWA/0EMHVBqeh8daWcbyhQcaHBdkNgR6\nDq9UKMz0Ny2S6/A2v+y8YBj6ftXs+q5/fAPSu6hI4SMAVz26nl1SvkJmR8N79PQ9\nbiybCEzd5is507e8ufr7ElJ/1bfV2z0c0wkXfV6nNX+xYSKP+IfOLAfUljeoCZM=\n=RhfP\n-----END PGP SIGNATURE-----\n",
+ "payload": "tree 32d1abb4db4e0b5f067f13f8ec544e62126ef47a\nauthor Liam Newman 1574132495 -0800\ncommitter GitHub 1574132495 -0800\n\nInitial commit"
+ }
+ },
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/commits/d32e320555f9d47f78e64fc3889e567d5eebee8e",
+ "html_url": "https://github.com/github-api-test-org/temp-testEnableRequireReviewsOnly/commit/d32e320555f9d47f78e64fc3889e567d5eebee8e",
+ "comments_url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/commits/d32e320555f9d47f78e64fc3889e567d5eebee8e/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-testEnableRequireReviewsOnly/branches/master",
+ "html": "https://github.com/github-api-test-org/temp-testEnableRequireReviewsOnly/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-testEnableRequireReviewsOnly/branches/master/protection"
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/__files/repos_github-api-test-org_temp-testenablerequirereviewsonly_branches_master_protection-b57fab91-f2a6-4d52-b6d4-05e4a8be5df4.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/__files/repos_github-api-test-org_temp-testenablerequirereviewsonly_branches_master_protection-b57fab91-f2a6-4d52-b6d4-05e4a8be5df4.json
new file mode 100644
index 0000000000..1113b5739d
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/__files/repos_github-api-test-org_temp-testenablerequirereviewsonly_branches_master_protection-b57fab91-f2a6-4d52-b6d4-05e4a8be5df4.json
@@ -0,0 +1,13 @@
+{
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/branches/master/protection",
+ "required_pull_request_reviews": {
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/branches/master/protection/required_pull_request_reviews",
+ "dismiss_stale_reviews": false,
+ "require_code_owner_reviews": false,
+ "required_approving_review_count": 1
+ },
+ "enforce_admins": {
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/branches/master/protection/enforce_admins",
+ "enabled": false
+ }
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/__files/user-64a67881-ce5e-4dd2-9d28-af9f67a4d9d1.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/__files/user-64a67881-ce5e-4dd2-9d28-af9f67a4d9d1.json
new file mode 100644
index 0000000000..6f84c075f5
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/__files/user-64a67881-ce5e-4dd2-9d28-af9f67a4d9d1.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": 176,
+ "public_gists": 7,
+ "followers": 140,
+ "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/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/mappings/repos_github-api-test-org_temp-testenablerequirereviewsonly-2-318e0a.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/mappings/repos_github-api-test-org_temp-testenablerequirereviewsonly-2-318e0a.json
new file mode 100644
index 0000000000..51d26c8131
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/mappings/repos_github-api-test-org_temp-testenablerequirereviewsonly-2-318e0a.json
@@ -0,0 +1,43 @@
+{
+ "id": "318e0aa4-9fc4-4f30-8174-400001f1bae4",
+ "name": "repos_github-api-test-org_temp-testenablerequirereviewsonly",
+ "request": {
+ "url": "/repos/github-api-test-org/temp-testEnableRequireReviewsOnly",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "repos_github-api-test-org_temp-testenablerequirereviewsonly-318e0aa4-9fc4-4f30-8174-400001f1bae4.json",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:41 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": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"2b8d8ba2c42054c376d47a34ded30f4b\"",
+ "Last-Modified": "Tue, 19 Nov 2019 03:01:40 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",
+ "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": "C49E:6D70:39A9D:4459F:5DD35B0D"
+ }
+ },
+ "uuid": "318e0aa4-9fc4-4f30-8174-400001f1bae4",
+ "persistent": true,
+ "insertionIndex": 2
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/mappings/repos_github-api-test-org_temp-testenablerequirereviewsonly_branches_master-3-0e0c4c.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/mappings/repos_github-api-test-org_temp-testenablerequirereviewsonly_branches_master-3-0e0c4c.json
new file mode 100644
index 0000000000..a44e412beb
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/mappings/repos_github-api-test-org_temp-testenablerequirereviewsonly_branches_master-3-0e0c4c.json
@@ -0,0 +1,42 @@
+{
+ "id": "0e0c4c56-198f-4d87-b13e-b146cad7ffdb",
+ "name": "repos_github-api-test-org_temp-testenablerequirereviewsonly_branches_master",
+ "request": {
+ "url": "/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/branches/master",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "repos_github-api-test-org_temp-testenablerequirereviewsonly_branches_master-0e0c4c56-198f-4d87-b13e-b146cad7ffdb.json",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:41 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": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"51ae00091b56c866a8b2b00d1a3e57ec\"",
+ "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",
+ "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": "C49E:6D70:39AA6:447F2:5DD35B15"
+ }
+ },
+ "uuid": "0e0c4c56-198f-4d87-b13e-b146cad7ffdb",
+ "persistent": true,
+ "insertionIndex": 3
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/mappings/repos_github-api-test-org_temp-testenablerequirereviewsonly_branches_master_protection-4-b57fab.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/mappings/repos_github-api-test-org_temp-testenablerequirereviewsonly_branches_master_protection-4-b57fab.json
new file mode 100644
index 0000000000..d4b63f5d20
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/mappings/repos_github-api-test-org_temp-testenablerequirereviewsonly_branches_master_protection-4-b57fab.json
@@ -0,0 +1,49 @@
+{
+ "id": "b57fab91-f2a6-4d52-b6d4-05e4a8be5df4",
+ "name": "repos_github-api-test-org_temp-testenablerequirereviewsonly_branches_master_protection",
+ "request": {
+ "url": "/repos/github-api-test-org/temp-testEnableRequireReviewsOnly/branches/master/protection",
+ "method": "PUT",
+ "bodyPatterns": [
+ {
+ "equalToJson": "{\"required_pull_request_reviews\":{},\"required_status_checks\":null,\"restrictions\":null,\"enforce_admins\":false}",
+ "ignoreArrayOrder": true,
+ "ignoreExtraElements": true
+ }
+ ]
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "repos_github-api-test-org_temp-testenablerequirereviewsonly_branches_master_protection-b57fab91-f2a6-4d52-b6d4-05e4a8be5df4.json",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:41 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": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"b2d6921837e9e4b720085673dae0aa59\"",
+ "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",
+ "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": "C49E:6D70:39AC3:44807:5DD35B15"
+ }
+ },
+ "uuid": "b57fab91-f2a6-4d52-b6d4-05e4a8be5df4",
+ "persistent": true,
+ "insertionIndex": 4
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/mappings/user-1-64a678.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/mappings/user-1-64a678.json
new file mode 100644
index 0000000000..b872603f56
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testEnableRequireReviewsOnly/mappings/user-1-64a678.json
@@ -0,0 +1,43 @@
+{
+ "id": "64a67881-ce5e-4dd2-9d28-af9f67a4d9d1",
+ "name": "user",
+ "request": {
+ "url": "/user",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "user-64a67881-ce5e-4dd2-9d28-af9f67a4d9d1.json",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:33 GMT",
+ "Content-Type": "application/json; charset=utf-8",
+ "Server": "GitHub.com",
+ "Status": "200 OK",
+ "X-RateLimit-Limit": "5000",
+ "X-RateLimit-Remaining": "4932",
+ "X-RateLimit-Reset": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"a7d3d02f0490e723eacdd27e24979424\"",
+ "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",
+ "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": "C49E:6D70:398BA:44594:5DD35B0D"
+ }
+ },
+ "uuid": "64a67881-ce5e-4dd2-9d28-af9f67a4d9d1",
+ "persistent": true,
+ "insertionIndex": 1
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/__files/repos_github-api-test-org_temp-testsignedcommits-126c7a91-25f8-4610-a015-12535c6f79bd.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/__files/repos_github-api-test-org_temp-testsignedcommits-126c7a91-25f8-4610-a015-12535c6f79bd.json
new file mode 100644
index 0000000000..9c334614f7
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/__files/repos_github-api-test-org_temp-testsignedcommits-126c7a91-25f8-4610-a015-12535c6f79bd.json
@@ -0,0 +1,124 @@
+{
+ "id": 222596117,
+ "node_id": "MDEwOlJlcG9zaXRvcnkyMjI1OTYxMTc=",
+ "name": "temp-testSignedCommits",
+ "full_name": "github-api-test-org/temp-testSignedCommits",
+ "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-testSignedCommits",
+ "description": "A test repository for testing the github-api project: temp-testSignedCommits",
+ "fork": false,
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits",
+ "forks_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/forks",
+ "keys_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/keys{/key_id}",
+ "collaborators_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/collaborators{/collaborator}",
+ "teams_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/teams",
+ "hooks_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/hooks",
+ "issue_events_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/issues/events{/number}",
+ "events_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/events",
+ "assignees_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/assignees{/user}",
+ "branches_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/branches{/branch}",
+ "tags_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/tags",
+ "blobs_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/git/blobs{/sha}",
+ "git_tags_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/git/tags{/sha}",
+ "git_refs_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/git/refs{/sha}",
+ "trees_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/git/trees{/sha}",
+ "statuses_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/statuses/{sha}",
+ "languages_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/languages",
+ "stargazers_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/stargazers",
+ "contributors_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/contributors",
+ "subscribers_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/subscribers",
+ "subscription_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/subscription",
+ "commits_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/commits{/sha}",
+ "git_commits_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/git/commits{/sha}",
+ "comments_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/comments{/number}",
+ "issue_comment_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/issues/comments{/number}",
+ "contents_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/contents/{+path}",
+ "compare_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/compare/{base}...{head}",
+ "merges_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/merges",
+ "archive_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/{archive_format}{/ref}",
+ "downloads_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/downloads",
+ "issues_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/issues{/number}",
+ "pulls_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/pulls{/number}",
+ "milestones_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/milestones{/number}",
+ "notifications_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/notifications{?since,all,participating}",
+ "labels_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/labels{/name}",
+ "releases_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/releases{/id}",
+ "deployments_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/deployments",
+ "created_at": "2019-11-19T03:01:51Z",
+ "updated_at": "2019-11-19T03:01:58Z",
+ "pushed_at": "2019-11-19T03:01:53Z",
+ "git_url": "git://github.com/github-api-test-org/temp-testSignedCommits.git",
+ "ssh_url": "git@github.com:github-api-test-org/temp-testSignedCommits.git",
+ "clone_url": "https://github.com/github-api-test-org/temp-testSignedCommits.git",
+ "svn_url": "https://github.com/github-api-test-org/temp-testSignedCommits",
+ "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
+ },
+ "allow_squash_merge": true,
+ "allow_merge_commit": true,
+ "allow_rebase_merge": true,
+ "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": 4
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/__files/repos_github-api-test-org_temp-testsignedcommits_branches_master-7a0577f3-c41c-4cbe-9965-f6f53aea602d.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/__files/repos_github-api-test-org_temp-testsignedcommits_branches_master-7a0577f3-c41c-4cbe-9965-f6f53aea602d.json
new file mode 100644
index 0000000000..5fa5d2a202
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/__files/repos_github-api-test-org_temp-testsignedcommits_branches_master-7a0577f3-c41c-4cbe-9965-f6f53aea602d.json
@@ -0,0 +1,89 @@
+{
+ "name": "master",
+ "commit": {
+ "sha": "9ef208e9f31fee7de1f0d10728f914022791e127",
+ "node_id": "MDY6Q29tbWl0MjIyNTk2MTE3OjllZjIwOGU5ZjMxZmVlN2RlMWYwZDEwNzI4ZjkxNDAyMjc5MWUxMjc=",
+ "commit": {
+ "author": {
+ "name": "Liam Newman",
+ "email": "bitwiseman@gmail.com",
+ "date": "2019-11-19T03:01:53Z"
+ },
+ "committer": {
+ "name": "GitHub",
+ "email": "noreply@github.com",
+ "date": "2019-11-19T03:01:53Z"
+ },
+ "message": "Initial commit",
+ "tree": {
+ "sha": "5bc9e3c14a62b6c19ec7ea436245290591751fc4",
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/git/trees/5bc9e3c14a62b6c19ec7ea436245290591751fc4"
+ },
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/git/commits/9ef208e9f31fee7de1f0d10728f914022791e127",
+ "comment_count": 0,
+ "verification": {
+ "verified": true,
+ "reason": "valid",
+ "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBcBAABCAAQBQJd01shCRBK7hj4Ov3rIwAAdHIIADWylhXW45yghg2gvvoO7JjK\n/0+CpNsQyfSiLQ9hFkAFfWUstUr1DhknQGFWdKKyDEXtPDu0J/Ed/d5yb9ebiz1n\nvCTQcSK0VxNkVVtf1+wYNi8+9OOb+GfAt6pUtqbYzV2pAUdgqsSOO/g/1svGlGPq\nz8+aV17OuGnY+IIB3FA0LWYG4b+b9LmZQHjiWSOpyJvZ+i4JVyJGYokrb4BzhkUy\ng30rjoVw8+q9deJjUAs/p8X0X2VtG3K4BSiIXraF54qi1yoYrjJlMOsGfl1MA4iE\n/Omt7fiVdhfy85+BAPthu4+HssuHgVPbWKU17DF0CMy0HYYiPirY4uioNiXkkT8=\n=p6ni\n-----END PGP SIGNATURE-----\n",
+ "payload": "tree 5bc9e3c14a62b6c19ec7ea436245290591751fc4\nauthor Liam Newman 1574132513 -0800\ncommitter GitHub 1574132513 -0800\n\nInitial commit"
+ }
+ },
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/commits/9ef208e9f31fee7de1f0d10728f914022791e127",
+ "html_url": "https://github.com/github-api-test-org/temp-testSignedCommits/commit/9ef208e9f31fee7de1f0d10728f914022791e127",
+ "comments_url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/commits/9ef208e9f31fee7de1f0d10728f914022791e127/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-testSignedCommits/branches/master",
+ "html": "https://github.com/github-api-test-org/temp-testSignedCommits/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-testSignedCommits/branches/master/protection"
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/__files/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection-4b8a92a8-3dc5-40ba-96aa-f5fcd41eedd5.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/__files/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection-4b8a92a8-3dc5-40ba-96aa-f5fcd41eedd5.json
new file mode 100644
index 0000000000..0107dc1a09
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/__files/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection-4b8a92a8-3dc5-40ba-96aa-f5fcd41eedd5.json
@@ -0,0 +1,7 @@
+{
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/branches/master/protection",
+ "enforce_admins": {
+ "url": "https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/branches/master/protection/enforce_admins",
+ "enabled": false
+ }
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/__files/user-94ed9a81-5dda-4f29-8f0b-18eab8a75f14.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/__files/user-94ed9a81-5dda-4f29-8f0b-18eab8a75f14.json
new file mode 100644
index 0000000000..6f84c075f5
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/__files/user-94ed9a81-5dda-4f29-8f0b-18eab8a75f14.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": 176,
+ "public_gists": 7,
+ "followers": 140,
+ "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/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits-2-126c7a.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits-2-126c7a.json
new file mode 100644
index 0000000000..373f2754c1
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits-2-126c7a.json
@@ -0,0 +1,43 @@
+{
+ "id": "126c7a91-25f8-4610-a015-12535c6f79bd",
+ "name": "repos_github-api-test-org_temp-testsignedcommits",
+ "request": {
+ "url": "/repos/github-api-test-org/temp-testSignedCommits",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "repos_github-api-test-org_temp-testsignedcommits-126c7a91-25f8-4610-a015-12535c6f79bd.json",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:58 GMT",
+ "Content-Type": "application/json; charset=utf-8",
+ "Server": "GitHub.com",
+ "Status": "200 OK",
+ "X-RateLimit-Limit": "5000",
+ "X-RateLimit-Remaining": "4897",
+ "X-RateLimit-Reset": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"0f68d4fb4620d1d60575c184b481409e\"",
+ "Last-Modified": "Tue, 19 Nov 2019 03:01:58 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",
+ "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": "C4B1:6D6F:205F5:2518C:5DD35B1F"
+ }
+ },
+ "uuid": "126c7a91-25f8-4610-a015-12535c6f79bd",
+ "persistent": true,
+ "insertionIndex": 2
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master-3-7a0577.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master-3-7a0577.json
new file mode 100644
index 0000000000..90da917e2c
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master-3-7a0577.json
@@ -0,0 +1,42 @@
+{
+ "id": "7a0577f3-c41c-4cbe-9965-f6f53aea602d",
+ "name": "repos_github-api-test-org_temp-testsignedcommits_branches_master",
+ "request": {
+ "url": "/repos/github-api-test-org/temp-testSignedCommits/branches/master",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "repos_github-api-test-org_temp-testsignedcommits_branches_master-7a0577f3-c41c-4cbe-9965-f6f53aea602d.json",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:58 GMT",
+ "Content-Type": "application/json; charset=utf-8",
+ "Server": "GitHub.com",
+ "Status": "200 OK",
+ "X-RateLimit-Limit": "5000",
+ "X-RateLimit-Remaining": "4896",
+ "X-RateLimit-Reset": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"64cf89312c87f9689cb2a8583eeddda2\"",
+ "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",
+ "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": "C4B1:6D6F:20604:252C3:5DD35B26"
+ }
+ },
+ "uuid": "7a0577f3-c41c-4cbe-9965-f6f53aea602d",
+ "persistent": true,
+ "insertionIndex": 3
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection-4-4b8a92.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection-4-4b8a92.json
new file mode 100644
index 0000000000..621ea86f30
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection-4-4b8a92.json
@@ -0,0 +1,49 @@
+{
+ "id": "4b8a92a8-3dc5-40ba-96aa-f5fcd41eedd5",
+ "name": "repos_github-api-test-org_temp-testsignedcommits_branches_master_protection",
+ "request": {
+ "url": "/repos/github-api-test-org/temp-testSignedCommits/branches/master/protection",
+ "method": "PUT",
+ "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-testsignedcommits_branches_master_protection-4b8a92a8-3dc5-40ba-96aa-f5fcd41eedd5.json",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:58 GMT",
+ "Content-Type": "application/json; charset=utf-8",
+ "Server": "GitHub.com",
+ "Status": "200 OK",
+ "X-RateLimit-Limit": "5000",
+ "X-RateLimit-Remaining": "4895",
+ "X-RateLimit-Reset": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"da9d21f9528a07ca0c4ac56de0278d58\"",
+ "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",
+ "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": "C4B1:6D6F:2060C:252CE:5DD35B26"
+ }
+ },
+ "uuid": "4b8a92a8-3dc5-40ba-96aa-f5fcd41eedd5",
+ "persistent": true,
+ "insertionIndex": 4
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection_required_signatures-5-c0150d.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection_required_signatures-5-c0150d.json
new file mode 100644
index 0000000000..a82444ecdd
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection_required_signatures-5-c0150d.json
@@ -0,0 +1,45 @@
+{
+ "id": "c0150d3b-dbf8-4426-9a59-af31e3448299",
+ "name": "repos_github-api-test-org_temp-testsignedcommits_branches_master_protection_required_signatures",
+ "request": {
+ "url": "/repos/github-api-test-org/temp-testSignedCommits/branches/master/protection/required_signatures",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "body": "{\"url\":\"https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/branches/master/protection/required_signatures\",\"enabled\":false}",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:59 GMT",
+ "Content-Type": "application/json; charset=utf-8",
+ "Server": "GitHub.com",
+ "Status": "200 OK",
+ "X-RateLimit-Limit": "5000",
+ "X-RateLimit-Remaining": "4894",
+ "X-RateLimit-Reset": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"6381f33d367d1e194e371ef617d6d17f\"",
+ "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.zzzax-preview; format=json",
+ "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": "C4B1:6D6F:20620:252E1:5DD35B26"
+ }
+ },
+ "uuid": "c0150d3b-dbf8-4426-9a59-af31e3448299",
+ "persistent": true,
+ "scenarioName": "scenario-1-repos-github-api-test-org-temp-testSignedCommits-branches-master-protection-required_signatures",
+ "requiredScenarioState": "Started",
+ "newScenarioState": "scenario-1-repos-github-api-test-org-temp-testSignedCommits-branches-master-protection-required_signatures-2",
+ "insertionIndex": 5
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection_required_signatures-6-e29707.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection_required_signatures-6-e29707.json
new file mode 100644
index 0000000000..f2f9c59c84
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection_required_signatures-6-e29707.json
@@ -0,0 +1,49 @@
+{
+ "id": "e2970726-71d5-4880-bd8f-bb6ad1f578a8",
+ "name": "repos_github-api-test-org_temp-testsignedcommits_branches_master_protection_required_signatures",
+ "request": {
+ "url": "/repos/github-api-test-org/temp-testSignedCommits/branches/master/protection/required_signatures",
+ "method": "POST",
+ "bodyPatterns": [
+ {
+ "equalToJson": "{}",
+ "ignoreArrayOrder": true,
+ "ignoreExtraElements": true
+ }
+ ]
+ },
+ "response": {
+ "status": 200,
+ "body": "{\"url\":\"https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/branches/master/protection/required_signatures\",\"enabled\":true}",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:59 GMT",
+ "Content-Type": "application/json; charset=utf-8",
+ "Server": "GitHub.com",
+ "Status": "200 OK",
+ "X-RateLimit-Limit": "5000",
+ "X-RateLimit-Remaining": "4893",
+ "X-RateLimit-Reset": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"bca005912506b8129cdb5bb65d6b7c0a\"",
+ "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.zzzax-preview; format=json",
+ "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": "C4B1:6D6F:2062B:252EF:5DD35B27"
+ }
+ },
+ "uuid": "e2970726-71d5-4880-bd8f-bb6ad1f578a8",
+ "persistent": true,
+ "insertionIndex": 6
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection_required_signatures-7-fa5a0d.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection_required_signatures-7-fa5a0d.json
new file mode 100644
index 0000000000..cded0f0020
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection_required_signatures-7-fa5a0d.json
@@ -0,0 +1,45 @@
+{
+ "id": "fa5a0df8-3cdd-424a-a744-9b96a2455f68",
+ "name": "repos_github-api-test-org_temp-testsignedcommits_branches_master_protection_required_signatures",
+ "request": {
+ "url": "/repos/github-api-test-org/temp-testSignedCommits/branches/master/protection/required_signatures",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "body": "{\"url\":\"https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/branches/master/protection/required_signatures\",\"enabled\":true}",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:59 GMT",
+ "Content-Type": "application/json; charset=utf-8",
+ "Server": "GitHub.com",
+ "Status": "200 OK",
+ "X-RateLimit-Limit": "5000",
+ "X-RateLimit-Remaining": "4892",
+ "X-RateLimit-Reset": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"bca005912506b8129cdb5bb65d6b7c0a\"",
+ "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.zzzax-preview; format=json",
+ "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": "C4B1:6D6F:20644:25307:5DD35B27"
+ }
+ },
+ "uuid": "fa5a0df8-3cdd-424a-a744-9b96a2455f68",
+ "persistent": true,
+ "scenarioName": "scenario-1-repos-github-api-test-org-temp-testSignedCommits-branches-master-protection-required_signatures",
+ "requiredScenarioState": "scenario-1-repos-github-api-test-org-temp-testSignedCommits-branches-master-protection-required_signatures-2",
+ "newScenarioState": "scenario-1-repos-github-api-test-org-temp-testSignedCommits-branches-master-protection-required_signatures-3",
+ "insertionIndex": 7
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection_required_signatures-8-8c2a08.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection_required_signatures-8-8c2a08.json
new file mode 100644
index 0000000000..2a35de7a76
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection_required_signatures-8-8c2a08.json
@@ -0,0 +1,35 @@
+{
+ "id": "8c2a0866-3d67-4b80-a36a-a37714ca5af9",
+ "name": "repos_github-api-test-org_temp-testsignedcommits_branches_master_protection_required_signatures",
+ "request": {
+ "url": "/repos/github-api-test-org/temp-testSignedCommits/branches/master/protection/required_signatures",
+ "method": "DELETE"
+ },
+ "response": {
+ "status": 204,
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:59 GMT",
+ "Server": "GitHub.com",
+ "Status": "204 No Content",
+ "X-RateLimit-Limit": "5000",
+ "X-RateLimit-Remaining": "4891",
+ "X-RateLimit-Reset": "1574135997",
+ "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.zzzax-preview; format=json",
+ "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'",
+ "Vary": "Accept-Encoding",
+ "X-GitHub-Request-Id": "C4B1:6D6F:20655:25325:5DD35B27"
+ }
+ },
+ "uuid": "8c2a0866-3d67-4b80-a36a-a37714ca5af9",
+ "persistent": true,
+ "insertionIndex": 8
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection_required_signatures-9-c0efc3.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection_required_signatures-9-c0efc3.json
new file mode 100644
index 0000000000..7f93da8175
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/repos_github-api-test-org_temp-testsignedcommits_branches_master_protection_required_signatures-9-c0efc3.json
@@ -0,0 +1,44 @@
+{
+ "id": "c0efc3bb-2eaf-4225-a416-dc9f9371d508",
+ "name": "repos_github-api-test-org_temp-testsignedcommits_branches_master_protection_required_signatures",
+ "request": {
+ "url": "/repos/github-api-test-org/temp-testSignedCommits/branches/master/protection/required_signatures",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "body": "{\"url\":\"https://api.github.com/repos/github-api-test-org/temp-testSignedCommits/branches/master/protection/required_signatures\",\"enabled\":false}",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:02:00 GMT",
+ "Content-Type": "application/json; charset=utf-8",
+ "Server": "GitHub.com",
+ "Status": "200 OK",
+ "X-RateLimit-Limit": "5000",
+ "X-RateLimit-Remaining": "4890",
+ "X-RateLimit-Reset": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"6381f33d367d1e194e371ef617d6d17f\"",
+ "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.zzzax-preview; format=json",
+ "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": "C4B1:6D6F:20668:25337:5DD35B27"
+ }
+ },
+ "uuid": "c0efc3bb-2eaf-4225-a416-dc9f9371d508",
+ "persistent": true,
+ "scenarioName": "scenario-1-repos-github-api-test-org-temp-testSignedCommits-branches-master-protection-required_signatures",
+ "requiredScenarioState": "scenario-1-repos-github-api-test-org-temp-testSignedCommits-branches-master-protection-required_signatures-3",
+ "insertionIndex": 9
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/user-1-94ed9a.json b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/user-1-94ed9a.json
new file mode 100644
index 0000000000..9dae95e727
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHBranchProtectionTest/wiremock/testSignedCommits/mappings/user-1-94ed9a.json
@@ -0,0 +1,43 @@
+{
+ "id": "94ed9a81-5dda-4f29-8f0b-18eab8a75f14",
+ "name": "user",
+ "request": {
+ "url": "/user",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "user-94ed9a81-5dda-4f29-8f0b-18eab8a75f14.json",
+ "headers": {
+ "Date": "Tue, 19 Nov 2019 03:01:51 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": "1574135997",
+ "Cache-Control": "private, max-age=60, s-maxage=60",
+ "Vary": [
+ "Accept, Authorization, Cookie, X-GitHub-OTP",
+ "Accept-Encoding"
+ ],
+ "ETag": "W/\"a7d3d02f0490e723eacdd27e24979424\"",
+ "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",
+ "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": "C4B1:6D6F:204F4:25187:5DD35B1F"
+ }
+ },
+ "uuid": "94ed9a81-5dda-4f29-8f0b-18eab8a75f14",
+ "persistent": true,
+ "insertionIndex": 1
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/gistFile/__files/gists_9903708-c3067d66-2bb0-4af7-b7d4-98032571c5d0.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/gistFile/__files/gists_9903708-c3067d66-2bb0-4af7-b7d4-98032571c5d0.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/gistFile/__files/gists_9903708-c3067d66-2bb0-4af7-b7d4-98032571c5d0.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/gistFile/__files/gists_9903708-c3067d66-2bb0-4af7-b7d4-98032571c5d0.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/gistFile/__files/user-9226d6ed-a52d-4b08-9402-f1cfc2dbf0e1.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/gistFile/__files/user-9226d6ed-a52d-4b08-9402-f1cfc2dbf0e1.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/gistFile/__files/user-9226d6ed-a52d-4b08-9402-f1cfc2dbf0e1.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/gistFile/__files/user-9226d6ed-a52d-4b08-9402-f1cfc2dbf0e1.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/gistFile/mappings/gists_9903708-2-c3067d.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/gistFile/mappings/gists_9903708-2-c3067d.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/gistFile/mappings/gists_9903708-2-c3067d.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/gistFile/mappings/gists_9903708-2-c3067d.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/gistFile/mappings/user-1-9226d6.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/gistFile/mappings/user-1-9226d6.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/gistFile/mappings/user-1-9226d6.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/gistFile/mappings/user-1-9226d6.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/lifecycleTest/__files/gists-2f93eec6-32ad-4c3d-a7bf-33a134d16dbe.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/lifecycleTest/__files/gists-2f93eec6-32ad-4c3d-a7bf-33a134d16dbe.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/lifecycleTest/__files/gists-2f93eec6-32ad-4c3d-a7bf-33a134d16dbe.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/lifecycleTest/__files/gists-2f93eec6-32ad-4c3d-a7bf-33a134d16dbe.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/lifecycleTest/__files/user-3380f859-169e-41b0-9a8a-aa66277dfb8b.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/lifecycleTest/__files/user-3380f859-169e-41b0-9a8a-aa66277dfb8b.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/lifecycleTest/__files/user-3380f859-169e-41b0-9a8a-aa66277dfb8b.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/lifecycleTest/__files/user-3380f859-169e-41b0-9a8a-aa66277dfb8b.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/lifecycleTest/mappings/gists-2-2f93ee.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/lifecycleTest/mappings/gists-2-2f93ee.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/lifecycleTest/mappings/gists-2-2f93ee.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/lifecycleTest/mappings/gists-2-2f93ee.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/lifecycleTest/mappings/gists_9faa55cd67b21a789bb44e34e5e41f72-3-26c314.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/lifecycleTest/mappings/gists_9faa55cd67b21a789bb44e34e5e41f72-3-26c314.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/lifecycleTest/mappings/gists_9faa55cd67b21a789bb44e34e5e41f72-3-26c314.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/lifecycleTest/mappings/gists_9faa55cd67b21a789bb44e34e5e41f72-3-26c314.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/lifecycleTest/mappings/user-1-3380f8.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/lifecycleTest/mappings/user-1-3380f8.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/lifecycleTest/mappings/user-1-3380f8.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/lifecycleTest/mappings/user-1-3380f8.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/__files/gists_9903708-ab2c9d06-edf6-4875-b402-7c99a529b19a.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/__files/gists_9903708-ab2c9d06-edf6-4875-b402-7c99a529b19a.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/__files/gists_9903708-ab2c9d06-edf6-4875-b402-7c99a529b19a.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/__files/gists_9903708-ab2c9d06-edf6-4875-b402-7c99a529b19a.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/__files/gists_9903708_forks-42d6e404-71e3-42cc-b415-f42dfab9d45e.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/__files/gists_9903708_forks-42d6e404-71e3-42cc-b415-f42dfab9d45e.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/__files/gists_9903708_forks-42d6e404-71e3-42cc-b415-f42dfab9d45e.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/__files/gists_9903708_forks-42d6e404-71e3-42cc-b415-f42dfab9d45e.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/__files/gists_9903708_forks-992bf599-2e87-4fb0-b610-7c2e1fc00398.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/__files/gists_9903708_forks-992bf599-2e87-4fb0-b610-7c2e1fc00398.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/__files/gists_9903708_forks-992bf599-2e87-4fb0-b610-7c2e1fc00398.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/__files/gists_9903708_forks-992bf599-2e87-4fb0-b610-7c2e1fc00398.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/__files/user-07500425-69d3-4dd0-8519-628a92aa66c5.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/__files/user-07500425-69d3-4dd0-8519-628a92aa66c5.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/__files/user-07500425-69d3-4dd0-8519-628a92aa66c5.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/__files/user-07500425-69d3-4dd0-8519-628a92aa66c5.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/mappings/gists_8edf855833a05ce8730d609fe8bd803a-9-e0907c.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/mappings/gists_8edf855833a05ce8730d609fe8bd803a-9-e0907c.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/mappings/gists_8edf855833a05ce8730d609fe8bd803a-9-e0907c.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/mappings/gists_8edf855833a05ce8730d609fe8bd803a-9-e0907c.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/mappings/gists_9903708-2-ab2c9d.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/mappings/gists_9903708-2-ab2c9d.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/mappings/gists_9903708-2-ab2c9d.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/mappings/gists_9903708-2-ab2c9d.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/mappings/gists_9903708_forks-7-42d6e4.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/mappings/gists_9903708_forks-7-42d6e4.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/mappings/gists_9903708_forks-7-42d6e4.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/mappings/gists_9903708_forks-7-42d6e4.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/mappings/gists_9903708_forks-8-992bf5.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/mappings/gists_9903708_forks-8-992bf5.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/mappings/gists_9903708_forks-8-992bf5.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/mappings/gists_9903708_forks-8-992bf5.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/mappings/gists_9903708_star-3-dc6fd4.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/mappings/gists_9903708_star-3-dc6fd4.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/mappings/gists_9903708_star-3-dc6fd4.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/mappings/gists_9903708_star-3-dc6fd4.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/mappings/gists_9903708_star-4-680201.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/mappings/gists_9903708_star-4-680201.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/mappings/gists_9903708_star-4-680201.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/mappings/gists_9903708_star-4-680201.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/mappings/gists_9903708_star-5-c7d88c.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/mappings/gists_9903708_star-5-c7d88c.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/mappings/gists_9903708_star-5-c7d88c.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/mappings/gists_9903708_star-5-c7d88c.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/mappings/gists_9903708_star-6-584dc0.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/mappings/gists_9903708_star-6-584dc0.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/mappings/gists_9903708_star-6-584dc0.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/mappings/gists_9903708_star-6-584dc0.json
diff --git a/src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/mappings/user-1-075004.json b/src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/mappings/user-1-075004.json
similarity index 100%
rename from src/test/resources/org/kohsuke/github/GistTest/wiremock/starTest/mappings/user-1-075004.json
rename to src/test/resources/org/kohsuke/github/GHGistTest/wiremock/starTest/mappings/user-1-075004.json