You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2021/11/16 04:04:55 UTC

[GitHub] [sling-org-apache-sling-resourceresolver] Gabiesfat commented on pull request #50: SLING-10844: ResourceMapper.getMapping() returns null for empty path

Gabiesfat commented on pull request #50:
URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/50#issuecomment-969837795


   > Thanks for the PR @Gabiesfat and apologies for looking so late into this. At this point I am not sure what we are trying to fix. I think it would be best if you could demonstrate it with a unit test that fails without the change and passed with it.
   > 
   > I tried to do so by adding a new test case to `ResourceMapperImplTest.java`:
   > 
   > ```java
   >     @Test
   >     public void mapEmptyPath() {
   >         ExpectedMappings.nonExistingResource("")
   >             .singleMapping("/")
   >             .singleMappingWithRequest("/app/")
   >             .allMappings("/")
   >             .allMappingsWithRequest("/app/")
   >             .verify(resolver, req);
   >     }
   > ```
   > 
   > The test passes currently so I am probably misunderstanding what this PR is trying to fix.
   I tried to make sure that method _getMapping_  returns empty mapping instead of null incase of _resourcePath_ provided as empty string. I have limited understanding of unit tests here as this is the first time I am seeing this code, if you could  help me in writing a test case where empty string returns after providing empty _resourcePath_ then it would be great.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org