use of org.springframework.beans.factory.support.BeanDefinitionOverrideException in project spring-boot by spring-projects.
the class BeanDefinitionOverrideFailureAnalyzerTests method createFailure.
private BeanDefinitionOverrideException createFailure(ApplicationContextInitializer<AnnotationConfigApplicationContext> initializer) {
try {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
context.setAllowBeanDefinitionOverriding(false);
initializer.initialize(context);
context.refresh();
context.close();
return null;
} catch (BeanDefinitionOverrideException ex) {
return ex;
}
}
use of org.springframework.beans.factory.support.BeanDefinitionOverrideException in project spring-boot by spring-projects.
the class BeanDefinitionOverrideFailureAnalyzerTests method performAnalysis.
private FailureAnalysis performAnalysis(Class<?> configuration) {
BeanDefinitionOverrideException failure = createFailure(configuration);
assertThat(failure).isNotNull();
return new BeanDefinitionOverrideFailureAnalyzer().analyze(failure);
}
use of org.springframework.beans.factory.support.BeanDefinitionOverrideException in project spring-boot by spring-projects.
the class BeanDefinitionOverrideFailureAnalyzerTests method createFailure.
private BeanDefinitionOverrideException createFailure(Class<?> configuration) {
try {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
context.setAllowBeanDefinitionOverriding(false);
context.register(configuration);
context.refresh();
context.close();
return null;
} catch (BeanDefinitionOverrideException ex) {
return ex;
}
}
use of org.springframework.beans.factory.support.BeanDefinitionOverrideException in project spring-boot by spring-projects.
the class BeanDefinitionOverrideFailureAnalyzerTests method performAnalysis.
private FailureAnalysis performAnalysis(ApplicationContextInitializer<AnnotationConfigApplicationContext> initializer) {
BeanDefinitionOverrideException failure = createFailure(initializer);
assertThat(failure).isNotNull();
return new BeanDefinitionOverrideFailureAnalyzer().analyze(failure);
}
Aggregations