### Question:
ResourceTemplateWebPanel extends AbstractWebPanel { public String getHtml(Map<String, Object> context) { try { final StringWriter sink = new StringWriter(); getRenderer().render(resourceFilename, plugin, context, sink); return sink.toString(); } catch (Exception e) { final String message = String.format("Error rendering WebPanel (%s): %s", resourceFilename, e.getMessage()); logger.warn(message, e); return message; } } ResourceTemplateWebPanel(PluginAccessor pluginAccessor); void setResourceFilename(String resourceFilename); String getHtml(Map<String, Object> context);  }### Answer:
@Test public void testGetHtml() { final PluginAccessor accessorMock = mock(PluginAccessor.class); when(accessorMock.getEnabledModulesByClass(WebPanelRenderer.class)).thenReturn(Collections.<WebPanelRenderer>emptyList()); final Plugin plugin = mock(Plugin.class); when(plugin.getClassLoader()).thenReturn(this.getClass().getClassLoader()); final ResourceTemplateWebPanel resourceTemplateWebPanel = new ResourceTemplateWebPanel(accessorMock); resourceTemplateWebPanel.setPlugin(plugin); resourceTemplateWebPanel.setResourceType("static"); resourceTemplateWebPanel.setResourceFilename("ResourceTemplateWebPanelTest.txt"); assertTrue(resourceTemplateWebPanel.getHtml(Collections.<String, Object>emptyMap()) .contains("This file is used as web panel contents in unit tests.")); }