File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
java-client/src/test/java/co/elastic/clients/elasticsearch Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -108,4 +108,8 @@ public JsonpMapper mapper() {
108108 public ElasticsearchClient client () {
109109 return client ;
110110 }
111+
112+ public ElasticsearchAsyncClient asyncClient () {
113+ return new ElasticsearchAsyncClient (client ._transport (), client ._transportOptions ());
114+ }
111115}
Original file line number Diff line number Diff line change 2020package co .elastic .clients .elasticsearch .spec_issues ;
2121
2222import co .elastic .clients .elasticsearch .ElasticsearchTestServer ;
23+ import co .elastic .clients .elasticsearch ._types .ErrorResponse ;
2324import co .elastic .clients .elasticsearch .cluster .ClusterStatsResponse ;
2425import co .elastic .clients .elasticsearch .core .SearchRequest ;
2526import co .elastic .clients .elasticsearch .core .SearchResponse ;
@@ -61,7 +62,17 @@ public void i0087_filterAggSubAggregation() {
6162 resp .aggregations ().get ("login_filter" ).filter ()
6263 .aggregations ().get ("to_domain" ).sterms ()
6364 .buckets ().array ().get (0 ).key ());
65+ }
66+
67+ @ Test
68+ public void i0080_simpleError () {
69+ // https://github.com/elastic/elasticsearch-java/issues/80
70+ // When requesting a missing index, the error response in compact format.
71+ // Fixed by adding ErrorCause.reason as a shortcut property
72+ String json = "{\" error\" :\" alias [not-existing-alias] missing\" ,\" status\" :404}" ;
73+ ErrorResponse err = fromJson (json , ErrorResponse .class );
6474
75+ assertEquals ("alias [not-existing-alias] missing" , err .error ().reason ());
6576 }
6677
6778 @ Test
You can’t perform that action at this time.
0 commit comments