use of org.springframework.web.multipart.support.StandardServletMultipartResolver in project spring-boot by spring-projects.
the class MultipartAutoConfiguration method multipartResolver.
@Bean(name = DispatcherServlet.MULTIPART_RESOLVER_BEAN_NAME)
@ConditionalOnMissingBean(MultipartResolver.class)
public StandardServletMultipartResolver multipartResolver() {
StandardServletMultipartResolver multipartResolver = new StandardServletMultipartResolver();
multipartResolver.setResolveLazily(this.multipartProperties.isResolveLazily());
return multipartResolver;
}
use of org.springframework.web.multipart.support.StandardServletMultipartResolver in project spring-boot by spring-projects.
the class MultipartAutoConfigurationTests method configureResolveLazily.
@Test
public void configureResolveLazily() {
this.context = new AnnotationConfigServletWebServerApplicationContext();
EnvironmentTestUtils.addEnvironment(this.context, "spring.http.multipart.resolve-lazily=true");
this.context.register(WebServerWithNothing.class, BaseConfiguration.class);
this.context.refresh();
StandardServletMultipartResolver multipartResolver = this.context.getBean(StandardServletMultipartResolver.class);
boolean resolveLazily = (Boolean) ReflectionTestUtils.getField(multipartResolver, "resolveLazily");
assertThat(resolveLazily).isTrue();
}
Aggregations