in src/main/java/org/apache/sling/launchpad/testservices/serversidetests/ResourceResolverWithVanityBloomFilterTest.java [2145:2171]
public void testMapResourceAliasJcrContent() throws Exception {
// define an alias for the rootPath in the jcr:content child node
String alias = "testAlias";
Node content = rootNode.addNode("jcr:content", "nt:unstructured");
content.setProperty("sling:alias", alias);
saveMappings(session);
try {
String path = ResourceUtil.normalize(ResourceUtil.getParent(rootPath) + "/" + alias);
String mapped = resResolver.map(rootNode.getPath());
assertEquals(path, mapped);
path = ResourceUtil.normalize(ResourceUtil.getParent(rootPath) + "/" + alias + "/_jcr_content");
mapped = resResolver.map(content.getPath());
assertEquals(path, mapped);
Node child = content.addNode("child");
session.save();
path = ResourceUtil.normalize(ResourceUtil.getParent(rootPath) + "/" + alias + "/_jcr_content/child");
mapped = resResolver.map(child.getPath());
assertEquals(path, mapped);
} finally {
content.remove();
session.save();
}
}