File tree 2 files changed +15
-0
lines changed
java-client/src/test/java/co/elastic/clients/elasticsearch
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -108,4 +108,8 @@ public JsonpMapper mapper() {
108
108
public ElasticsearchClient client () {
109
109
return client ;
110
110
}
111
+
112
+ public ElasticsearchAsyncClient asyncClient () {
113
+ return new ElasticsearchAsyncClient (client ._transport (), client ._transportOptions ());
114
+ }
111
115
}
Original file line number Diff line number Diff line change 20
20
package co .elastic .clients .elasticsearch .spec_issues ;
21
21
22
22
import co .elastic .clients .elasticsearch .ElasticsearchTestServer ;
23
+ import co .elastic .clients .elasticsearch ._types .ErrorResponse ;
23
24
import co .elastic .clients .elasticsearch .cluster .ClusterStatsResponse ;
24
25
import co .elastic .clients .elasticsearch .core .SearchRequest ;
25
26
import co .elastic .clients .elasticsearch .core .SearchResponse ;
@@ -61,7 +62,17 @@ public void i0087_filterAggSubAggregation() {
61
62
resp .aggregations ().get ("login_filter" ).filter ()
62
63
.aggregations ().get ("to_domain" ).sterms ()
63
64
.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 );
64
74
75
+ assertEquals ("alias [not-existing-alias] missing" , err .error ().reason ());
65
76
}
66
77
67
78
@ Test
You can’t perform that action at this time.
0 commit comments