Search in sources :

Example 66 with Request

use of org.elasticsearch.client.Request in project datashare by ICIJ.

the class ElasticsearchConfigurationTest method test_create_client_creates_settings.

@Test
public void test_create_client_creates_settings() throws Exception {
    ElasticsearchConfiguration.createESClient(new PropertiesProvider());
    Response response = es.client.getLowLevelClient().performRequest(new Request("GET", TEST_INDEX));
    assertThat(EntityUtils.toString(response.getEntity())).contains("settings");
}
Also used : PropertiesProvider(org.icij.datashare.PropertiesProvider) Response(org.elasticsearch.client.Response) Request(org.elasticsearch.client.Request) Test(org.junit.Test)

Aggregations

Request (org.elasticsearch.client.Request)54 Response (org.elasticsearch.client.Response)34 JsonNode (com.fasterxml.jackson.databind.JsonNode)14 IOException (java.io.IOException)12 Request (org.graylog.shaded.elasticsearch7.org.elasticsearch.client.Request)12 HttpEntity (org.apache.http.HttpEntity)11 NStringEntity (org.apache.http.nio.entity.NStringEntity)11 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)9 Map (java.util.Map)9 Collectors (java.util.stream.Collectors)9 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)6 InputStream (java.io.InputStream)6 StringEntity (org.apache.http.entity.StringEntity)6 RestClient (org.elasticsearch.client.RestClient)6 ContentType (org.apache.http.entity.ContentType)5 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)4 ImmutableMap (com.google.common.collect.ImmutableMap)4 UncheckedIOException (java.io.UncheckedIOException)4 ArrayList (java.util.ArrayList)4 Locale (java.util.Locale)4