use of org.xwiki.vfs.VfsManager in project xwiki-platform by xwiki.
the class VfsScriptServiceTest method urlError.
@Test
public void urlError() throws Exception {
VfsResourceReference reference = new VfsResourceReference(URI.create("attach:xwiki:space.page@attachment"), "path1/path2/test.txt");
VfsManager manager = this.mocker.getInstance(VfsManager.class);
when(manager.getURL(reference)).thenThrow(new VfsException("error"));
assertNull(this.mocker.getComponentUnderTest().url(new VfsResourceReference(URI.create("attach:xwiki:space.page@attachment"), "path1/path2/test.txt")));
}
use of org.xwiki.vfs.VfsManager in project xwiki-platform by xwiki.
the class VfsScriptServiceTest method url.
@Test
public void url() throws Exception {
VfsResourceReference reference = new VfsResourceReference(URI.create("attach:xwiki:space.page@attachment"), "path1/path2/test.txt");
VfsManager manager = this.mocker.getInstance(VfsManager.class);
when(manager.getURL(reference)).thenReturn("/generated/url");
assertEquals("/generated/url", this.mocker.getComponentUnderTest().url(new VfsResourceReference(URI.create("attach:xwiki:space.page@attachment"), "path1/path2/test.txt")));
}
Aggregations