Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1675

MockHttpResponse#getContentAsString() should respect encoding of content

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 3.0.23.Final
    • Fix Version/s: 4.0.0.Beta1
    • Component/s: jaxrs
    • Labels:
      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                rsearls R Searls
                Reporter:
                dma_k Dmitry Katsubo
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: