RootPathResolver { public void setRootPathDetector(@NotNull RootPathDetector rootPathDetector) { this.rootPathDetector = rootPathDetector; } RootPathResolver(@NotNull ComponentHelper cmp, @NotNull SlingHttpServletRequest request); void setRootPathDetector(@NotNull RootPathDetector rootPathDetector); void setFallbackRootPath(@NotNull String fallbackRootPath); @NotNull String get(); Map<String, Object> getOverrideProperties();  }
@Test void testDetectedRootPath() { context.create().resource("/content/abc/def"); RootPathResolver underTest = prepareComponent(); underTest.setRootPathDetector((cmp, request) -> "/content/abc/def"); assertRootPath(underTest, "/content/abc/def"); }
@Test void testDetectedRootPath_AppendPath_FallbackToExisting() { context.create().resource("/content/abc"); RootPathResolver underTest = prepareComponent( PN_APPEND_PATH, "abc/def"); underTest.setRootPathDetector((cmp, request) -> "/content"); assertRootPath(underTest, "/content/abc"); }