Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,8 @@ public JsonpMapper mapper() {
public ElasticsearchClient client() {
return client;
}

public ElasticsearchAsyncClient asyncClient() {
return new ElasticsearchAsyncClient(client._transport(), client._transportOptions());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package co.elastic.clients.elasticsearch.spec_issues;

import co.elastic.clients.elasticsearch.ElasticsearchTestServer;
import co.elastic.clients.elasticsearch._types.ErrorResponse;
import co.elastic.clients.elasticsearch.cluster.ClusterStatsResponse;
import co.elastic.clients.elasticsearch.core.SearchRequest;
import co.elastic.clients.elasticsearch.core.SearchResponse;
Expand Down Expand Up @@ -61,7 +62,17 @@ public void i0087_filterAggSubAggregation() {
resp.aggregations().get("login_filter").filter()
.aggregations().get("to_domain").sterms()
.buckets().array().get(0).key());
}

@Test
public void i0080_simpleError() {
// https://github.com/elastic/elasticsearch-java/issues/80
// When requesting a missing index, the error response in compact format.
// Fixed by adding ErrorCause.reason as a shortcut property
String json = "{\"error\":\"alias [not-existing-alias] missing\",\"status\":404}";
ErrorResponse err = fromJson(json, ErrorResponse.class);

assertEquals("alias [not-existing-alias] missing", err.error().reason());
}

@Test
Expand Down