@Test public void testCheckConditionShouldReturnTrueWhenHeadersContainsJustTheParameter() { Map<String, String> headers = new HashMap<String, String>(); String parameterValue = "aa"; headers.put("a", parameterValue); given(request.getHeaders()).willReturn(headers); given(paramList.getAllParameters()).willReturn(params); params.add(new Parameter("a", parameterValue)); given(operator.checkTarget(parameterValue, parameterValue)).willReturn(true); boolean actual = underTest.checkCondition(request, paramList); assertTrue(actual); }
@Override public boolean checkCondition(final WilmaHttpRequest request, final ParameterList parameterList) { List<Parameter> params = parameterList.getAllParameters(); Iterator<Parameter> iterator = params.iterator(); boolean result = !params.isEmpty(); while (iterator.hasNext() && result) { Parameter parameter = iterator.next(); String parameterValue = parameter.getValue(); result = evaluateParameter(request, parameterValue); } return result; }
AndHeaderChecker implements ConditionChecker { @Override public boolean checkCondition(final WilmaHttpRequest request, final ParameterList parameterList) { List<Parameter> params = parameterList.getAllParameters(); Iterator<Parameter> iterator = params.iterator(); boolean result = !params.isEmpty(); while (iterator.hasNext() && result) { Parameter parameter = iterator.next(); String parameterValue = parameter.getValue(); result = evaluateParameter(request, parameterValue); } return result; } }
AndHeaderChecker implements ConditionChecker { @Override public boolean checkCondition(final WilmaHttpRequest request, final ParameterList parameterList) { List<Parameter> params = parameterList.getAllParameters(); Iterator<Parameter> iterator = params.iterator(); boolean result = !params.isEmpty(); while (iterator.hasNext() && result) { Parameter parameter = iterator.next(); String parameterValue = parameter.getValue(); result = evaluateParameter(request, parameterValue); } return result; } AndHeaderChecker(final ConditionCheckerOperator operator); }
AndHeaderChecker implements ConditionChecker { @Override public boolean checkCondition(final WilmaHttpRequest request, final ParameterList parameterList) { List<Parameter> params = parameterList.getAllParameters(); Iterator<Parameter> iterator = params.iterator(); boolean result = !params.isEmpty(); while (iterator.hasNext() && result) { Parameter parameter = iterator.next(); String parameterValue = parameter.getValue(); result = evaluateParameter(request, parameterValue); } return result; } AndHeaderChecker(final ConditionCheckerOperator operator); @Override boolean checkCondition(final WilmaHttpRequest request, final ParameterList parameterList); }
AndHeaderChecker implements ConditionChecker { @Override public boolean checkCondition(final WilmaHttpRequest request, final ParameterList parameterList) { List<Parameter> params = parameterList.getAllParameters(); Iterator<Parameter> iterator = params.iterator(); boolean result = !params.isEmpty(); while (iterator.hasNext() && result) { Parameter parameter = iterator.next(); String parameterValue = parameter.getValue(); result = evaluateParameter(request, parameterValue); } return result; } AndHeaderChecker(final ConditionCheckerOperator operator); @Override boolean checkCondition(final WilmaHttpRequest request, final ParameterList parameterList);  }