Person person = new Person();
person.setLifeCycleBean(lifeCycleBean);
person.setFirstName("FN");
Validator validator = (Validator) appCtx.getBean("testCustomFunctionsFromApplicationContext");
BindException errors = new BindException(person, "person");
validator.validate(person, errors);
assertTrue(lifeCycleBean.isApplicationContextSet());
assertTrue(lifeCycleBean.isApplicationEventPublisher());
assertTrue(lifeCycleBean.isBeanFactorySet());
assertTrue(lifeCycleBean.isMessageSourceSet());
assertTrue(lifeCycleBean.isResourceLoaderSet());
assertTrue(errors.hasFieldErrors("firstName"));
}