use of org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry in project spring-framework by spring-projects.
the class AnnotationBeanNameGeneratorTests method generateBeanNameWithNamedComponentWhereTheNameIsBlank.
@Test
public void generateBeanNameWithNamedComponentWhereTheNameIsBlank() {
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComponentWithBlankName.class);
String beanName = this.beanNameGenerator.generateBeanName(bd, registry);
assertNotNull("The generated beanName must *never* be null.", beanName);
assertTrue("The generated beanName must *never* be blank.", StringUtils.hasText(beanName));
String expectedGeneratedBeanName = this.beanNameGenerator.buildDefaultBeanName(bd);
assertEquals(expectedGeneratedBeanName, beanName);
}
use of org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry in project spring-framework by spring-projects.
the class AnnotationBeanNameGeneratorTests method generateBeanNameFromComposedControllerAnnotationWithStringValue.
/**
* @since 4.0.1
* @see https://jira.spring.io/browse/SPR-11360
*/
@Test
public void generateBeanNameFromComposedControllerAnnotationWithStringValue() {
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComposedControllerAnnotationWithStringValue.class);
String beanName = this.beanNameGenerator.generateBeanName(bd, registry);
assertEquals("restController", beanName);
}
use of org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry in project spring-security by spring-projects.
the class MessageSecurityPostProcessorTest method handlesBeansWithoutClass.
@Test
public void handlesBeansWithoutClass() {
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
registry.registerBeanDefinition("beanWithoutClass", new GenericBeanDefinition());
postProcessor.postProcessBeanDefinitionRegistry(registry);
}
use of org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry in project spring-framework by spring-projects.
the class XmlBeanDefinitionReaderTests method setParserClassToNull.
@Test(expected = IllegalArgumentException.class)
public void setParserClassToNull() {
SimpleBeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
new XmlBeanDefinitionReader(registry).setDocumentReaderClass(null);
}
use of org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry in project spring-framework by spring-projects.
the class XmlBeanDefinitionReaderTests method withWildcardImport.
@Test
public void withWildcardImport() {
SimpleBeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
Resource resource = new ClassPathResource("importPattern.xml", getClass());
new XmlBeanDefinitionReader(registry).loadBeanDefinitions(resource);
testBeanDefinitions(registry);
}
Aggregations