Merge branch 'master' into issue/682

This commit is contained in:
Liam Newman
2020-04-27 13:20:35 -07:00
committed by GitHub
30 changed files with 1614 additions and 10 deletions

View File

@@ -54,6 +54,14 @@ public class GHBranchProtectionTest extends AbstractGitHubWireMockTest {
assertTrue(repo.getBranch(BRANCH).isProtected());
}
@Test
public void testDisableProtectionOnly() throws Exception {
GHBranchProtection protection = branch.enableProtection().enable();
assertTrue(repo.getBranch(BRANCH).isProtected());
branch.disableProtection();
assertFalse(repo.getBranch(BRANCH).isProtected());
}
@Test
public void testEnableRequireReviewsOnly() throws Exception {
GHBranchProtection protection = branch.enableProtection().requireReviews().enable();
@@ -73,4 +81,12 @@ public class GHBranchProtectionTest extends AbstractGitHubWireMockTest {
protection.disableSignedCommits();
assertFalse(protection.getRequiredSignatures());
}
@Test
public void testGetProtection() throws Exception {
GHBranchProtection protection = branch.enableProtection().enable();
GHBranchProtection protectionTest = repo.getBranch(BRANCH).getProtection();
assertTrue(protectionTest instanceof GHBranchProtection);
assertTrue(repo.getBranch(BRANCH).isProtected());
}
}