[
https://issues.apache.org/jira/browse/SLING-6947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stefan Seifert resolved SLING-6947.
-----------------------------------
Resolution: Fixed
Assignee: Stefan Seifert
Fix Version/s: Servlet Helpers 1.0.2
Servlet Helpers 1.1.2
Completed: At revision: 1798814 (1.1.x)
Completed: At revision: 1798816 (1.0.x)
i've added a setPathInfo to MockSlingHttpServletRequest.
in case that is set to a non-null value in the unit test this value is
returned, instead of the calculated value (which still makes sense for
resourcetype-based servlets).
it's a bit difficult to automatically detect the type of registration or way of
calling the servlet, because the whole sling engine is not involved in the unit
test - the servlet's methods are usually called directly bypassing everything
else.
> MockHttpServletRequest incorrectly calculates pathInfo for path-bound servlets
> ------------------------------------------------------------------------------
>
> Key: SLING-6947
> URL: https://issues.apache.org/jira/browse/SLING-6947
> Project: Sling
> Issue Type: Bug
> Components: Testing
> Affects Versions: Servlet Helpers 1.1.0
> Reporter: Robert Munteanu
> Assignee: Stefan Seifert
> Fix For: Servlet Helpers 1.1.2, Servlet Helpers 1.0.2
>
>
> I have a servlet bound at /foo/bar . When invoked with the path /foor/bar/baz
> the path info is expected to be /baz.
> Instead,
> {{org.apache.sling.servlethelpers.MockSlingHttpServletRequest#getPathInfo()}}
> seems to construct the full request path, including:
> - the resource path
> - the selector string
> - the extension
> - the suffix
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)