Functions { public static List<String> listProjects() { return repoManager.listProjects(); }  @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 listProjects() { List<String> projects = Lists.newArrayList("p1", "p2", "p3"); when(repoManager.listProjects()).thenReturn(projects); assertEquals(projects, Functions.listProjects()); }