### Question:
IssueFormatter implements Formatter { public String getSummaryData(TestSummary summary) { if (summary.hasFailed()) { StringBuffer sb = new StringBuffer("\n\n"); sb.append("Script: ").append(summary.getScriptName()); sb.append("\nFailures: ").append(summary.getFailures()); sb.append("\nErrors: ").append(summary.getErrors()); return sb.toString(); } return ""; }  String getSummaryData(TestSummary summary); String getFileName(String scriptName); String getHeader(); String getResultData(List<TestResult> listResult); String getSummaryHeader(); String getSummaryFooter(); String getStartScript(); String getStopScript(); String getFooter(); String getSuiteLogFileName();  }### Answer:
@Test public void testGetSummaryDataForSuccessSummary() { assertEquals("", formatter.getSummaryData(new TestSummary())); }
@Test public void testGetSummaryDataForFailureSummary() { String expected = "\n\nScript: test\nFailures: 1\nErrors: 0"; assertEquals(expected, formatter.getSummaryData(ReportUtil.getTestSummary())); }