ScriptFilterUtil { public static void applyFiltersToScript(Collection<ScriptFilter> filters, Script script) { ExternalScriptDao externalScriptDao = new ExternalScriptDao(); List<ScriptFilter> internalFilters = new ArrayList<ScriptFilter>(); List<ScriptFilter> externalFilters = new ArrayList<ScriptFilter>(); for (ScriptFilter filter : filters) { if (filter.getFilterType() == ScriptFilterType.EXTERNAL) { externalFilters.add(filter); } else { internalFilters.add(filter); } } for (ScriptFilter filter : internalFilters) { AWSXRay.createSubsegment("Apply.InternalFilter." + filter.getName(), (subsegment) -> { applyFilter(filter, script.getScriptSteps()); }); } if (!externalFilters.isEmpty()) { LoggingOutputLogger outputLogger = new LoggingOutputLogger(); ScriptTO scriptTo = ScriptServiceUtil.scriptToTransferObject(script); ScriptRunner runner = new ScriptRunner(); Map<String, Object> map = new HashMap<String, Object>(); map.put("script", scriptTo); for (ScriptFilter filter : externalFilters) { ExternalScript externalScript = externalScriptDao.findById(filter.getExternalScriptId()); logger.info("Running external Script: " + externalScript); if (externalScript != null) { Subsegment subsegment = AWSXRay.beginSubsegment("Apply.ExternalFilter." + externalScript.getName()); try { runner.runScript(externalScript.getName(), externalScript.getScript(), externalScript.getEngine(), map, outputLogger); } catch (ScriptException e) { logger.error("Error Running Script: " + e); subsegment.addException(e); throw new RuntimeException(e); } finally { AWSXRay.endSubsegment(); } } } script.getScriptSteps().clear(); for (ScriptStepTO stepTo : scriptTo.getSteps()) { script.getScriptSteps().add(ScriptServiceUtil.transferObjectToScriptStep(stepTo)); } } }  static List<ScriptStep> applyFilters(Collection<ScriptFilter> filters, List<ScriptStep> steps); static void applyFilters(List<Integer> filterIds, Script script); static void applyFiltersToScript(Collection<ScriptFilter> filters, Script script); static void applyFilter(ScriptFilter filter, List<ScriptStep> steps); static boolean filterOnField(String filterField, ScriptFilterCondition condition,
            ScriptStep currentStep); static boolean filterOnFieldSets(Set<RequestData> fields, ScriptFilterCondition condition,
            ScriptStep currentStep, List<ScriptStep> steps); static ScriptStep doAction(Set<ScriptFilterAction> actions, ScriptStep step);  }
@Test public void testApplyFiltersToScript_1() throws Exception { Collection<ScriptFilter> filters = new LinkedList(); Script script = new Script(); script.setSteps(new LinkedList()); ScriptFilterUtil.applyFiltersToScript(filters, script); }
@Test public void testApplyFiltersToScript_2() throws Exception { Collection<ScriptFilter> filters = new LinkedList(); Script script = new Script(); script.setSteps(new LinkedList()); ScriptFilterUtil.applyFiltersToScript(filters, script); }
@Test public void testApplyFiltersToScript_3() throws Exception { Collection<ScriptFilter> filters = new LinkedList(); Script script = new Script(); script.setSteps(new LinkedList()); ScriptFilterUtil.applyFiltersToScript(filters, script); }
@Test public void testApplyFiltersToScript_4() throws Exception { Collection<ScriptFilter> filters = new LinkedList(); Script script = new Script(); script.setSteps(new LinkedList()); ScriptFilterUtil.applyFiltersToScript(filters, script); }
@Test public void testApplyFiltersToScript_5() throws Exception { Collection<ScriptFilter> filters = new LinkedList(); Script script = new Script(); script.setSteps(new LinkedList()); ScriptFilterUtil.applyFiltersToScript(filters, script); }
@Test public void testApplyFiltersToScript_6() throws Exception { Collection<ScriptFilter> filters = new LinkedList(); Script script = new Script(); script.setSteps(new LinkedList()); ScriptFilterUtil.applyFiltersToScript(filters, script); }
@Test public void testApplyFiltersToScript_7() throws Exception { Collection<ScriptFilter> filters = new LinkedList(); Script script = new Script(); script.setSteps(new LinkedList()); ScriptFilterUtil.applyFiltersToScript(filters, script); }
@Test public void testApplyFiltersToScript_8() throws Exception { Collection<ScriptFilter> filters = new LinkedList(); Script script = new Script(); script.setSteps(new LinkedList()); ScriptFilterUtil.applyFiltersToScript(filters, script); }
@Test public void testApplyFiltersToScript_9() throws Exception { Collection<ScriptFilter> filters = new LinkedList(); Script script = new Script(); script.setSteps(new LinkedList()); ScriptFilterUtil.applyFiltersToScript(filters, script); }
@Test public void testApplyFiltersToScript_10() throws Exception { Collection<ScriptFilter> filters = new LinkedList(); Script script = new Script(); script.setSteps(new LinkedList()); ScriptFilterUtil.applyFiltersToScript(filters, script); }
@Test public void testApplyFiltersToScript_11() throws Exception { Collection<ScriptFilter> filters = new LinkedList(); Script script = new Script(); ScriptFilterUtil.applyFiltersToScript(filters, script); }
@Test public void testApplyFiltersToScript_12() throws Exception { Collection<ScriptFilter> filters = new LinkedList(); Script script = new Script(); ScriptFilterUtil.applyFiltersToScript(filters, script); }
@Test public void testApplyFiltersToScript_13() throws Exception { Collection<ScriptFilter> filters = new LinkedList(); Script script = new Script(); ScriptFilterUtil.applyFiltersToScript(filters, script); }
@Test public void testApplyFiltersToScript_14() throws Exception { Collection<ScriptFilter> filters = new LinkedList(); Script script = new Script(); script.setSteps(new LinkedList()); ScriptFilterUtil.applyFiltersToScript(filters, script); }
@Test public void testApplyFiltersToScript_15() throws Exception { Collection<ScriptFilter> filters = new LinkedList(); Script script = new Script(); script.setSteps(new LinkedList()); ScriptFilterUtil.applyFiltersToScript(filters, script); }
@Test public void testApplyFiltersToScript_16() throws Exception { Collection<ScriptFilter> filters = new LinkedList(); Script script = new Script(); script.setSteps(new LinkedList()); ScriptFilterUtil.applyFiltersToScript(filters, script); }