19
19
20
20
package org .elasticsearch .client ;
21
21
22
+ import org .apache .http .util .EntityUtils ;
22
23
import org .elasticsearch .ElasticsearchException ;
23
24
import org .elasticsearch .action .admin .cluster .health .ClusterHealthRequest ;
24
25
import org .elasticsearch .action .admin .cluster .health .ClusterHealthResponse ;
34
35
import org .elasticsearch .common .unit .ByteSizeUnit ;
35
36
import org .elasticsearch .common .xcontent .XContentType ;
36
37
import org .elasticsearch .common .xcontent .support .XContentMapValues ;
38
+ import org .elasticsearch .client .Request ;
37
39
import org .elasticsearch .indices .recovery .RecoverySettings ;
38
40
import org .elasticsearch .rest .RestStatus ;
39
41
@@ -174,6 +176,8 @@ public void testClusterHealthYellowClusterLevel() throws IOException {
174
176
request .timeout ("5s" );
175
177
ClusterHealthResponse response = execute (request , highLevelClient ().cluster ()::health , highLevelClient ().cluster ()::healthAsync );
176
178
179
+ logger .info ("Shard stats\n {}" , EntityUtils .toString (
180
+ client ().performRequest (new Request ("GET" , "/_cat/shards" )).getEntity ()));
177
181
assertYellowShards (response );
178
182
assertThat (response .getIndices ().size (), equalTo (0 ));
179
183
}
@@ -186,6 +190,8 @@ public void testClusterHealthYellowIndicesLevel() throws IOException {
186
190
request .level (ClusterHealthRequest .Level .INDICES );
187
191
ClusterHealthResponse response = execute (request , highLevelClient ().cluster ()::health , highLevelClient ().cluster ()::healthAsync );
188
192
193
+ logger .info ("Shard stats\n {}" , EntityUtils .toString (
194
+ client ().performRequest (new Request ("GET" , "/_cat/shards" )).getEntity ()));
189
195
assertYellowShards (response );
190
196
assertThat (response .getIndices ().size (), equalTo (2 ));
191
197
for (Map .Entry <String , ClusterIndexHealth > entry : response .getIndices ().entrySet ()) {
0 commit comments