|
@@ -9,12 +9,17 @@ package org.elasticsearch.xpack.deprecation;
|
|
|
|
|
|
import org.elasticsearch.common.settings.Setting;
|
|
|
import org.elasticsearch.common.settings.Settings;
|
|
|
+import org.elasticsearch.env.Environment;
|
|
|
import org.elasticsearch.test.ESTestCase;
|
|
|
import org.elasticsearch.xpack.core.deprecation.DeprecationIssue;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import static org.elasticsearch.xpack.deprecation.DeprecationChecks.NODE_SETTINGS_CHECKS;
|
|
|
import static org.hamcrest.Matchers.equalTo;
|
|
|
import static org.hamcrest.Matchers.not;
|
|
|
import static org.hamcrest.Matchers.nullValue;
|
|
|
+import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
|
|
|
|
|
|
public class NodeDeprecationChecksTests extends ESTestCase {
|
|
|
|
|
@@ -42,4 +47,19 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
|
|
assertThat(issue.getUrl(), equalTo("https://removed-setting.example.com"));
|
|
|
}
|
|
|
|
|
|
+ public void testSharedDataPathSetting() {
|
|
|
+ Settings settings = Settings.builder()
|
|
|
+ .put(Environment.PATH_HOME_SETTING.getKey(), createTempDir())
|
|
|
+ .put(Environment.PATH_SHARED_DATA_SETTING.getKey(), createTempDir()).build();
|
|
|
+
|
|
|
+ List<DeprecationIssue> issues = DeprecationChecks.filterChecks(NODE_SETTINGS_CHECKS, c -> c.apply(settings, null));
|
|
|
+ final String expectedUrl =
|
|
|
+ "https://www.elastic.co/guide/en/elasticsearch/reference/7.13/breaking-changes-7.13.html#deprecate-shared-data-path-setting";
|
|
|
+ assertThat(issues, contains(
|
|
|
+ new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
|
|
+ "setting [path.shared_data] is deprecated and will be removed in a future version",
|
|
|
+ expectedUrl,
|
|
|
+ "Found shared data path configured. Discontinue use of this setting."
|
|
|
+ )));
|
|
|
+ }
|
|
|
}
|