AlertTemplateProcessor { public String processHtmlTemplate(Incident incident) { return processTemplate("alertsHtml.ftl", alertingPlugin.getHtmlAlertTemplate(), incident); } AlertTemplateProcessor(AlertingPlugin alertingPlugin); String processHtmlTemplate(Incident incident); String processPlainTextTemplate(Incident incident); String processShortDescriptionTemplate(Incident incident);  }
@Test public void testProcessHtmlTemplate() throws Exception { assertEquals(String.format( "<h3>Incident for check Test Timer</h3>\n" + "First failure: %s<br>\n" + "Old status: OK<br>\n" + "New status: CRITICAL<br>\n" + "Failing checks: 2<br>\n" + "Hosts: testHost2<br>\n" + "Instances: testInstance<br><br>\n" + "\n" + "<table>\n" + "\t<thead>\n" + "\t<tr>\n" + "\t\t<th>Host</th>\n" + "\t\t<th>Instance</th>\n" + "\t\t<th>Status</th>\n" + "\t\t<th>Description</th>\n" + "\t\t<th>Current Value</th>\n" + "\t</tr>\n" + "\t</thead>\n" + "\t<tbody>\n" + "\t\t\t<tr>\n" + "\t\t\t\t<td>testHost2</td>\n" + "\t\t\t\t<td>testInstance</td>\n" + "\t\t\t\t<td>CRITICAL</td>\n" + "\t\t\t\t<td>test</td>\n" + "\t\t\t\t<td>10</td>\n" + "\t\t\t</tr>\n" + "\t\t\t<tr>\n" + "\t\t\t\t<td>testHost2</td>\n" + "\t\t\t\t<td>testInstance</td>\n" + "\t\t\t\t<td>ERROR</td>\n" + "\t\t\t\t<td>test</td>\n" + "\t\t\t\t<td>10</td>\n" + "\t\t\t</tr>\n" + "\t</tbody>\n" + "</table>\n", toFreemarkerIsoLocal(testIncident.getFirstFailureAt())), alertTemplateProcessor.processHtmlTemplate(testIncident)); }