All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ocs.dynamo.test.BaseIntegrationTestConfig Maven / Gradle / Ivy

package com.ocs.dynamo.test;

import javax.validation.ValidatorFactory;

import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;

@TestConfiguration
@EnableTransactionManagement
public class BaseIntegrationTestConfig {

    @Bean
    public ValidatorFactory validatorFactory() {
        LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean();
        validator.setValidationMessageSource(messageSource());
        return validator;
    }

    @Bean
    public ReloadableResourceBundleMessageSource messageSource() {
        ReloadableResourceBundleMessageSource source = new ReloadableResourceBundleMessageSource();
        source.setBasenames("classpath:/META-INF/entitymodel", "classpath:/ocscommon", "classpath:/menu");
        source.setDefaultEncoding("UTF-8");
        source.setFallbackToSystemLocale(false);
        return source;
    }
    
    

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy