HtmlSerializerContext { public String getPageUri(String path) { try { String pattern = "/page/{projectName}/{branchName}/{pagePath}"; String uri = ServletUriComponentsBuilder.fromCurrentContextPath() .path(pattern).build() .expand(projectName, branchName, Util.toUrlPagePath(path)) .encode(Charsets.UTF_8.name()).toUriString() .replaceFirst("^http(?:s)?: return uri; } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } } HtmlSerializerContext(String projectName, String branchName, String pagePath,
			MarkdownProcessor markdownProcessor, Authentication authentication, Locale locale, IPageStore pageStore,
			SystemSettingsStore systemSettingsStore, String contextPath); String getAttachmentUri(String name); String getPageUri(String path); String getUrl(String uri); String markdownToHtml(String markdown); List<Header> getHeaders(); MacroInvocation addMacroInvocation(String macroName, String params);  }
@Test public void getPageUri() { String page = "foo/bar/baz"; String uri = htmlSerializerContext.getPageUri(page); assertEquals(CONTEXT + "/page/" + PROJECT + "/" + BRANCH + "/" + Util.toUrlPagePath(page), uri); }