int age = 30;
request.addParameter("name", name);
request.addParameter("age", "" + age);
String emptyString = "";
request.addParameter("date", emptyString);
ModelAndView mav = tc.handleRenderRequest(request, response);
TestBean command = (TestBean)mav.getModel().get(tc.getCommandName());
assertEquals(name, command.getName());
assertEquals(age, command.getAge());
BindException errors = (BindException)mav.getModel().get(ERRORS_KEY);
assertEquals("There should be 1 error", 1, errors.getErrorCount());
assertNotNull(errors.getFieldError("date"));
assertEquals("typeMismatch", errors.getFieldError("date").getCode());
assertEquals(emptyString, errors.getFieldError("date").getRejectedValue());
}