@Test public void testCheckConditionWhenNoConditionIsFulfilledShouldReturnFalse() { parameterList.addParameter(new Parameter(CONTENT_TYPE_HEADER, XML_CONTENT)); parameterList.addParameter(new Parameter(CONTENT_ENCODING_HEADER, GZIP_CONTENT)); given(request.getHeader(CONTENT_TYPE_HEADER)).willReturn("something else"); given(request.getHeader(CONTENT_ENCODING_HEADER)).willReturn("something else"); boolean actual = underTest.checkCondition(request, parameterList); assertEquals(actual, false); }
@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 header = request.getHeader(parameter.getName()); if (header != null) { result = result && header.contains(parameter.getValue()); } else { result = false; } } return result; }
HeaderParameterChecker 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 header = request.getHeader(parameter.getName()); if (header != null) { result = result && header.contains(parameter.getValue()); } else { result = false; } } return result; } }
HeaderParameterChecker 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 header = request.getHeader(parameter.getName()); if (header != null) { result = result && header.contains(parameter.getValue()); } else { result = false; } } return result; }  }
HeaderParameterChecker 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 header = request.getHeader(parameter.getName()); if (header != null) { result = result && header.contains(parameter.getValue()); } else { result = false; } } return result; }  @Override boolean checkCondition(final WilmaHttpRequest request, final ParameterList parameterList); }
HeaderParameterChecker 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 header = request.getHeader(parameter.getName()); if (header != null) { result = result && header.contains(parameter.getValue()); } else { result = false; } } return result; }  @Override boolean checkCondition(final WilmaHttpRequest request, final ParameterList parameterList);  }