@ -45,7 +45,7 @@ import org.springframework.boot.test.context.assertj.AssertableWebApplicationCon
import org.springframework.boot.test.context.runner.ContextConsumer ;
import org.springframework.boot.test.context.runner.WebApplicationContextRunner ;
import org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor ;
import org.springframework.boot.web.servlet.filter.Ordered HttpPut FormContentFilter;
import org.springframework.boot.web.servlet.filter.Ordered FormContentFilter;
import org.springframework.boot.web.servlet.server.ServletWebServerFactory ;
import org.springframework.context.ApplicationContext ;
import org.springframework.context.annotation.Bean ;
@ -71,8 +71,8 @@ import org.springframework.web.accept.ParameterContentNegotiationStrategy;
import org.springframework.web.accept.PathExtensionContentNegotiationStrategy ;
import org.springframework.web.bind.support.ConfigurableWebBindingInitializer ;
import org.springframework.web.context.request.ServletWebRequest ;
import org.springframework.web.filter.FormContentFilter ;
import org.springframework.web.filter.HiddenHttpMethodFilter ;
import org.springframework.web.filter.HttpPutFormContentFilter ;
import org.springframework.web.servlet.HandlerAdapter ;
import org.springframework.web.servlet.HandlerExceptionResolver ;
import org.springframework.web.servlet.HandlerMapping ;
@ -551,27 +551,26 @@ public class WebMvcAutoConfigurationTests {
}
@Test
public void httpPutF ormContentFilterIsAutoConfigured( ) {
public void f ormContentFilterIsAutoConfigured( ) {
this . contextRunner . run ( ( context ) - > assertThat ( context )
. hasSingleBean ( Ordered HttpPut FormContentFilter. class ) ) ;
. hasSingleBean ( Ordered FormContentFilter. class ) ) ;
}
@Test
public void httpPutF ormContentFilterCanBeOverridden( ) {
this . contextRunner . withUserConfiguration ( Custom HttpPut FormContentFilter. class )
public void f ormContentFilterCanBeOverridden( ) {
this . contextRunner . withUserConfiguration ( Custom FormContentFilter. class )
. run ( ( context ) - > {
assertThat ( context )
. doesNotHaveBean ( OrderedHttpPutFormContentFilter . class ) ;
assertThat ( context ) . hasSingleBean ( HttpPutFormContentFilter . class ) ;
assertThat ( context ) . doesNotHaveBean ( OrderedFormContentFilter . class ) ;
assertThat ( context ) . hasSingleBean ( FormContentFilter . class ) ;
} ) ;
}
@Test
public void httpPutF ormContentFilterCanBeDisabled( ) {
public void f ormContentFilterCanBeDisabled( ) {
this . contextRunner
. withPropertyValues ( "spring.mvc.formcontent. put filter.enabled=false")
. withPropertyValues ( "spring.mvc.formcontent. filter.enabled=false")
. run ( ( context ) - > assertThat ( context )
. doesNotHaveBean ( HttpPut FormContentFilter. class ) ) ;
. doesNotHaveBean ( FormContentFilter. class ) ) ;
}
@Test
@ -1076,11 +1075,11 @@ public class WebMvcAutoConfigurationTests {
}
@Configuration
static class Custom HttpPut FormContentFilter {
static class Custom FormContentFilter {
@Bean
public HttpPut FormContentFilter custom HttpPut FormContentFilter( ) {
return new HttpPut FormContentFilter( ) ;
public FormContentFilter custom FormContentFilter( ) {
return new FormContentFilter( ) ;
}
}