Skip to content
Snippets Groups Projects
Commit e48af2e3 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-7346: Experiment with scheme

parent 1ca0b75c
No related branches found
No related tags found
No related merge requests found
......@@ -43,10 +43,11 @@ public class ElasticsearchTestClient {
private static final String USER = "elastic";
private static final String PASSWORD = "s3cret";
private static final int PORT = 9200;
private static final String SCHEME = "https";
private static final String SCHEME = "http";
private static final Duration STARTUP_TIMEOUT = Duration.of(2, ChronoUnit.MINUTES);
public static final ElasticsearchContainer ELASTICSEARCH_CONTAINER = new ElasticsearchContainer(IMAGE_NAME)
//.withAccessToHost(true)
.withExposedPorts(PORT)
.withPassword(PASSWORD)
.withStartupTimeout(STARTUP_TIMEOUT)
......@@ -58,6 +59,8 @@ public class ElasticsearchTestClient {
}
private static RestClient buildRestClient() {
//ggf. IP-addresse vom Container ermitteln, die letzte Stelle ändern und mit der .1 reden (Host-Interface)
var host = new HttpHost("localhost", ELASTICSEARCH_CONTAINER.getMappedPort(PORT), SCHEME);
var credentialsProvider = buildCredentialsProvider();
var builder = RestClient.builder(host);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment