diff options
author | Jack Conradson <osjdconrad@gmail.com> | 2016-11-10 09:59:13 -0800 |
---|---|---|
committer | Jack Conradson <osjdconrad@gmail.com> | 2016-11-10 09:59:13 -0800 |
commit | aeb97ff41298e26b107a733837dfe17f123c0c9b (patch) | |
tree | 8d37fa8c7365df2ce52626b003c1838572a62d88 /core/src/test/java/org/elasticsearch/script/ScriptTests.java | |
parent | 2e531902ffb776e6ea9d15e99ab904aa4cb256dc (diff) |
Clean up of Script.
Closes #21321
Diffstat (limited to 'core/src/test/java/org/elasticsearch/script/ScriptTests.java')
-rw-r--r-- | core/src/test/java/org/elasticsearch/script/ScriptTests.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/core/src/test/java/org/elasticsearch/script/ScriptTests.java b/core/src/test/java/org/elasticsearch/script/ScriptTests.java index c6424fdbdf..c1c25a500b 100644 --- a/core/src/test/java/org/elasticsearch/script/ScriptTests.java +++ b/core/src/test/java/org/elasticsearch/script/ScriptTests.java @@ -65,7 +65,7 @@ public class ScriptTests extends ESTestCase { } private Script createScript(XContent xContent) throws IOException { - final Map<String, Object> params = randomBoolean() ? null : Collections.singletonMap("key", "value"); + final Map<String, Object> params = randomBoolean() ? Collections.emptyMap() : Collections.singletonMap("key", "value"); ScriptType scriptType = randomFrom(ScriptType.values()); String script; if (scriptType == ScriptType.INLINE) { @@ -79,11 +79,12 @@ public class ScriptTests extends ESTestCase { script = randomAsciiOfLengthBetween(1, 5); } return new Script( - script, - scriptType, - randomFrom("_lang1", "_lang2", null), - params, - scriptType == ScriptType.INLINE ? xContent.type() : null + scriptType, + randomFrom("_lang1", "_lang2", "_lang3"), + script, + scriptType == ScriptType.INLINE ? + Collections.singletonMap(Script.CONTENT_TYPE_OPTION, xContent.type().mediaType()) : Collections.emptyMap(), + params ); } |