### Question:
OrBodyChecker implements ConditionChecker { @Override public boolean checkCondition(final WilmaHttpRequest request, final ParameterList parameterList) { List<Parameter> params = parameterList.getAllParameters(); Iterator<Parameter> iterator = params.iterator(); boolean result = false; if (!params.isEmpty()) { while (iterator.hasNext() && !result) { result = checkInRequestHeaders(request, iterator.next()); } } return result; } OrBodyChecker(final ConditionCheckerOperator operator); @Override boolean checkCondition(final WilmaHttpRequest request, final ParameterList parameterList);  }### Answer:
@Test public void testCheckConditionShouldReturnFalseWhenParamsIsEmpty() { given(paramList.getAllParameters()).willReturn(params); boolean actual = underTest.checkCondition(request, paramList); assertFalse(actual); }
@Test public void testCheckConditionShouldReturnFalseWhenOneParamIsEmptyString() { given(paramList.getAllParameters()).willReturn(params); params.add(new Parameter("", "")); boolean actual = underTest.checkCondition(request, paramList); assertFalse(actual); }
@Test public void testCheckConditionShouldReturnFalseWhenBodyDoesNotContainParam() { given(request.getBody()).willReturn("b"); given(paramList.getAllParameters()).willReturn(params); params.add(new Parameter("", "aa")); boolean actual = underTest.checkCondition(request, paramList); assertFalse(actual); }
@Test public void testCheckConditionShouldReturnTrueWhenBodyContainsParam() { given(request.getBody()).willReturn("baaacccacacacacaaasdfsfasfasdfafasdf"); given(paramList.getAllParameters()).willReturn(params); given(operator.checkTarget(anyString(), anyString())).willReturn(true); params.add(new Parameter("", "aa")); boolean actual = underTest.checkCondition(request, paramList); Assert.assertTrue(actual); }
@Test public void testCheckConditionShouldReturnTrueWhenBodyContainsOneOfTheParams() { given(request.getBody()).willReturn("baaacccacacacacaaasdfsfasfasdfafasdf"); given(paramList.getAllParameters()).willReturn(params); given(operator.checkTarget(anyString(), anyString())).willReturn(true); params.add(new Parameter("", "aa")); params.add(new Parameter("", "b")); params.add(new Parameter("", "cc")); boolean actual = underTest.checkCondition(request, paramList); Assert.assertTrue(actual); }