From f3fd72c9d02a59231c6df3a069018855f4e1d8b7 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Sat, 5 Dec 2015 22:13:50 -0500 Subject: [PATCH] Use Date instead of System in groovy script... its absurd to expect scripts can use System Original commit: elastic/x-pack-elasticsearch@9b32e621c73e283d3b5ccc30107440f8325b9837 --- .../org/elasticsearch/messy/tests/ScriptConditionTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ScriptConditionTests.java b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ScriptConditionTests.java index 6042f70eecf..9c0fab3d307 100644 --- a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ScriptConditionTests.java +++ b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ScriptConditionTests.java @@ -187,7 +187,7 @@ public class ScriptConditionTests extends ESTestCase { public void testScriptConditionAccessCtx() throws Exception { ScriptServiceProxy scriptService = getScriptServiceProxy(tp); - ExecutableScriptCondition condition = new ExecutableScriptCondition(new ScriptCondition(Script.inline("ctx.trigger.scheduled_time.getMillis() < System.currentTimeMillis() ").build()), logger, scriptService); + ExecutableScriptCondition condition = new ExecutableScriptCondition(new ScriptCondition(Script.inline("ctx.trigger.scheduled_time.getMillis() < new Date().time ").build()), logger, scriptService); SearchResponse response = new SearchResponse(InternalSearchResponse.empty(), "", 3, 3, 500l, new ShardSearchFailure[0]); WatchExecutionContext ctx = mockExecutionContext("_name", new DateTime(DateTimeZone.UTC), new Payload.XContent(response)); Thread.sleep(10);