use of org.springframework.beans.MutablePropertyValues in project spring-boot by spring-projects.
the class WebFilterHandlerTests method urlPatterns.
@Test
public void urlPatterns() throws IOException {
BeanDefinition filterRegistrationBean = getBeanDefinition(UrlPatternsFilter.class);
MutablePropertyValues propertyValues = filterRegistrationBean.getPropertyValues();
assertThat((String[]) propertyValues.get("urlPatterns")).contains("alpha", "bravo");
}
use of org.springframework.beans.MutablePropertyValues 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.beans.MutablePropertyValues 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.beans.MutablePropertyValues in project spring-boot by spring-projects.
the class WebServletHandlerTests method urlMappings.
@Test
public void urlMappings() throws IOException {
BeanDefinition servletRegistrationBean = getBeanDefinition(UrlPatternsServlet.class);
MutablePropertyValues propertyValues = servletRegistrationBean.getPropertyValues();
assertThat((String[]) propertyValues.get("urlMappings")).contains("alpha", "bravo");
}
use of org.springframework.beans.MutablePropertyValues in project spring-boot by spring-projects.
the class WebServletHandlerTests method asyncSupported.
@Test
public void asyncSupported() throws IOException {
BeanDefinition servletRegistrationBean = getBeanDefinition(AsyncSupportedServlet.class);
MutablePropertyValues propertyValues = servletRegistrationBean.getPropertyValues();
assertThat(propertyValues.get("asyncSupported")).isEqualTo(true);
}
Aggregations