Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-8161

MockSlingHttpServletResponse.sendError(int sc, String msg) does not save msg String

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Servlet Helpers 1.1.8, Servlet Helpers 1.1.10
    • Fix Version/s: Servlet Helpers 1.1.10
    • Component/s: Servlets, Testing
    • Labels:
      None

      Description

      org.apache.sling.servlethelpers.MockSlingHttpServletResponse.sendError(int sc, String msg) saves the sc parameter, but discards the msg parameter.  This makes it impossible to verify the contents of the message in unit tests that use this mock.

      It would be trivial to add a member variable of type String to the class in order to store that message and then add a getter to retrieve it.  This would make it possible to verify the contents of the message in a unit test.

        Attachments

          Activity

            People

            • Assignee:
              sseifert Stefan Seifert
              Reporter:
              rmcdouga Rob McDougall
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: