@Test
public void testValidate02() {

    CustomerBirthdayValidator validator = new CustomerBirthdayValidator();
    CustomerForm customer = new CustomerForm();
    customer.setCustomerBirthYear(2011);
    customer.setCustomerBirthMonth(02);
    customer.setCustomerBirthDay(29);
    BindingResult result = new DirectFieldBindingResult(customer, "CustomerForm");
    // run
    validator.validate(customer, result);
    // assert
    assertThat(result.hasErrors(), is(true));
    FieldError error = result.getFieldError("customerBirthYear");
    if (error != null) {
        assertThat(error.getCode(), is("IncorrectDate.customerBirth"));
        assertThat(error.getDefaultMessage(), is(
                "Incorrect date was entered."));
    } else {
        fail("error");
    }
}