use of org.springframework.core.io.DescriptiveResource in project spring-framework by spring-projects.
the class FailFastProblemReporterTests method testWarn.
@Test
public void testWarn() throws Exception {
Problem problem = new Problem("VGER", new Location(new DescriptiveResource("here")), null, new IllegalArgumentException());
Log log = mock(Log.class);
FailFastProblemReporter reporter = new FailFastProblemReporter();
reporter.setLogger(log);
reporter.warning(problem);
verify(log).warn(any(), isA(IllegalArgumentException.class));
}
use of org.springframework.core.io.DescriptiveResource in project spring-framework by spring-projects.
the class ConfigurationClassPostProcessorTests method postProcessorDoesNotOverrideRegularBeanDefinitionsEvenWithScopedProxy.
@Test
void postProcessorDoesNotOverrideRegularBeanDefinitionsEvenWithScopedProxy() {
RootBeanDefinition rbd = new RootBeanDefinition(TestBean.class);
rbd.setResource(new DescriptiveResource("XML or something"));
BeanDefinitionHolder proxied = ScopedProxyUtils.createScopedProxy(new BeanDefinitionHolder(rbd, "bar"), beanFactory, true);
beanFactory.registerBeanDefinition("bar", proxied.getBeanDefinition());
beanFactory.registerBeanDefinition("config", new RootBeanDefinition(SingletonBeanConfig.class));
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.postProcessBeanFactory(beanFactory);
beanFactory.getBean("foo", Foo.class);
beanFactory.getBean("bar", TestBean.class);
}
use of org.springframework.core.io.DescriptiveResource in project spring-framework by spring-projects.
the class ConfigurationClassPostProcessorTests method postProcessorDoesNotOverrideRegularBeanDefinitions.
@Test
void postProcessorDoesNotOverrideRegularBeanDefinitions() {
RootBeanDefinition rbd = new RootBeanDefinition(TestBean.class);
rbd.setResource(new DescriptiveResource("XML or something"));
beanFactory.registerBeanDefinition("bar", rbd);
beanFactory.registerBeanDefinition("config", new RootBeanDefinition(SingletonBeanConfig.class));
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.postProcessBeanFactory(beanFactory);
beanFactory.getBean("foo", Foo.class);
beanFactory.getBean("bar", TestBean.class);
}
Aggregations