@Test public void testEvaluateWhenConditionIsOrShouldReturnTrue() { List<Condition> conditionList = new ArrayList<>(); conditionList.add(simpleCondition); conditionList.add(simpleCondition); compositeCondition = new CompositeCondition(ConditionType.OR, conditionList); given(conditionChecker.checkCondition(request, parameterMap)).willReturn(true); boolean actual = underTest.evaluate(compositeCondition, request); assertEquals(actual, true); }
public boolean evaluate(final Condition condition, final WilmaHttpRequest request) { boolean fulfilled = false; if (condition instanceof CompositeCondition) { if (condition.getConditionType() == ConditionType.AND) { fulfilled = evaluateAndCondition(condition, request); } else if (condition.getConditionType() == ConditionType.OR) { fulfilled = evaluateOrCondition(condition, request); } else if (condition.getConditionType() == ConditionType.NOT) { fulfilled = evaluateNotCondition(condition, request); } } else if (condition instanceof SimpleCondition) { SimpleCondition simpleCondition = (SimpleCondition) condition; ConditionChecker conditionChecker = simpleCondition.getConditionChecker(); boolean negate = simpleCondition.isNegate(); fulfilled = !negate && conditionChecker.checkCondition(request, simpleCondition.getParameters()); } return fulfilled; }
ConditionEvaluator { public boolean evaluate(final Condition condition, final WilmaHttpRequest request) { boolean fulfilled = false; if (condition instanceof CompositeCondition) { if (condition.getConditionType() == ConditionType.AND) { fulfilled = evaluateAndCondition(condition, request); } else if (condition.getConditionType() == ConditionType.OR) { fulfilled = evaluateOrCondition(condition, request); } else if (condition.getConditionType() == ConditionType.NOT) { fulfilled = evaluateNotCondition(condition, request); } } else if (condition instanceof SimpleCondition) { SimpleCondition simpleCondition = (SimpleCondition) condition; ConditionChecker conditionChecker = simpleCondition.getConditionChecker(); boolean negate = simpleCondition.isNegate(); fulfilled = !negate && conditionChecker.checkCondition(request, simpleCondition.getParameters()); } return fulfilled; } }
ConditionEvaluator { public boolean evaluate(final Condition condition, final WilmaHttpRequest request) { boolean fulfilled = false; if (condition instanceof CompositeCondition) { if (condition.getConditionType() == ConditionType.AND) { fulfilled = evaluateAndCondition(condition, request); } else if (condition.getConditionType() == ConditionType.OR) { fulfilled = evaluateOrCondition(condition, request); } else if (condition.getConditionType() == ConditionType.NOT) { fulfilled = evaluateNotCondition(condition, request); } } else if (condition instanceof SimpleCondition) { SimpleCondition simpleCondition = (SimpleCondition) condition; ConditionChecker conditionChecker = simpleCondition.getConditionChecker(); boolean negate = simpleCondition.isNegate(); fulfilled = !negate && conditionChecker.checkCondition(request, simpleCondition.getParameters()); } return fulfilled; }  }
ConditionEvaluator { public boolean evaluate(final Condition condition, final WilmaHttpRequest request) { boolean fulfilled = false; if (condition instanceof CompositeCondition) { if (condition.getConditionType() == ConditionType.AND) { fulfilled = evaluateAndCondition(condition, request); } else if (condition.getConditionType() == ConditionType.OR) { fulfilled = evaluateOrCondition(condition, request); } else if (condition.getConditionType() == ConditionType.NOT) { fulfilled = evaluateNotCondition(condition, request); } } else if (condition instanceof SimpleCondition) { SimpleCondition simpleCondition = (SimpleCondition) condition; ConditionChecker conditionChecker = simpleCondition.getConditionChecker(); boolean negate = simpleCondition.isNegate(); fulfilled = !negate && conditionChecker.checkCondition(request, simpleCondition.getParameters()); } return fulfilled; }  boolean evaluate(final Condition condition, final WilmaHttpRequest request); }
ConditionEvaluator { public boolean evaluate(final Condition condition, final WilmaHttpRequest request) { boolean fulfilled = false; if (condition instanceof CompositeCondition) { if (condition.getConditionType() == ConditionType.AND) { fulfilled = evaluateAndCondition(condition, request); } else if (condition.getConditionType() == ConditionType.OR) { fulfilled = evaluateOrCondition(condition, request); } else if (condition.getConditionType() == ConditionType.NOT) { fulfilled = evaluateNotCondition(condition, request); } } else if (condition instanceof SimpleCondition) { SimpleCondition simpleCondition = (SimpleCondition) condition; ConditionChecker conditionChecker = simpleCondition.getConditionChecker(); boolean negate = simpleCondition.isNegate(); fulfilled = !negate && conditionChecker.checkCondition(request, simpleCondition.getParameters()); } return fulfilled; }  boolean evaluate(final Condition condition, final WilmaHttpRequest request);  }