You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Konrad Windszus (JIRA)" <ji...@apache.org> on 2018/07/02 15:25:00 UTC

[jira] [Commented] (SLING-7744) MockRequestPathInfo: Add Setter for SuffixResource

    [ https://issues.apache.org/jira/browse/SLING-7744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16530073#comment-16530073 ] 

Konrad Windszus commented on SLING-7744:
----------------------------------------

The suffix may be used to identify either a resource by path or some other arbitrary stuff (compare with https://sling.apache.org/apidocs/sling10/org/apache/sling/api/request/RequestPathInfo.html#getSuffixResource--). So I am not sure if it is wise to decouple setSuffix() from getSuffixResource(). I would rather use the ResourceResolver to actually try to resolve a resource from the given path. That way the mock is closer to the real thing in https://github.com/apache/sling-org-apache-sling-engine/blob/256acc27abc3edf4ef24b56c380d6103237ba430/src/main/java/org/apache/sling/engine/impl/request/SlingRequestPathInfo.java#L191.

> MockRequestPathInfo: Add Setter for SuffixResource
> --------------------------------------------------
>
>                 Key: SLING-7744
>                 URL: https://issues.apache.org/jira/browse/SLING-7744
>             Project: Sling
>          Issue Type: Improvement
>          Components: Servlets, Testing
>    Affects Versions: Servlet Helpers 1.1.6
>            Reporter: Jens Lauterbach
>            Priority: Minor
>         Attachments: SLING-7744.patch
>
>
> The {{org.apache.sling.servlethelpers.MockRequestPathInfo}} allows consumers to set almost every field except the {{suffixResource}}. Currently, the {{getSuffixResource()}} just throws a {{UnsupportedOperationException}}.
> *I propose implementing a {{setSuffixResource}} method equivalent to all the other setters in this mock.*
> As far as I can tell this can be easily implemented (see attached patch) and would improve usability of this mock a little bit.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)