ExpressionFilterScriptFactory implements FilterScript.Factory { @Override public FilterScript.LeafFactory newFactory(Map<String, Object> params, SearchLookup lookup) { return new ExpressionFilterScriptLeafFactory(expression, params, lookup); } ExpressionFilterScriptFactory(Expression expression); @Override boolean isResultDeterministic(); @Override FilterScript.LeafFactory newFactory(Map<String, Object> params, SearchLookup lookup);  }
@Test void can_initialize_expression_filter_script() throws IOException { when(searchLookup.getLeafSearchLookup(leafReaderContext)).thenReturn(leafSearchLookup); FilterScript.LeafFactory leafFactory = factory.newFactory(params, searchLookup); FilterScript actualFilterScript = leafFactory.newInstance(leafReaderContext); assertEquals( new ExpressionFilterScript(expression, searchLookup, leafReaderContext, params), actualFilterScript ); }