ContainsIgnoreCaseValidationMatcher implements ValidationMatcher { public void validate(String fieldName, String value, List<String> controlParameters, TestContext context) throws ValidationException { String control = controlParameters.get(0); if (!value.toLowerCase().contains(control.toLowerCase())) { throw new ValidationException(this.getClass().getSimpleName() + " failed for field '" + fieldName + "'. Received value is '" + value + "', control value is '" + control + "'."); } }  void validate(String fieldName, String value, List<String> controlParameters, TestContext context);  }
@Test public void testValidateSuccess() { matcher.validate("field", "This is a test", Arrays.asList("is a"), context); matcher.validate("field", "This is a test", Arrays.asList("this"), context); matcher.validate("field", "This is a test", Arrays.asList("TEST"), context); matcher.validate("field", "This is a 0815test", Arrays.asList("0815"), context); matcher.validate("field", "This is a test", Arrays.asList(" "), context); matcher.validate("field", "This is a test", Arrays.asList(" IS A "), context); }