@Test public void getTemplates() throws Exception { Collection<WikiDescriptor> templates = new ArrayList<WikiDescriptor>(); WikiDescriptor descriptor = new WikiDescriptor("templateId", "templateAlias"); templates.add(descriptor); when(wikiTemplateManager.getTemplates()).thenReturn(templates); Collection<WikiDescriptor> results = mocker.getComponentUnderTest().getTemplates(); assertEquals(templates, results); }
public Collection<WikiDescriptor> getTemplates() { try { return wikiTemplateManager.getTemplates(); } catch (WikiTemplateManagerException e) { error("Error while getting all the wiki templates.", e); return new ArrayList<WikiDescriptor>(); } }
WikiTemplateManagerScript implements ScriptService { public Collection<WikiDescriptor> getTemplates() { try { return wikiTemplateManager.getTemplates(); } catch (WikiTemplateManagerException e) { error("Error while getting all the wiki templates.", e); return new ArrayList<WikiDescriptor>(); } } }
WikiTemplateManagerScript implements ScriptService { public Collection<WikiDescriptor> getTemplates() { try { return wikiTemplateManager.getTemplates(); } catch (WikiTemplateManagerException e) { error("Error while getting all the wiki templates.", e); return new ArrayList<WikiDescriptor>(); } }  }
WikiTemplateManagerScript implements ScriptService { public Collection<WikiDescriptor> getTemplates() { try { return wikiTemplateManager.getTemplates(); } catch (WikiTemplateManagerException e) { error("Error while getting all the wiki templates.", e); return new ArrayList<WikiDescriptor>(); } }  Exception getLastError(); Collection<WikiDescriptor> getTemplates(); boolean setTemplate(String wikiId, boolean value); Boolean isTemplate(String wikiId); @Deprecated boolean createWikiFromTemplate(String newWikiId, String newWikiAlias,
            String templateId, String ownerId, boolean failOnExist); @Deprecated Exception getLastException(); @Deprecated JobStatus getWikiProvisioningJobStatus(List<String> jobId); }
WikiTemplateManagerScript implements ScriptService { public Collection<WikiDescriptor> getTemplates() { try { return wikiTemplateManager.getTemplates(); } catch (WikiTemplateManagerException e) { error("Error while getting all the wiki templates.", e); return new ArrayList<WikiDescriptor>(); } }  Exception getLastError(); Collection<WikiDescriptor> getTemplates(); boolean setTemplate(String wikiId, boolean value); Boolean isTemplate(String wikiId); @Deprecated boolean createWikiFromTemplate(String newWikiId, String newWikiAlias,
            String templateId, String ownerId, boolean failOnExist); @Deprecated Exception getLastException(); @Deprecated JobStatus getWikiProvisioningJobStatus(List<String> jobId); @Deprecated
    static final String CONTEXT_LASTEXCEPTION; }