use of org.apache.wiki.api.core.Attachment in project jspwiki by apache.
the class MarkdownRendererTest method testAttachmentLink.
@Test
public void testAttachmentLink() throws Exception {
final String src = "This should be an [attachment link](Test/TestAtt.txt)";
newPage("Test");
final Attachment att = Wiki.contents().attachment(testEngine, "Test", "TestAtt.txt");
att.setAuthor("FirstPost");
testEngine.getManager(AttachmentManager.class).storeAttachment(att, testEngine.makeAttachmentFile());
Assertions.assertEquals("<p>This should be an <a href=\"/test/attach/Test/TestAtt.txt\" class=\"attachment\">attachment link</a>" + "<a href=\"/test/PageInfo.jsp?page=Test/TestAtt.txt\" class=\"infolink\">" + "<img src=\"/test/images/attachment_small.png\" border=\"0\" alt=\"(info)\" />" + "</a></p>\n", translate(src));
}
Aggregations