ScriptFilterUtil { public static boolean filterOnField(String filterField, ScriptFilterCondition condition, ScriptStep currentStep) { if (filterField == null) return false; if (condition.getCondition().equalsIgnoreCase("Contains")) { return filterField.contains(condition.getValue()); } else if (condition.getCondition().equalsIgnoreCase("Matches")) { return filterField.matches(condition.getValue()); } else if (condition.getCondition().equalsIgnoreCase("Does not contain")) { return !filterField.contains(condition.getValue()); } else if (condition.getCondition().equalsIgnoreCase("Starts with")) { return filterField.startsWith(condition.getValue()); } else if (condition.getCondition().equalsIgnoreCase("Exist")) { return !filterField.isEmpty(); } else if (condition.getCondition().equalsIgnoreCase("Does not exist")) { return filterField.isEmpty(); } return false; }  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 testFilterOnField_1() throws Exception { String filterField = null; ScriptFilterCondition condition = new ScriptFilterCondition(); ScriptStep currentStep = new ScriptStep(); boolean result = ScriptFilterUtil.filterOnField(filterField, condition, currentStep); assertEquals(false, result); }
@Test public void testFilterOnField_2() throws Exception { String filterField = ""; ScriptFilterCondition condition = new ScriptFilterCondition(); condition.setCondition(""); condition.setValue(""); ScriptStep currentStep = new ScriptStep(); boolean result = ScriptFilterUtil.filterOnField(filterField, condition, currentStep); assertEquals(false, result); }
@Test public void testFilterOnField_3() throws Exception { String filterField = ""; ScriptFilterCondition condition = new ScriptFilterCondition(); condition.setCondition(""); condition.setValue(""); ScriptStep currentStep = new ScriptStep(); boolean result = ScriptFilterUtil.filterOnField(filterField, condition, currentStep); assertEquals(false, result); }
@Test public void testFilterOnField_4() throws Exception { String filterField = ""; ScriptFilterCondition condition = new ScriptFilterCondition(); condition.setCondition(""); condition.setValue(""); ScriptStep currentStep = new ScriptStep(); boolean result = ScriptFilterUtil.filterOnField(filterField, condition, currentStep); assertEquals(false, result); }
@Test public void testFilterOnField_5() throws Exception { String filterField = ""; ScriptFilterCondition condition = new ScriptFilterCondition(); condition.setCondition(""); condition.setValue(""); ScriptStep currentStep = new ScriptStep(); boolean result = ScriptFilterUtil.filterOnField(filterField, condition, currentStep); assertEquals(false, result); }
@Test public void testFilterOnField_6() throws Exception { String filterField = ""; ScriptFilterCondition condition = new ScriptFilterCondition(); condition.setCondition(""); ScriptStep currentStep = new ScriptStep(); boolean result = ScriptFilterUtil.filterOnField(filterField, condition, currentStep); assertEquals(false, result); }
@Test public void testFilterOnField_7() throws Exception { String filterField = ""; ScriptFilterCondition condition = new ScriptFilterCondition(); condition.setCondition(""); ScriptStep currentStep = new ScriptStep(); boolean result = ScriptFilterUtil.filterOnField(filterField, condition, currentStep); assertEquals(false, result); }
@Test public void testFilterOnField_8() throws Exception { String filterField = ""; ScriptFilterCondition condition = new ScriptFilterCondition(); condition.setCondition(""); ScriptStep currentStep = new ScriptStep(); boolean result = ScriptFilterUtil.filterOnField(filterField, condition, currentStep); assertEquals(false, result); }
@Test public void testFilterOnField_9() throws Exception { String filterField = ""; ScriptFilterCondition condition = new ScriptFilterCondition(); condition.setCondition(""); ScriptStep currentStep = new ScriptStep(); boolean result = ScriptFilterUtil.filterOnField(filterField, condition, currentStep); assertEquals(false, result); }
@Test public void testFilterOnField_10() throws Exception { String filterField = ""; ScriptFilterCondition condition = new ScriptFilterCondition(); condition.setCondition(""); ScriptStep currentStep = new ScriptStep(); boolean result = ScriptFilterUtil.filterOnField(filterField, condition, currentStep); assertEquals(false, result); }
@Test public void testFilterOnField_11() throws Exception { String filterField = ""; ScriptFilterCondition condition = new ScriptFilterCondition(); condition.setCondition(""); condition.setValue(""); ScriptStep currentStep = new ScriptStep(); boolean result = ScriptFilterUtil.filterOnField(filterField, condition, currentStep); assertEquals(false, result); }
@Test public void testFilterOnField_12() throws Exception { String filterField = ""; ScriptFilterCondition condition = new ScriptFilterCondition(); condition.setCondition(""); condition.setValue(""); ScriptStep currentStep = new ScriptStep(); boolean result = ScriptFilterUtil.filterOnField(filterField, condition, currentStep); assertEquals(false, result); }
@Test public void testFilterOnField_13() throws Exception { String filterField = ""; ScriptFilterCondition condition = new ScriptFilterCondition(); condition.setCondition(""); condition.setValue(""); ScriptStep currentStep = new ScriptStep(); boolean result = ScriptFilterUtil.filterOnField(filterField, condition, currentStep); assertEquals(false, result); }
@Test public void testFilterOnField_14() throws Exception { String filterField = ""; ScriptFilterCondition condition = new ScriptFilterCondition(); condition.setCondition(""); condition.setValue(""); ScriptStep currentStep = new ScriptStep(); boolean result = ScriptFilterUtil.filterOnField(filterField, condition, currentStep); assertEquals(false, result); }