Fixes ScriptServiceTests.testDefaultBehaviourFineGrainedSettings due to
an error with the fine grained settings deprecation.
This commit is contained in:
parent
6a113ae499
commit
349d1bd23e
|
@ -219,11 +219,13 @@ public class ScriptServiceTests extends ESTestCase {
|
||||||
public void testDefaultBehaviourFineGrainedSettings() throws IOException {
|
public void testDefaultBehaviourFineGrainedSettings() throws IOException {
|
||||||
Settings.Builder builder = Settings.builder();
|
Settings.Builder builder = Settings.builder();
|
||||||
//rarely inject the default settings, which have no effect
|
//rarely inject the default settings, which have no effect
|
||||||
|
boolean deprecate = false;
|
||||||
if (rarely()) {
|
if (rarely()) {
|
||||||
builder.put("script.file", "true");
|
builder.put("script.file", "true");
|
||||||
|
deprecate = true;
|
||||||
}
|
}
|
||||||
buildScriptService(builder.build());
|
buildScriptService(builder.build());
|
||||||
createFileScripts("mustache", "dtest");
|
createFileScripts("dtest");
|
||||||
|
|
||||||
for (ScriptContext scriptContext : scriptContexts) {
|
for (ScriptContext scriptContext : scriptContexts) {
|
||||||
// only file scripts are accepted by default
|
// only file scripts are accepted by default
|
||||||
|
@ -231,8 +233,13 @@ public class ScriptServiceTests extends ESTestCase {
|
||||||
assertCompileRejected("dtest", "script", ScriptType.STORED, scriptContext);
|
assertCompileRejected("dtest", "script", ScriptType.STORED, scriptContext);
|
||||||
assertCompileAccepted("dtest", "file_script", ScriptType.FILE, scriptContext);
|
assertCompileAccepted("dtest", "file_script", ScriptType.FILE, scriptContext);
|
||||||
}
|
}
|
||||||
|
if (deprecate) {
|
||||||
|
assertSettingDeprecationsAndWarnings(ScriptSettingsTests.buildDeprecatedSettingsArray(scriptSettings, "script.file"),
|
||||||
|
"File scripts are deprecated. Use stored or inline scripts instead.");
|
||||||
|
} else {
|
||||||
assertWarnings("File scripts are deprecated. Use stored or inline scripts instead.");
|
assertWarnings("File scripts are deprecated. Use stored or inline scripts instead.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void testFineGrainedSettings() throws IOException {
|
public void testFineGrainedSettings() throws IOException {
|
||||||
//collect the fine-grained settings to set for this run
|
//collect the fine-grained settings to set for this run
|
||||||
|
|
Loading…
Reference in New Issue