Details
-
Bug
-
Resolution: Done
-
Major
-
3.0.23.Final
-
None
Description
At the moment MockHttpResponse#getContentAsString() does not respect charset encoding which is provided by the controller-under-test. On other words, if controller's method is annotated with @Produces("application/json;charset=UTF-8") e.g. it sets Content-Type response header, this is ignored by MockHttpResponse. As the result unit test becomes platform encoding dependant.
It is expected that getContentAsString() captures the encoding and correctly decodes byte stream similar to how Spring MockHttpServletResponse#getContentAsString() does.