Tests may want to contribute to the Gerrit configuration. Each method in
the test class should be able to add or override one or more parameters
of the Gerrit server configuration.
public class UseGerritConfigAnnotationTest extends AbstractDaemonTest {
@Inject
@GerritServerConfig
Config serverConfig;
@Test
@GerritConfig(name="x.y", value="z")
public void testOne() {
assertEquals("z", serverConfig.getString("x", null, "y"));
}
@Test
@GerritConfigs({
@GerritConfig(name="x.y", value="z"),
@GerritConfig(name="a.b", value="c"),
})
public void testMultiple() {
assertEquals("z", serverConfig.getString("x", null, "y"));
assertEquals("c", serverConfig.getString("a", null, "b"));
}
}
Change-Id: I506d9f86280f1b067d2083cb33726009ed72c218