@@ -189,12 +189,12 @@ public ActionRequestValidationException validate() {
189
189
190
190
{
191
191
ActionRequestValidationException actualException = expectThrows (ActionRequestValidationException .class ,
192
- () -> restHighLevelClient .performRequest (request , null , null , null ));
192
+ () -> restHighLevelClient .performRequest (request , null , RequestOptions . DEFAULT , null , null ));
193
193
assertSame (validationException , actualException );
194
194
}
195
195
{
196
196
TrackingActionListener trackingActionListener = new TrackingActionListener ();
197
- restHighLevelClient .performRequestAsync (request , null , null , trackingActionListener , null );
197
+ restHighLevelClient .performRequestAsync (request , null , RequestOptions . DEFAULT , null , trackingActionListener , null );
198
198
assertSame (validationException , trackingActionListener .exception .get ());
199
199
}
200
200
}
@@ -308,13 +308,13 @@ public void testPerformRequestOnSuccess() throws IOException {
308
308
Response mockResponse = new Response (REQUEST_LINE , new HttpHost ("localhost" , 9200 ), httpResponse );
309
309
when (restClient .performRequest (any (Request .class ))).thenReturn (mockResponse );
310
310
{
311
- Integer result = restHighLevelClient .performRequest (mainRequest , requestConverter ,
311
+ Integer result = restHighLevelClient .performRequest (mainRequest , requestConverter , RequestOptions . DEFAULT ,
312
312
response -> response .getStatusLine ().getStatusCode (), Collections .emptySet ());
313
313
assertEquals (restStatus .getStatus (), result .intValue ());
314
314
}
315
315
{
316
316
IOException ioe = expectThrows (IOException .class , () -> restHighLevelClient .performRequest (mainRequest ,
317
- requestConverter , response -> {throw new IllegalStateException ();}, Collections .emptySet ()));
317
+ requestConverter , RequestOptions . DEFAULT , response -> {throw new IllegalStateException ();}, Collections .emptySet ()));
318
318
assertEquals ("Unable to parse response body for Response{requestLine=GET / http/1.1, host=http://localhost:9200, " +
319
319
"response=http/1.1 " + restStatus .getStatus () + " " + restStatus .name () + "}" , ioe .getMessage ());
320
320
}
@@ -329,7 +329,7 @@ public void testPerformRequestOnResponseExceptionWithoutEntity() throws IOExcept
329
329
ResponseException responseException = new ResponseException (mockResponse );
330
330
when (restClient .performRequest (any (Request .class ))).thenThrow (responseException );
331
331
ElasticsearchException elasticsearchException = expectThrows (ElasticsearchException .class ,
332
- () -> restHighLevelClient .performRequest (mainRequest , requestConverter ,
332
+ () -> restHighLevelClient .performRequest (mainRequest , requestConverter , RequestOptions . DEFAULT ,
333
333
response -> response .getStatusLine ().getStatusCode (), Collections .emptySet ()));
334
334
assertEquals (responseException .getMessage (), elasticsearchException .getMessage ());
335
335
assertEquals (restStatus , elasticsearchException .status ());
@@ -347,7 +347,7 @@ public void testPerformRequestOnResponseExceptionWithEntity() throws IOException
347
347
ResponseException responseException = new ResponseException (mockResponse );
348
348
when (restClient .performRequest (any (Request .class ))).thenThrow (responseException );
349
349
ElasticsearchException elasticsearchException = expectThrows (ElasticsearchException .class ,
350
- () -> restHighLevelClient .performRequest (mainRequest , requestConverter ,
350
+ () -> restHighLevelClient .performRequest (mainRequest , requestConverter , RequestOptions . DEFAULT ,
351
351
response -> response .getStatusLine ().getStatusCode (), Collections .emptySet ()));
352
352
assertEquals ("Elasticsearch exception [type=exception, reason=test error message]" , elasticsearchException .getMessage ());
353
353
assertEquals (restStatus , elasticsearchException .status ());
@@ -364,7 +364,7 @@ public void testPerformRequestOnResponseExceptionWithBrokenEntity() throws IOExc
364
364
ResponseException responseException = new ResponseException (mockResponse );
365
365
when (restClient .performRequest (any (Request .class ))).thenThrow (responseException );
366
366
ElasticsearchException elasticsearchException = expectThrows (ElasticsearchException .class ,
367
- () -> restHighLevelClient .performRequest (mainRequest , requestConverter ,
367
+ () -> restHighLevelClient .performRequest (mainRequest , requestConverter , RequestOptions . DEFAULT ,
368
368
response -> response .getStatusLine ().getStatusCode (), Collections .emptySet ()));
369
369
assertEquals ("Unable to parse response body" , elasticsearchException .getMessage ());
370
370
assertEquals (restStatus , elasticsearchException .status ());
@@ -382,7 +382,7 @@ public void testPerformRequestOnResponseExceptionWithBrokenEntity2() throws IOEx
382
382
ResponseException responseException = new ResponseException (mockResponse );
383
383
when (restClient .performRequest (any (Request .class ))).thenThrow (responseException );
384
384
ElasticsearchException elasticsearchException = expectThrows (ElasticsearchException .class ,
385
- () -> restHighLevelClient .performRequest (mainRequest , requestConverter ,
385
+ () -> restHighLevelClient .performRequest (mainRequest , requestConverter , RequestOptions . DEFAULT ,
386
386
response -> response .getStatusLine ().getStatusCode (), Collections .emptySet ()));
387
387
assertEquals ("Unable to parse response body" , elasticsearchException .getMessage ());
388
388
assertEquals (restStatus , elasticsearchException .status ());
@@ -398,7 +398,7 @@ public void testPerformRequestOnResponseExceptionWithIgnores() throws IOExceptio
398
398
ResponseException responseException = new ResponseException (mockResponse );
399
399
when (restClient .performRequest (any (Request .class ))).thenThrow (responseException );
400
400
//although we got an exception, we turn it into a successful response because the status code was provided among ignores
401
- assertEquals (Integer .valueOf (404 ), restHighLevelClient .performRequest (mainRequest , requestConverter ,
401
+ assertEquals (Integer .valueOf (404 ), restHighLevelClient .performRequest (mainRequest , requestConverter , RequestOptions . DEFAULT ,
402
402
response -> response .getStatusLine ().getStatusCode (), Collections .singleton (404 )));
403
403
}
404
404
@@ -410,7 +410,7 @@ public void testPerformRequestOnResponseExceptionWithIgnoresErrorNoBody() throws
410
410
ResponseException responseException = new ResponseException (mockResponse );
411
411
when (restClient .performRequest (any (Request .class ))).thenThrow (responseException );
412
412
ElasticsearchException elasticsearchException = expectThrows (ElasticsearchException .class ,
413
- () -> restHighLevelClient .performRequest (mainRequest , requestConverter ,
413
+ () -> restHighLevelClient .performRequest (mainRequest , requestConverter , RequestOptions . DEFAULT ,
414
414
response -> {throw new IllegalStateException ();}, Collections .singleton (404 )));
415
415
assertEquals (RestStatus .NOT_FOUND , elasticsearchException .status ());
416
416
assertSame (responseException , elasticsearchException .getCause ());
@@ -427,7 +427,7 @@ public void testPerformRequestOnResponseExceptionWithIgnoresErrorValidBody() thr
427
427
ResponseException responseException = new ResponseException (mockResponse );
428
428
when (restClient .performRequest (any (Request .class ))).thenThrow (responseException );
429
429
ElasticsearchException elasticsearchException = expectThrows (ElasticsearchException .class ,
430
- () -> restHighLevelClient .performRequest (mainRequest , requestConverter ,
430
+ () -> restHighLevelClient .performRequest (mainRequest , requestConverter , RequestOptions . DEFAULT ,
431
431
response -> {throw new IllegalStateException ();}, Collections .singleton (404 )));
432
432
assertEquals (RestStatus .NOT_FOUND , elasticsearchException .status ());
433
433
assertSame (responseException , elasticsearchException .getSuppressed ()[0 ]);
0 commit comments