Search in sources :

Example 31 with LocalValidatorFactoryBean

use of org.springframework.validation.beanvalidation.LocalValidatorFactoryBean in project nixmash-blog by mintster.

the class WebConfig method validator.

@Bean(name = "validator")
public LocalValidatorFactoryBean validator() {
    LocalValidatorFactoryBean bean = new LocalValidatorFactoryBean();
    bean.setValidationMessageSource(messageSource());
    return bean;
}
Also used : LocalValidatorFactoryBean(org.springframework.validation.beanvalidation.LocalValidatorFactoryBean) Bean(org.springframework.context.annotation.Bean) LocalValidatorFactoryBean(org.springframework.validation.beanvalidation.LocalValidatorFactoryBean)

Example 32 with LocalValidatorFactoryBean

use of org.springframework.validation.beanvalidation.LocalValidatorFactoryBean in project formation-jenkins by x2i-tvercruysse.

the class ValidatorTests method createValidator.

private Validator createValidator() {
    LocalValidatorFactoryBean localValidatorFactoryBean = new LocalValidatorFactoryBean();
    localValidatorFactoryBean.afterPropertiesSet();
    return localValidatorFactoryBean;
}
Also used : LocalValidatorFactoryBean(org.springframework.validation.beanvalidation.LocalValidatorFactoryBean)

Aggregations

LocalValidatorFactoryBean (org.springframework.validation.beanvalidation.LocalValidatorFactoryBean)32 Bean (org.springframework.context.annotation.Bean)12 Test (org.junit.jupiter.api.Test)6 ApplicationContext (org.springframework.context.ApplicationContext)5 ConfigurableWebBindingInitializer (org.springframework.web.bind.support.ConfigurableWebBindingInitializer)4 Locale (java.util.Locale)2 Before (org.junit.Before)2 Test (org.junit.Test)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 MifosBeanValidator (org.mifos.platform.validation.MifosBeanValidator)2 StubValidationContext (org.mifos.ui.validation.StubValidationContext)2 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)2 MessageInterpolatorFactory (org.springframework.boot.validation.MessageInterpolatorFactory)2 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)2 Role (org.springframework.context.annotation.Role)2 StaticMessageSource (org.springframework.context.support.StaticMessageSource)2 FormattingConversionService (org.springframework.format.support.FormattingConversionService)2 Validator (org.springframework.validation.Validator)2 RequestMappingHandlerAdapter (org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter)2 FAIL_ON_UNKNOWN_PROPERTIES (com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)1