Functions { public static List<String> getPagePathHierarchy(String projectName, String branchName, String pagePath) throws IOException { return PageUtil.getPagePathHierarchy(projectName, branchName, Util.toRealPagePath(pagePath), pageStore); }  @PostConstruct void init(); static List<String> listProjects(); static List<String> listProjectBranches(String projectName); static List<String> listPageAttachments(String projectName, String branchName, String path); static String getPageTitle(String projectName, String branchName, String path); static List<String> getBranchesPageIsSharedWith(String projectName, String branchName, String path); static List<String> listUsers(); static String getPageHtml(String projectName, String branchName, String path); static String getPageHeaderHtml(String projectName, String branchName, String path); static List<String> getPagePathHierarchy(String projectName, String branchName, String pagePath); static PageMetadata getPageMetadata(String projectName, String branchName, String path); static PageMetadata getAttachmentMetadata(String projectName, String branchName, String pagePath,
			String name); static List<String> listRoles(); static List<RoleGrantedAuthority> getUserAuthorities(String loginName); static String formatSize(long size); static List<PageVersion> listPageVersions(String projectName, String branchName, String path); static List<OpenId> listMyOpenIds(); static List<JspMacroDescriptor> getMacros(); static int floor(double d); static String getLanguage(); static String escapeJavaScript(String s); static boolean pageExists(String projectName, String branchName, String path); static boolean isSubscribed(String projectName, String branchName, String path); static String getSystemSetting(String key); static String getLatestVersionForUpdate(); static List<String> getGroovyMacros(); static String substringBeforeLast(String s, String separator);  }
@Test public void getPagePathHierarchy() throws IOException { Page page1 = TestUtil.createRandomPage(null); Page page2 = TestUtil.createRandomPage("page1"); Page page3 = TestUtil.createRandomPage("page1/page2"); when(pageStore.getPage(PROJECT, BRANCH, "page1", false)).thenReturn(page1); when(pageStore.getPage(PROJECT, BRANCH, "page1/page2", false)).thenReturn(page2); when(pageStore.getPage(PROJECT, BRANCH, "page1/page2/page3", false)).thenReturn(page3); assertEquals(Lists.newArrayList("page1", "page1/page2", "page1/page2/page3"), Functions.getPagePathHierarchy(PROJECT, BRANCH, "page1/page2/page3")); }