mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-25 22:36:20 +00:00
Change use of generics in test
Original commit: elastic/x-pack-elasticsearch@39473681b2
This commit is contained in:
parent
c16860e901
commit
572869087d
@ -15,18 +15,21 @@ import org.elasticsearch.script.ScriptService.ScriptType;
|
|||||||
import org.elasticsearch.test.ESTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import static java.util.Collections.emptyMap;
|
|
||||||
import static java.util.Collections.singletonMap;
|
|
||||||
import static org.hamcrest.Matchers.equalTo;
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
|
|
||||||
public class WatcherScriptTests extends ESTestCase {
|
public class WatcherScriptTests extends ESTestCase {
|
||||||
|
|
||||||
public void testParseScript() throws IOException {
|
public void testParseScript() throws IOException {
|
||||||
|
final Map<String, Object> params =
|
||||||
|
randomFrom(Collections.<String, Object>emptyMap(), Collections.singletonMap("foo", (Object)"bar"), null);
|
||||||
|
|
||||||
WatcherScript script = new WatcherScript(randomAsciiOfLengthBetween(1, 5),
|
WatcherScript script = new WatcherScript(randomAsciiOfLengthBetween(1, 5),
|
||||||
randomFrom(ScriptType.values()),
|
randomFrom(ScriptType.values()),
|
||||||
randomBoolean() ? null : randomFrom("custom", "mustache"),
|
randomFrom("custom", "mustache", null),
|
||||||
randomBoolean() ? null : randomFrom(emptyMap(), singletonMap("foo", "bar")));
|
params);
|
||||||
|
|
||||||
try (XContentParser parser = createParser(script)) {
|
try (XContentParser parser = createParser(script)) {
|
||||||
assertThat(WatcherScript.parse(parser), equalTo(script));
|
assertThat(WatcherScript.parse(parser), equalTo(script));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user