String path = "/"
+ MockSlingHttpServletRequest.RESOURCE_TYPE
+ "/"
+ ResourceUtil.getName(MockSlingHttpServletRequest.RESOURCE_TYPE)
+ ".servlet";
MockServletResource res = new MockServletResource(mockResourceResolver,
servlet, path);
mockResourceResolver.addResource(res);
MockResource parent = new MockResource(mockResourceResolver,
ResourceUtil.getParent(res.getPath()), "nt:folder");
mockResourceResolver.addResource(parent);
List<Resource> childRes = new ArrayList<Resource>();
childRes.add(res);
mockResourceResolver.addChildren(parent, childRes);