diff --git a/NOTICE b/NOTICE index 07f5c2de3fe450aff1c8c47fe8a5622506aa2f91..a2a8fd7e6a053f1ca6a502aef00deef5f51b9d27 100644 --- a/NOTICE +++ b/NOTICE @@ -527,9 +527,9 @@ The following software have components provided under the terms of this license: - Spring Boot Reactor Netty Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-reactor-netty, https://spring.io/projects/spring-boot) - Spring Boot Security Starter (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot) - Spring Boot Starter (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot) -- Spring Boot Test (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot) -- Spring Boot Test Auto-Configure (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot) -- Spring Boot Test Starter (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot) +- Spring Boot Test (from http://projects.spring.io/spring-boot/, https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-test, https://spring.io/projects/spring-boot) +- Spring Boot Test Auto-Configure (from http://projects.spring.io/spring-boot/, https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-test-autoconfigure, https://spring.io/projects/spring-boot) +- Spring Boot Test Starter (from http://projects.spring.io/spring-boot/, https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-test, https://spring.io/projects/spring-boot) - Spring Boot Tomcat Starter (from http://projects.spring.io/spring-boot/, https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-tomcat, https://spring.io/projects/spring-boot) - Spring Boot Validation Starter (from http://projects.spring.io/spring-boot/, https://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot) - Spring Boot Web Starter (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot) diff --git a/testing/indexer-test-core/src/main/java/org/opengroup/osdu/util/ElasticUtils.java b/testing/indexer-test-core/src/main/java/org/opengroup/osdu/util/ElasticUtils.java index 51502c68198ab4c42c236e052c148c11287bda0e..b37e7daa324d2f73d3c85598dcb64a5317abaf5b 100644 --- a/testing/indexer-test-core/src/main/java/org/opengroup/osdu/util/ElasticUtils.java +++ b/testing/indexer-test-core/src/main/java/org/opengroup/osdu/util/ElasticUtils.java @@ -17,8 +17,10 @@ package org.opengroup.osdu.util; +import com.google.api.client.util.Strings; import com.google.gson.Gson; +import java.net.URI; import java.security.KeyManagementException; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; @@ -411,14 +413,22 @@ public class ElasticUtils { restHighLevelClient = new RestHighLevelClient(builder); } catch (Exception e) { - throw new AssertionError("Setup elastic error"); + throw new AssertionError("Setup elastic error: %s" + e.getMessage()); } return restHighLevelClient; } - public RestClientBuilder createClientBuilder(String host, String usernameAndPassword, int port) { + public RestClientBuilder createClientBuilder(String url, String usernameAndPassword, int port) throws Exception { String scheme = this.sslEnabled ? "https" : "http"; - RestClientBuilder builder = RestClient.builder(new HttpHost(host, port, scheme)); + + url = url.trim().replaceAll("^(?i)(https?)://",""); + URI uri = new URI(scheme + "://" + url); + + RestClientBuilder builder = RestClient.builder(new HttpHost(uri.getHost(), port, uri.getScheme())); + if (!Strings.isNullOrEmpty(uri.getPath())) { + builder.setPathPrefix(uri.getPath()); + } + builder.setRequestConfigCallback(requestConfigBuilder -> requestConfigBuilder.setConnectTimeout(REST_CLIENT_CONNECT_TIMEOUT) .setSocketTimeout(REST_CLIENT_SOCKET_TIMEOUT));