Use Date instead of System in groovy script... its absurd to expect scripts can use System
Original commit: elastic/x-pack-elasticsearch@9b32e621c7
This commit is contained in:
parent
ad36c3f0dd
commit
f3fd72c9d0
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue