### Question:
AbstractOutputBuilder { protected String formatTestSuiteSummaryStateMessage(TestSuite testSuite, String templateSuiteSummary) { if (StringUtils.isBlank(templateSuiteSummary)) { throw new SakuliRuntimeException("Template for resolving test suite output is EMPTY!"); } String result = replacePlaceHolder(templateSuiteSummary, getTextPlaceholder(testSuite)); LOGGER.debug("{{xxx}} patterns in template '{}' replaced with message '{}'", templateSuiteSummary, result); return cutTo(result, getSummaryMaxLength()); }  static String replacePlaceHolder(String message, PlaceholderMap placeholderStringMap); final static SimpleDateFormat dateFormat; }### Answer:
@Test public void testFormatTestSuiteStateMessageUnknown() throws Exception { TestSuite testSuiteExample = new TestSuiteExampleBuilder() .withId("sakuli-123") .withState(TestSuiteState.RUNNING) .withStopDate(null) .buildExample(); String result = testling.formatTestSuiteSummaryStateMessage(testSuiteExample, properties.getTemplateSuiteSummary()); assertEquals(result, "[UNKN] Sakuli suite \"sakuli-123\" suite still running. (Last suite run: xx)"); }
@Test public void testFormatTestSuiteStateMessageOK() throws Exception { Date startDate = new Date(); TestSuite testSuiteExample = new TestSuiteExampleBuilder() .withId("sakuli-123") .withState(TestSuiteState.OK) .withStartDate(startDate) .withStopDate(DateUtils.addSeconds(startDate, 120)) .buildExample(); String result = testling.formatTestSuiteSummaryStateMessage(testSuiteExample, properties.getTemplateSuiteSummary()); String lastRun = AbstractOutputBuilder.dateFormat.format(testSuiteExample.getStopDate()); assertEquals(result, "[OK] Sakuli suite \"sakuli-123\" ok (120.00s). (Last suite run: " + lastRun + ")"); }
@Test public void testFormatTestSuiteStateMessageException() throws Exception { Date startDate = new Date(); TestSuite testSuiteExample = new TestSuiteExampleBuilder() .withId("sakuli-123") .withState(TestSuiteState.ERRORS) .withStartDate(startDate) .withException(new SakuliCheckedException("TEST-ERROR")) .withStopDate(DateUtils.addSeconds(startDate, 120)) .buildExample(); String result = testling.formatTestSuiteSummaryStateMessage(testSuiteExample, properties.getTemplateSuiteSummary()); String lastRun = AbstractOutputBuilder.dateFormat.format(testSuiteExample.getStopDate()); assertEquals(result, "[CRIT] Sakuli suite \"sakuli-123\" (120.00s) EXCEPTION: 'TEST-ERROR'. (Last suite run: " + lastRun + ")"); }