tests: Simplify blockRead and block

The same pattern was repeated in many places. Centralize it and reuse
from there.

Change-Id: I3731876805271e9247a36b06b860915344b9044b
This commit is contained in:
Nasser Grainawi
2015-11-10 12:54:52 -08:00
parent 5e2585f6a1
commit 5f889d3101
8 changed files with 23 additions and 30 deletions

View File

@@ -15,13 +15,11 @@
package com.google.gerrit.acceptance.git;
import static com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS;
import static com.google.gerrit.server.project.Util.block;
import com.google.gerrit.acceptance.AbstractDaemonTest;
import com.google.gerrit.acceptance.NoHttpd;
import com.google.gerrit.acceptance.PushOneCommit;
import com.google.gerrit.common.data.Permission;
import com.google.gerrit.server.git.ProjectConfig;
import org.junit.Before;
import org.junit.Test;
@@ -31,9 +29,7 @@ public class DraftChangeBlockedIT extends AbstractDaemonTest {
@Before
public void setUp() throws Exception {
ProjectConfig cfg = projectCache.checkedGet(project).getConfig();
block(cfg, Permission.PUSH, ANONYMOUS_USERS, "refs/drafts/*");
saveProjectConfig(project, cfg);
block(Permission.PUSH, ANONYMOUS_USERS, "refs/drafts/*");
}
@Test