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

MockHttpResponse#getContentAsString() should respect encoding of content

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 4.0.0.Beta1, 3.5.0.CR1
    • 3.0.23.Final
    • jaxrs
    • 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.

      Attachments

        Activity

          People

            rsearls r searls
            dma_k Dmitry Katsubo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: