Merge branch 'stable-3.0' into stable-3.1
* stable-3.0: ChangeQueryBuilder: Use ChangeIsVisibleToPredicate.Factory ChangeQueryProcessor: Use ChangeIsVisibleToPredicate.Factory Don't inject CurrentUser to ChangeIsVisibleToPredicate Change-Id: I2edad75127bd8425073fdb28ddfa1dff933e1177
This commit is contained in:
@@ -20,9 +20,13 @@ import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth.assertWithMessage;
|
||||
import static com.google.common.truth.Truth8.assertThat;
|
||||
import static com.google.common.truth.TruthJUnit.assume;
|
||||
import static com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.allow;
|
||||
import static com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.block;
|
||||
import static com.google.gerrit.entities.Patch.COMMIT_MSG;
|
||||
import static com.google.gerrit.entities.Patch.MERGE_LIST;
|
||||
import static com.google.gerrit.extensions.api.changes.SubmittedTogetherOption.NON_VISIBLE_CHANGES;
|
||||
import static com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS;
|
||||
import static com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS;
|
||||
import static com.google.gerrit.server.project.testing.TestLabels.label;
|
||||
import static com.google.gerrit.server.project.testing.TestLabels.value;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
@@ -40,6 +44,7 @@ import com.google.common.jimfs.Jimfs;
|
||||
import com.google.common.primitives.Chars;
|
||||
import com.google.gerrit.acceptance.AcceptanceTestRequestScope.Context;
|
||||
import com.google.gerrit.acceptance.testsuite.account.TestSshKeys;
|
||||
import com.google.gerrit.acceptance.testsuite.project.ProjectOperations;
|
||||
import com.google.gerrit.acceptance.testsuite.request.RequestScopeOperations;
|
||||
import com.google.gerrit.common.Nullable;
|
||||
import com.google.gerrit.common.data.AccessSection;
|
||||
@@ -290,6 +295,7 @@ public abstract class AbstractDaemonTest {
|
||||
@Inject private ProjectIndexCollection projectIndexes;
|
||||
@Inject private RequestScopeOperations requestScopeOperations;
|
||||
@Inject private SitePaths sitePaths;
|
||||
@Inject private ProjectOperations projectOperations;
|
||||
|
||||
private ProjectResetter resetter;
|
||||
private List<Repository> toClose;
|
||||
@@ -970,6 +976,16 @@ public abstract class AbstractDaemonTest {
|
||||
}
|
||||
}
|
||||
|
||||
protected void blockAnonymousRead() throws Exception {
|
||||
String allRefs = RefNames.REFS + "*";
|
||||
projectOperations
|
||||
.project(project)
|
||||
.forUpdate()
|
||||
.add(block(Permission.READ).ref(allRefs).group(ANONYMOUS_USERS))
|
||||
.add(allow(Permission.READ).ref(allRefs).group(REGISTERED_USERS))
|
||||
.update();
|
||||
}
|
||||
|
||||
protected PushOneCommit.Result pushTo(String ref) throws Exception {
|
||||
PushOneCommit push = pushFactory.create(admin.newIdent(), testRepo);
|
||||
return push.to(ref);
|
||||
|
||||
Reference in New Issue
Block a user