Do not assume ES is running on localhost in tests

Remove references to http://localhost when closing
the ES indexes during tests.

Change-Id: I7c11cb8078bfcf5a8b7a337d764dcb90f7efbf42
This commit is contained in:
Luca Milanesio
2020-04-02 11:15:18 +01:00
parent 19570b2c13
commit 6e8615737f
2 changed files with 8 additions and 4 deletions

View File

@@ -60,8 +60,10 @@ public class ElasticV6QueryChangesTest extends AbstractQueryChangesTest {
client.execute( client.execute(
new HttpPost( new HttpPost(
String.format( String.format(
"http://localhost:%d/%s*/_close", "http://%s:%d/%s*/_close",
container.getHttpHost().getPort(), getSanitizedMethodName())), container.getHttpHost().getHostName(),
container.getHttpHost().getPort(),
getSanitizedMethodName())),
HttpClientContext.create(), HttpClientContext.create(),
null); null);
} }

View File

@@ -60,8 +60,10 @@ public class ElasticV7QueryChangesTest extends AbstractQueryChangesTest {
client.execute( client.execute(
new HttpPost( new HttpPost(
String.format( String.format(
"http://localhost:%d/%s*/_close", "http://%s:%d/%s*/_close",
container.getHttpHost().getPort(), getSanitizedMethodName())), container.getHttpHost().getHostName(),
container.getHttpHost().getPort(),
getSanitizedMethodName())),
HttpClientContext.create(), HttpClientContext.create(),
null); null);
} }