9
9
10
10
import org .apache .http .util .EntityUtils ;
11
11
import org .elasticsearch .client .Request ;
12
- import org .elasticsearch .client .RequestOptions ;
13
12
import org .elasticsearch .client .Response ;
14
13
import org .elasticsearch .common .settings .Settings ;
15
14
import org .elasticsearch .common .util .concurrent .ThreadContext ;
18
17
import org .elasticsearch .test .rest .ESRestTestCase ;
19
18
import org .elasticsearch .xcontent .XContentType ;
20
19
21
- import java .util .List ;
22
20
import java .util .Map ;
23
21
24
22
import static org .hamcrest .Matchers .containsString ;
@@ -40,22 +38,6 @@ protected Settings restClientSettings() {
40
38
.build ();
41
39
}
42
40
43
- private void expectSystemIndexWarning (Request request , String indexName ) {
44
- String warningMsg = "index name ["
45
- + indexName
46
- + "] starts with a dot '.', in the next major version, "
47
- + "index names starting with a dot are reserved for hidden indices and system indices" ;
48
-
49
- List <String > expectedWarnings = List .of (warningMsg );
50
-
51
- logger .info ("expecting warnings: " + expectedWarnings .toString ());
52
- RequestOptions consumeSystemIndicesWarningsOptions = RequestOptions .DEFAULT .toBuilder ()
53
- .setWarningsHandler (warnings -> expectedWarnings .equals (warnings ) == false )
54
- .build ();
55
-
56
- request .setOptions (consumeSystemIndicesWarningsOptions );
57
- }
58
-
59
41
public void testSearchWithoutIndexCreatedIsAllowed () throws Exception {
60
42
Request request = new Request ("GET" , ".fleet-agents/_search" );
61
43
request .setJsonEntity ("{ \" query\" : { \" match_all\" : {} } }" );
@@ -98,7 +80,6 @@ public void testCreationOfFleetActions() throws Exception {
98
80
99
81
public void testCreationOfFleetFiles () throws Exception {
100
82
Request request = new Request ("PUT" , ".fleet-files-agent-00001" );
101
- expectSystemIndexWarning (request , ".fleet-files-agent-00001" );
102
83
Response response = client ().performRequest (request );
103
84
assertEquals (200 , response .getStatusLine ().getStatusCode ());
104
85
@@ -111,7 +92,6 @@ public void testCreationOfFleetFiles() throws Exception {
111
92
112
93
public void testCreationOfFleetFileData () throws Exception {
113
94
Request request = new Request ("PUT" , ".fleet-file-data-agent-00001" );
114
- expectSystemIndexWarning (request , ".fleet-file-data-agent-00001" );
115
95
Response response = client ().performRequest (request );
116
96
assertEquals (200 , response .getStatusLine ().getStatusCode ());
117
97
0 commit comments