TestProjectInvalidation: Add generic method to make project.config invalid
For tests that check behaviour for projects with an invalid project.config file (Gerrit throws ConfigInvalidException on load) it is not relevant how the project.config file is made invalid. Hence these tests should not need to specify a specific project.config update that invalidates the project.config file. Add a new method to TestProjectInvalidation that allows them to invalidate the project.config file without specifying an update step. Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: I0bd144101addf0c4b009516c40517c5a1f83a8f7
This commit is contained in:
@@ -894,14 +894,10 @@ public class ProjectIT extends AbstractDaemonTest {
|
||||
|
||||
@Test
|
||||
public void getProjectThatHasInvalidProjectConfig() throws Exception {
|
||||
// Make the project config invalid by adding permission entry with an invalid permission name.
|
||||
projectOperations
|
||||
.project(allProjects)
|
||||
.forInvalidation()
|
||||
.addProjectConfigUpdater(
|
||||
cfg ->
|
||||
cfg.setString(
|
||||
"access", "refs/*", "Invalid Permission Name", "group Administrators"))
|
||||
.makeProjectConfigInvalid()
|
||||
.invalidate();
|
||||
|
||||
// We must test this via the REST API since ExceptionHook is not invoked from the Java API.
|
||||
|
||||
Reference in New Issue
Block a user