4949import java .util .HashMap ;
5050import java .util .List ;
5151import java .util .Map ;
52- import java .util .function .BiConsumer ;
5352
5453import static java .util .Collections .emptyMap ;
5554import static org .elasticsearch .test .hamcrest .ElasticsearchAssertions .assertAcked ;
@@ -74,13 +73,11 @@ public void testClusterPutSettings() throws IOException {
7473 ClusterUpdateSettingsRequest setRequest = new ClusterUpdateSettingsRequest ();
7574 setRequest .transientSettings (transientSettings );
7675 setRequest .persistentSettings (map );
77- RequestOptions options = RequestOptions .DEFAULT .toBuilder ().setWarningsHandler (WarningsHandler .PERMISSIVE ).build ();
7876
7977 ClusterUpdateSettingsResponse setResponse = execute (
8078 setRequest ,
8179 highLevelClient ().cluster ()::putSettings ,
82- highLevelClient ().cluster ()::putSettingsAsync ,
83- options
80+ highLevelClient ().cluster ()::putSettingsAsync
8481 );
8582
8683 assertAcked (setResponse );
@@ -107,8 +104,7 @@ public void testClusterPutSettings() throws IOException {
107104 ClusterUpdateSettingsResponse resetResponse = execute (
108105 resetRequest ,
109106 highLevelClient ().cluster ()::putSettings ,
110- highLevelClient ().cluster ()::putSettingsAsync ,
111- options
107+ highLevelClient ().cluster ()::putSettingsAsync
112108 );
113109
114110 assertThat (resetResponse .getTransientSettings ().get (transientSettingKey ), equalTo (null ));
@@ -123,22 +119,11 @@ public void testClusterPutSettings() throws IOException {
123119 assertThat (persistentResetValue , equalTo (null ));
124120 }
125121
126- public void testClusterUpdateTransientSettingNonExistent () {
127- testClusterUpdateSettingNonExistent ((settings , request ) -> request .transientSettings (settings ), "transient" );
128- }
129-
130- public void testClusterUpdatePersistentSettingNonExistent () {
131- testClusterUpdateSettingNonExistent ((settings , request ) -> request .persistentSettings (settings ), "persistent" );
132- }
133-
134- private void testClusterUpdateSettingNonExistent (
135- final BiConsumer <Settings .Builder , ClusterUpdateSettingsRequest > consumer ,
136- String label
137- ) {
122+ public void testClusterUpdateSettingNonExistent () {
138123 String setting = "no_idea_what_you_are_talking_about" ;
139124 int value = 10 ;
140125 ClusterUpdateSettingsRequest clusterUpdateSettingsRequest = new ClusterUpdateSettingsRequest ();
141- consumer . accept (Settings .builder ().put (setting , value ), clusterUpdateSettingsRequest );
126+ clusterUpdateSettingsRequest . transientSettings (Settings .builder ().put (setting , value ). build () );
142127
143128 ElasticsearchException exception = expectThrows (
144129 ElasticsearchException .class ,
@@ -151,9 +136,7 @@ private void testClusterUpdateSettingNonExistent(
151136 assertThat (exception .status (), equalTo (RestStatus .BAD_REQUEST ));
152137 assertThat (
153138 exception .getMessage (),
154- equalTo (
155- "Elasticsearch exception [type=illegal_argument_exception, reason=" + label + " setting [" + setting + "], not recognized]"
156- )
139+ equalTo ("Elasticsearch exception [type=illegal_argument_exception, reason=transient setting [" + setting + "], not recognized]" )
157140 );
158141 }
159142
@@ -337,11 +320,6 @@ public void testClusterHealthNotFoundIndex() throws IOException {
337320 assertThat (response .status (), equalTo (RestStatus .REQUEST_TIMEOUT ));
338321 assertThat (response .getStatus (), equalTo (ClusterHealthStatus .RED ));
339322 assertNoIndices (response );
340- assertWarnings (
341- "The HTTP status code for a cluster health timeout will be changed from 408 to 200 in a "
342- + "future version. Set the [es.cluster_health.request_timeout_200] system property to [true] to suppress this message and "
343- + "opt in to the future behaviour now."
344- );
345323 }
346324
347325 public void testRemoteInfo () throws Exception {
@@ -353,13 +331,13 @@ public void testRemoteInfo() throws Exception {
353331 ClusterGetSettingsResponse settingsResponse = highLevelClient ().cluster ().getSettings (settingsRequest , RequestOptions .DEFAULT );
354332
355333 List <String > seeds = SniffConnectionStrategy .REMOTE_CLUSTER_SEEDS .getConcreteSettingForNamespace (clusterAlias )
356- .get (settingsResponse .getPersistentSettings ());
357- int connectionsPerCluster = SniffConnectionStrategy .REMOTE_CONNECTIONS_PER_CLUSTER .get (settingsResponse .getPersistentSettings ());
334+ .get (settingsResponse .getTransientSettings ());
335+ int connectionsPerCluster = SniffConnectionStrategy .REMOTE_CONNECTIONS_PER_CLUSTER .get (settingsResponse .getTransientSettings ());
358336 TimeValue initialConnectionTimeout = RemoteClusterService .REMOTE_INITIAL_CONNECTION_TIMEOUT_SETTING .get (
359- settingsResponse .getPersistentSettings ()
337+ settingsResponse .getTransientSettings ()
360338 );
361339 boolean skipUnavailable = RemoteClusterService .REMOTE_CLUSTER_SKIP_UNAVAILABLE .getConcreteSettingForNamespace (clusterAlias )
362- .get (settingsResponse .getPersistentSettings ());
340+ .get (settingsResponse .getTransientSettings ());
363341
364342 RemoteInfoRequest request = new RemoteInfoRequest ();
365343 RemoteInfoResponse response = execute (
0 commit comments