Merge branch 'stable-3.1' * stable-3.1: PullReplicationIT: simplify fetching HTTP URL Change-Id: I473842a4fd684896bf2ac627472343b6270e8171
diff --git a/src/test/java/com/googlesource/gerrit/plugins/replication/pull/PullReplicationIT.java b/src/test/java/com/googlesource/gerrit/plugins/replication/pull/PullReplicationIT.java index 53f7767..edea656 100644 --- a/src/test/java/com/googlesource/gerrit/plugins/replication/pull/PullReplicationIT.java +++ b/src/test/java/com/googlesource/gerrit/plugins/replication/pull/PullReplicationIT.java
@@ -174,7 +174,7 @@ .collect(toList()); config.setString("replication", null, "instanceLabel", remoteName); config.setStringList("remote", remoteName, "url", replicaUrls); - config.setString("remote", remoteName, "apiUrl", getListenUrl()); + config.setString("remote", remoteName, "apiUrl", adminRestSession.url()); config.setString("remote", remoteName, "fetch", "+refs/*:refs/*"); config.setInt("remote", remoteName, "timeout", 600); config.setInt("remote", remoteName, "replicationDelay", TEST_REPLICATION_DELAY); @@ -201,12 +201,4 @@ private Project.NameKey createTestProject(String name) throws Exception { return projectOperations.newProject().name(name).create(); } - - private String getListenUrl() throws IOException, ConfigInvalidException { - FileBasedConfig gerritConfig = - new FileBasedConfig(sitePaths.etc_dir.resolve("gerrit.config").toFile(), FS.DETECTED); - gerritConfig.load(); - String listenUrl = gerritConfig.getString("httpd", null, "listenUrl"); - return listenUrl.endsWith("/") ? listenUrl.substring(0, listenUrl.length() - 1) : listenUrl; - } }