Elasticsearch: Unharcode localhost for container's
No longer hardcode the docker container hostname for the Elasticsearch tests. Use the hostname that was dynamically resolved from the running ElasticContainer (the 'testcontainer') instead. This is so that tests running upon non-localhost named containers may pass like in the localhost case. Change-Id: I9dbd8b76bd7b22004d1d2327bb4c8395907ff223
This commit is contained in:
@@ -42,7 +42,9 @@ public class ElasticV6QueryProjectsTest extends AbstractQueryProjectsTest {
|
||||
}
|
||||
|
||||
container = ElasticContainer.createAndStart(ElasticVersion.V6_8);
|
||||
nodeInfo = new ElasticNodeInfo(container.getHttpHost().getPort());
|
||||
nodeInfo =
|
||||
new ElasticNodeInfo(
|
||||
container.getHttpHost().getHostName(), container.getHttpHost().getPort());
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
@@ -63,7 +65,8 @@ public class ElasticV6QueryProjectsTest extends AbstractQueryProjectsTest {
|
||||
Config elasticsearchConfig = new Config(config);
|
||||
InMemoryModule.setDefaults(elasticsearchConfig);
|
||||
String indicesPrefix = getSanitizedMethodName();
|
||||
ElasticTestUtils.configure(elasticsearchConfig, nodeInfo.port, indicesPrefix);
|
||||
ElasticTestUtils.configure(
|
||||
elasticsearchConfig, nodeInfo.hostname, nodeInfo.port, indicesPrefix);
|
||||
return Guice.createInjector(new InMemoryModule(elasticsearchConfig, notesMigration));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user