@@ -79,7 +79,7 @@ public void testSimpleIndexTemplateTests() throws Exception {
7979 indicesAdmin ().prepareDeleteTemplate ("*" ).get ();
8080
8181 // check get all templates on an empty index.
82- GetIndexTemplatesResponse response = indicesAdmin ().prepareGetTemplates ().get ();
82+ GetIndexTemplatesResponse response = indicesAdmin ().prepareGetTemplates (TEST_REQUEST_TIMEOUT ).get ();
8383 assertThat (response .getIndexTemplates (), empty ());
8484
8585 indicesAdmin ().preparePutTemplate ("template_1" )
@@ -145,7 +145,7 @@ public void testSimpleIndexTemplateTests() throws Exception {
145145 );
146146 expectThrows (IllegalArgumentException .class , builder );
147147
148- response = indicesAdmin ().prepareGetTemplates ().get ();
148+ response = indicesAdmin ().prepareGetTemplates (TEST_REQUEST_TIMEOUT ).get ();
149149 assertThat (response .getIndexTemplates (), hasSize (2 ));
150150
151151 // index something into test_index, will match on both templates
@@ -292,15 +292,16 @@ public void testThatGetIndexTemplatesWorks() throws Exception {
292292 .get ();
293293
294294 logger .info ("--> get template template_1" );
295- GetIndexTemplatesResponse getTemplate1Response = indicesAdmin ().prepareGetTemplates ("template_1" ).get ();
295+ GetIndexTemplatesResponse getTemplate1Response = indicesAdmin ().prepareGetTemplates (TEST_REQUEST_TIMEOUT , "template_1" ).get ();
296296 assertThat (getTemplate1Response .getIndexTemplates (), hasSize (1 ));
297297 assertThat (getTemplate1Response .getIndexTemplates ().get (0 ), is (notNullValue ()));
298298 assertThat (getTemplate1Response .getIndexTemplates ().get (0 ).patterns (), is (Collections .singletonList ("te*" )));
299299 assertThat (getTemplate1Response .getIndexTemplates ().get (0 ).getOrder (), is (0 ));
300300 assertThat (getTemplate1Response .getIndexTemplates ().get (0 ).getVersion (), is (123 ));
301301
302302 logger .info ("--> get non-existing-template" );
303- GetIndexTemplatesResponse getTemplate2Response = indicesAdmin ().prepareGetTemplates ("non-existing-template" ).get ();
303+ GetIndexTemplatesResponse getTemplate2Response = indicesAdmin ().prepareGetTemplates (TEST_REQUEST_TIMEOUT , "non-existing-template" )
304+ .get ();
304305 assertThat (getTemplate2Response .getIndexTemplates (), hasSize (0 ));
305306 }
306307
@@ -375,7 +376,7 @@ public void testThatGetIndexTemplatesWithSimpleRegexWorks() throws Exception {
375376 .get ();
376377
377378 logger .info ("--> get template template_*" );
378- GetIndexTemplatesResponse getTemplate1Response = indicesAdmin ().prepareGetTemplates ("template_*" ).get ();
379+ GetIndexTemplatesResponse getTemplate1Response = indicesAdmin ().prepareGetTemplates (TEST_REQUEST_TIMEOUT , "template_*" ).get ();
379380 assertThat (getTemplate1Response .getIndexTemplates (), hasSize (2 ));
380381
381382 List <String > templateNames = new ArrayList <>();
@@ -384,7 +385,7 @@ public void testThatGetIndexTemplatesWithSimpleRegexWorks() throws Exception {
384385 assertThat (templateNames , containsInAnyOrder ("template_1" , "template_2" ));
385386
386387 logger .info ("--> get all templates" );
387- getTemplate1Response = indicesAdmin ().prepareGetTemplates ("template*" ).get ();
388+ getTemplate1Response = indicesAdmin ().prepareGetTemplates (TEST_REQUEST_TIMEOUT , "template*" ).get ();
388389 assertThat (getTemplate1Response .getIndexTemplates (), hasSize (3 ));
389390
390391 templateNames = new ArrayList <>();
@@ -394,7 +395,7 @@ public void testThatGetIndexTemplatesWithSimpleRegexWorks() throws Exception {
394395 assertThat (templateNames , containsInAnyOrder ("template_1" , "template_2" , "template3" ));
395396
396397 logger .info ("--> get templates template_1 and template_2" );
397- getTemplate1Response = indicesAdmin ().prepareGetTemplates ("template_1" , "template_2" ).get ();
398+ getTemplate1Response = indicesAdmin ().prepareGetTemplates (TEST_REQUEST_TIMEOUT , "template_1" , "template_2" ).get ();
398399 assertThat (getTemplate1Response .getIndexTemplates (), hasSize (2 ));
399400
400401 templateNames = new ArrayList <>();
@@ -419,7 +420,7 @@ public void testThatInvalidGetIndexTemplatesFails() throws Exception {
419420
420421 private void testExpectActionRequestValidationException (String ... names ) {
421422 assertRequestBuilderThrows (
422- indicesAdmin ().prepareGetTemplates (names ),
423+ indicesAdmin ().prepareGetTemplates (TEST_REQUEST_TIMEOUT , names ),
423424 ActionRequestValidationException .class ,
424425 "get template with " + Arrays .toString (names )
425426 );
@@ -430,7 +431,7 @@ public void testBrokenMapping() throws Exception {
430431 indicesAdmin ().prepareDeleteTemplate ("*" ).get ();
431432
432433 // check get all templates on an empty index.
433- GetIndexTemplatesResponse response = indicesAdmin ().prepareGetTemplates ().get ();
434+ GetIndexTemplatesResponse response = indicesAdmin ().prepareGetTemplates (TEST_REQUEST_TIMEOUT ).get ();
434435 assertThat (response .getIndexTemplates (), empty ());
435436
436437 MapperParsingException e = expectThrows (
@@ -441,7 +442,7 @@ public void testBrokenMapping() throws Exception {
441442 );
442443 assertThat (e .getMessage (), containsString ("Failed to parse mapping" ));
443444
444- response = indicesAdmin ().prepareGetTemplates ().get ();
445+ response = indicesAdmin ().prepareGetTemplates (TEST_REQUEST_TIMEOUT ).get ();
445446 assertThat (response .getIndexTemplates (), hasSize (0 ));
446447 }
447448
@@ -450,7 +451,7 @@ public void testInvalidSettings() throws Exception {
450451 indicesAdmin ().prepareDeleteTemplate ("*" ).get ();
451452
452453 // check get all templates on an empty index.
453- GetIndexTemplatesResponse response = indicesAdmin ().prepareGetTemplates ().get ();
454+ GetIndexTemplatesResponse response = indicesAdmin ().prepareGetTemplates (TEST_REQUEST_TIMEOUT ).get ();
454455 assertThat (response .getIndexTemplates (), empty ());
455456
456457 IllegalArgumentException e = expectThrows (
@@ -465,7 +466,7 @@ public void testInvalidSettings() throws Exception {
465466 e .getMessage ()
466467 );
467468
468- response = indicesAdmin ().prepareGetTemplates ().get ();
469+ response = indicesAdmin ().prepareGetTemplates (TEST_REQUEST_TIMEOUT ).get ();
469470 assertEquals (0 , response .getIndexTemplates ().size ());
470471
471472 createIndex ("test" );
@@ -597,7 +598,7 @@ public void testDuplicateAlias() throws Exception {
597598 .addAlias (new Alias ("my_alias" ).filter (termQuery ("field" , "value2" )))
598599 .get ();
599600
600- GetIndexTemplatesResponse response = indicesAdmin ().prepareGetTemplates ("template_1" ).get ();
601+ GetIndexTemplatesResponse response = indicesAdmin ().prepareGetTemplates (TEST_REQUEST_TIMEOUT , "template_1" ).get ();
601602 assertThat (response .getIndexTemplates ().size (), equalTo (1 ));
602603 assertThat (response .getIndexTemplates ().get (0 ).getAliases ().size (), equalTo (1 ));
603604 assertThat (response .getIndexTemplates ().get (0 ).getAliases ().get ("my_alias" ).filter ().string (), containsString ("\" value1\" " ));
@@ -610,7 +611,7 @@ public void testAliasInvalidFilterValidJson() throws Exception {
610611 .addAlias (new Alias ("invalid_alias" ).filter ("{ \" invalid\" : {} }" ))
611612 .get ();
612613
613- GetIndexTemplatesResponse response = indicesAdmin ().prepareGetTemplates ("template_1" ).get ();
614+ GetIndexTemplatesResponse response = indicesAdmin ().prepareGetTemplates (TEST_REQUEST_TIMEOUT , "template_1" ).get ();
614615 assertThat (response .getIndexTemplates ().size (), equalTo (1 ));
615616 assertThat (response .getIndexTemplates ().get (0 ).getAliases ().size (), equalTo (1 ));
616617 assertThat (response .getIndexTemplates ().get (0 ).getAliases ().get ("invalid_alias" ).filter ().string (), equalTo ("{\" invalid\" :{}}" ));
@@ -631,7 +632,7 @@ public void testAliasInvalidFilterInvalidJson() throws Exception {
631632 );
632633 assertThat (e .getMessage (), equalTo ("failed to parse filter for alias [invalid_alias]" ));
633634
634- GetIndexTemplatesResponse response = indicesAdmin ().prepareGetTemplates ("template_1" ).get ();
635+ GetIndexTemplatesResponse response = indicesAdmin ().prepareGetTemplates (TEST_REQUEST_TIMEOUT , "template_1" ).get ();
635636 assertThat (response .getIndexTemplates ().size (), equalTo (0 ));
636637 }
637638
@@ -747,7 +748,7 @@ public void testCombineTemplates() throws Exception {
747748 indicesAdmin ().prepareDeleteTemplate ("*" ).get ();
748749
749750 // check get all templates on an empty index.
750- GetIndexTemplatesResponse response = indicesAdmin ().prepareGetTemplates ().get ();
751+ GetIndexTemplatesResponse response = indicesAdmin ().prepareGetTemplates (TEST_REQUEST_TIMEOUT ).get ();
751752 assertThat (response .getIndexTemplates (), empty ());
752753
753754 // Now, a complete mapping with two separated templates is error
@@ -789,7 +790,7 @@ public void testCombineTemplates() throws Exception {
789790 );
790791 assertThat (e .getMessage (), containsString ("analyzer [custom_1] has not been configured in mappings" ));
791792
792- response = indicesAdmin ().prepareGetTemplates ().get ();
793+ response = indicesAdmin ().prepareGetTemplates (TEST_REQUEST_TIMEOUT ).get ();
793794 assertThat (response .getIndexTemplates (), hasSize (1 ));
794795
795796 }
@@ -806,7 +807,7 @@ public void testOrderAndVersion() {
806807 .setMapping ("field" , "type=text" )
807808 );
808809
809- GetIndexTemplatesResponse response = indicesAdmin ().prepareGetTemplates ("versioned_template" ).get ();
810+ GetIndexTemplatesResponse response = indicesAdmin ().prepareGetTemplates (TEST_REQUEST_TIMEOUT , "versioned_template" ).get ();
810811 assertThat (response .getIndexTemplates ().size (), equalTo (1 ));
811812 assertThat (response .getIndexTemplates ().get (0 ).getVersion (), equalTo (version ));
812813 assertThat (response .getIndexTemplates ().get (0 ).getOrder (), equalTo (order ));
@@ -856,7 +857,7 @@ public void testPartitionedTemplate() throws Exception {
856857 indicesAdmin ().prepareDeleteTemplate ("*" ).get ();
857858
858859 // check get all templates on an empty index.
859- GetIndexTemplatesResponse response = indicesAdmin ().prepareGetTemplates ().get ();
860+ GetIndexTemplatesResponse response = indicesAdmin ().prepareGetTemplates (TEST_REQUEST_TIMEOUT ).get ();
860861 assertThat (response .getIndexTemplates (), empty ());
861862
862863 // provide more partitions than shards
@@ -882,7 +883,7 @@ public void testPartitionedTemplate() throws Exception {
882883 assertThat (eBadMapping .getMessage (), containsString ("must have routing required for partitioned index" ));
883884
884885 // no templates yet
885- response = indicesAdmin ().prepareGetTemplates ().get ();
886+ response = indicesAdmin ().prepareGetTemplates (TEST_REQUEST_TIMEOUT ).get ();
886887 assertEquals (0 , response .getIndexTemplates ().size ());
887888
888889 // a valid configuration that only provides the partition size
0 commit comments