diff --git a/javatests/com/google/gerrit/elasticsearch/ElasticV6QueryChangesTest.java b/javatests/com/google/gerrit/elasticsearch/ElasticV6QueryChangesTest.java index cd46bf1065..f1dcbaf63c 100644 --- a/javatests/com/google/gerrit/elasticsearch/ElasticV6QueryChangesTest.java +++ b/javatests/com/google/gerrit/elasticsearch/ElasticV6QueryChangesTest.java @@ -60,8 +60,10 @@ public class ElasticV6QueryChangesTest extends AbstractQueryChangesTest { client.execute( new HttpPost( String.format( - "http://localhost:%d/%s*/_close", - container.getHttpHost().getPort(), getSanitizedMethodName())), + "http://%s:%d/%s*/_close", + container.getHttpHost().getHostName(), + container.getHttpHost().getPort(), + getSanitizedMethodName())), HttpClientContext.create(), null); } diff --git a/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryChangesTest.java b/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryChangesTest.java index c8514e827d..704f2f1284 100644 --- a/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryChangesTest.java +++ b/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryChangesTest.java @@ -60,8 +60,10 @@ public class ElasticV7QueryChangesTest extends AbstractQueryChangesTest { client.execute( new HttpPost( String.format( - "http://localhost:%d/%s*/_close", - container.getHttpHost().getPort(), getSanitizedMethodName())), + "http://%s:%d/%s*/_close", + container.getHttpHost().getHostName(), + container.getHttpHost().getPort(), + getSanitizedMethodName())), HttpClientContext.create(), null); }