use of org.xwiki.wiki.template.WikiTemplateManagerException in project xwiki-platform by xwiki.
the class WikiTemplateManagerScriptTest method getTemplatesError.
@Test
public void getTemplatesError() throws Exception {
Exception exception = new WikiTemplateManagerException("Error in getTemplates");
when(wikiTemplateManager.getTemplates()).thenThrow(exception);
Collection<WikiDescriptor> results = mocker.getComponentUnderTest().getTemplates();
assertTrue(results.isEmpty());
assertEquals(exception, mocker.getComponentUnderTest().getLastError());
verify(mocker.getMockedLogger()).error("Error while getting all the wiki templates.", exception);
}
use of org.xwiki.wiki.template.WikiTemplateManagerException in project xwiki-platform by xwiki.
the class WikiTemplateManagerScriptTest method isTemplateError.
@Test
public void isTemplateError() throws Exception {
Exception exception = new WikiTemplateManagerException("error in isTemplate");
when(wikiTemplateManager.isTemplate("wikiTemplate")).thenThrow(exception);
assertNull(mocker.getComponentUnderTest().isTemplate("wikiTemplate"));
assertEquals(exception, mocker.getComponentUnderTest().getLastError());
verify(mocker.getMockedLogger()).error("Failed to get if the wiki [wikiTemplate] is a template or not.", exception);
}
Aggregations