use of org.springframework.context.annotation.ScannedGenericBeanDefinition in project spring-boot by spring-projects.
the class WebFilterHandlerTests method filterWithCustomName.
@Test
public void filterWithCustomName() throws IOException {
ScannedGenericBeanDefinition scanned = new ScannedGenericBeanDefinition(new SimpleMetadataReaderFactory().getMetadataReader(CustomNameFilter.class.getName()));
this.handler.handle(scanned, this.registry);
BeanDefinition filterRegistrationBean = this.registry.getBeanDefinition("custom");
MutablePropertyValues propertyValues = filterRegistrationBean.getPropertyValues();
assertThat(propertyValues.get("name")).isEqualTo("custom");
}
use of org.springframework.context.annotation.ScannedGenericBeanDefinition in project spring-boot by spring-projects.
the class WebListenerHandlerTests method listener.
@Test
public void listener() throws IOException {
ScannedGenericBeanDefinition scanned = new ScannedGenericBeanDefinition(new SimpleMetadataReaderFactory().getMetadataReader(TestListener.class.getName()));
this.handler.handle(scanned, this.registry);
this.registry.getBeanDefinition(TestListener.class.getName());
}
use of org.springframework.context.annotation.ScannedGenericBeanDefinition in project spring-boot by spring-projects.
the class WebServletHandlerTests method defaultServletConfiguration.
@SuppressWarnings("unchecked")
@Test
public void defaultServletConfiguration() throws IOException {
ScannedGenericBeanDefinition scanned = new ScannedGenericBeanDefinition(new SimpleMetadataReaderFactory().getMetadataReader(DefaultConfigurationServlet.class.getName()));
this.handler.handle(scanned, this.registry);
BeanDefinition servletRegistrationBean = this.registry.getBeanDefinition(DefaultConfigurationServlet.class.getName());
MutablePropertyValues propertyValues = servletRegistrationBean.getPropertyValues();
assertThat(propertyValues.get("asyncSupported")).isEqualTo(false);
assertThat(((Map<String, String>) propertyValues.get("initParameters"))).isEmpty();
assertThat((Integer) propertyValues.get("loadOnStartup")).isEqualTo(-1);
assertThat(propertyValues.get("name")).isEqualTo(DefaultConfigurationServlet.class.getName());
assertThat((String[]) propertyValues.get("urlMappings")).isEmpty();
assertThat(propertyValues.get("servlet")).isEqualTo(scanned);
}
use of org.springframework.context.annotation.ScannedGenericBeanDefinition in project spring-boot by spring-projects.
the class WebServletHandlerTests method servletWithCustomName.
@Test
public void servletWithCustomName() throws IOException {
ScannedGenericBeanDefinition scanned = new ScannedGenericBeanDefinition(new SimpleMetadataReaderFactory().getMetadataReader(CustomNameServlet.class.getName()));
this.handler.handle(scanned, this.registry);
BeanDefinition servletRegistrationBean = this.registry.getBeanDefinition("custom");
MutablePropertyValues propertyValues = servletRegistrationBean.getPropertyValues();
assertThat(propertyValues.get("name")).isEqualTo("custom");
}
use of org.springframework.context.annotation.ScannedGenericBeanDefinition in project spring-boot by spring-projects.
the class WebServletHandlerTests method getBeanDefinition.
BeanDefinition getBeanDefinition(Class<?> filterClass) throws IOException {
ScannedGenericBeanDefinition scanned = new ScannedGenericBeanDefinition(new SimpleMetadataReaderFactory().getMetadataReader(filterClass.getName()));
this.handler.handle(scanned, this.registry);
return this.registry.getBeanDefinition(filterClass.getName());
}
Aggregations