ReportAppender { public static StringBuilder appendStartedMessage(String message, StringBuilder report, Class classType) { message = MessageConstants.CONSOLE_YELLOW + message; report.append(message).append(System.lineSeparator()); String line; if (classType == Job.class) { line = MessageConstants.CONSOLE_WHITE + MessageConstants.CONSOLE_THICK_LINE; } else { line = MessageConstants.CONSOLE_WHITE + MessageConstants.CONSOLE_THIN_LINE; } report.append(line).append(System.lineSeparator()); return report; }  static StringBuilder appendStartedMessage(String message, StringBuilder report, Class classType); static StringBuilder appendCompletedMessage(String message, StringBuilder report, JobStatus status); static StringBuilder appendCompletedMessage(String message, StringBuilder report, TaskStatus status); static StringBuilder appendInfoMessage(String message, StringBuilder report);  }
@Test public void appendStartedMessage_jobStarted_correctMessage() { String message = "Test message"; StringBuilder report = new StringBuilder(); Class classType = Job.class; String expectedResult = MessageConstants.CONSOLE_YELLOW + message + System.lineSeparator() + MessageConstants.CONSOLE_WHITE + MessageConstants.CONSOLE_THICK_LINE + System.lineSeparator(); String actualResult = ReportAppender.appendStartedMessage(message, report, classType).toString(); Assert.assertEquals(expectedResult, actualResult); }
@Test public void appendStartedMessage_taskStarted_correctMessage() { String message = "Test message"; StringBuilder report = new StringBuilder(); Class classType = Task.class; String expectedResult = MessageConstants.CONSOLE_YELLOW + message + System.lineSeparator() + MessageConstants.CONSOLE_WHITE + MessageConstants.CONSOLE_THIN_LINE + System.lineSeparator(); String actualResult = ReportAppender.appendStartedMessage(message, report, classType).toString(); Assert.assertEquals(expectedResult, actualResult); }