I read that in spring boot the following setting would help.
spring.http.encoding.force=true
In my case, where the setup is a bit special, it did not.
What does work for my setup is adding a filter to the MockMvc setup.
@Before
public void setUp() {
mockMvc = MockMvcBuilders
.webAppContextSetup(webApplicationContext)
.addFilter((request, response, chain) -> {
response.setCharacterEncoding("UTF-8"); // this is crucial
chain.doFilter(request, response);
}, "/*")
.build();
}
Hope it helps someone and saves some hours of try and error.