Functions { public static PageMetadata getAttachmentMetadata(String projectName, String branchName, String pagePath, String name) throws IOException { return pageStore.getAttachmentMetadata(projectName, branchName, pagePath, name); }  @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 getAttachmentMetadata() throws IOException { Date date = new Date(); PageMetadata metadata = new PageMetadata("user", date, 123, "commit"); when(pageStore.getAttachmentMetadata(PROJECT, BRANCH, PAGE, "test.png")).thenReturn(metadata); PageMetadata result = Functions.getAttachmentMetadata(PROJECT, BRANCH, PAGE, "test.png"); assertEquals(metadata.getLastEditedBy(), result.getLastEditedBy()); assertEquals(metadata.getLastEdited(), result.getLastEdited()); assertEquals(metadata.getSize(), result.getSize()); assertEquals(metadata.getCommit(), result.getCommit()); }