You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HttpEncodingAutoConfiguration is not added to the WebMvcTest slice. Not sure if this is intentional but when running with full auto-configuration this configuration is loaded in the application context. When starting a test application context with @WebMvcTest the CharacterEncodingFilter provided by the HttpEncodingAutoConfiguration is not added which makes http request processing different in those tests compared to @SpringBootTest or production application context. By default that filter makes request character encoding always UTF-8. see (filter config with default utf-8 being forced for requests)
This is triggered by spring-projects/spring-framework#22788. That made us use MediaType.APPLICATION_JSON (without the character encoding) for the requests during WebMvcTests.
The text was updated successfully, but these errors were encountered:
bclozel
transferred this issue from spring-projects/spring-framework
Oct 19, 2020
Indeed, the WebMvcTypeExcludeFilter includes FilterRegistrationBean but not the HttpEncodingAutoConfiguration, which configures the CharacterEncodingFilter if the configuration property is set.
Affects: 5.4.3
HttpEncodingAutoConfiguration
is not added to theWebMvcTest
slice. Not sure if this is intentional but when running with full auto-configuration this configuration is loaded in the application context. When starting a test application context with@WebMvcTest
theCharacterEncodingFilter
provided by theHttpEncodingAutoConfiguration
is not added which makes http request processing different in those tests compared to@SpringBootTest
or production application context. By default that filter makes request character encoding always UTF-8. see (filter config with default utf-8 being forced for requests)This is triggered by spring-projects/spring-framework#22788. That made us use
MediaType.APPLICATION_JSON
(without the character encoding) for the requests duringWebMvcTest
s.The text was updated successfully, but these errors were encountered: