use of org.springframework.context.annotation.ScannedGenericBeanDefinition in project spring-boot by spring-projects.
the class WebFilterHandlerTests method defaultFilterConfiguration.
@SuppressWarnings("unchecked")
@Test
public void defaultFilterConfiguration() throws IOException {
ScannedGenericBeanDefinition scanned = new ScannedGenericBeanDefinition(new SimpleMetadataReaderFactory().getMetadataReader(DefaultConfigurationFilter.class.getName()));
this.handler.handle(scanned, this.registry);
BeanDefinition filterRegistrationBean = this.registry.getBeanDefinition(DefaultConfigurationFilter.class.getName());
MutablePropertyValues propertyValues = filterRegistrationBean.getPropertyValues();
assertThat(propertyValues.get("asyncSupported")).isEqualTo(false);
assertThat((EnumSet<DispatcherType>) propertyValues.get("dispatcherTypes")).containsExactly(DispatcherType.REQUEST);
assertThat(((Map<String, String>) propertyValues.get("initParameters"))).isEmpty();
assertThat((String[]) propertyValues.get("servletNames")).isEmpty();
assertThat((String[]) propertyValues.get("urlPatterns")).isEmpty();
assertThat(propertyValues.get("name")).isEqualTo(DefaultConfigurationFilter.class.getName());
assertThat(propertyValues.get("filter")).isEqualTo(scanned);
}
use of org.springframework.context.annotation.ScannedGenericBeanDefinition in project spring-boot by spring-projects.
the class WebFilterHandlerTests 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