@Test
public void testValidate02() {

    SearchTourFormDateValidator validator = new SearchTourFormDateValidator();
    SearchTourForm criteria = new SearchTourForm();
    BindingResult result = new DirectFieldBindingResult(criteria, "SearchTourcriteria");
    criteria.setDepDay(31);
    criteria.setDepMonth(2);
    criteria.setDepYear(2000);
    // run
    validator.validate(criteria, result);
    // assert
    assertThat(result.hasErrors(), is(true));
    FieldError error = result.getFieldError("depYear");
    if (error != null) {
        assertThat(error.getCode(), is("IncorrectDate.inputdate"));
        assertThat(error.getDefaultMessage(), is(
                "Incorrect date was entered."));
    } else {
        fail("error");
    }
}