Removed newline constant.
@@ -20,9 +20,9 @@ import static org.mockito.Mockito.*;
class LogHandlerTest {
private static final String LOG_HANDLER_NAME = "TestHandler";
private static final String MESSAGE = "TestMessage";
- private static final String LINE_SEPARATOR = System.getProperty("line.separator");
private static final String NOT_SHOWN = "Not shown";
private static final String ADDITIONAL_MESSAGE = "Additional";
+ private static final String LOGGER_MESSAGE = "Logger message";
@Test
void shouldLogInfoAndErrorMessage() {
@@ -60,17 +60,15 @@ class LogHandlerTest {
@Test
void shouldLogFormattedMessage() {
- final String logFormat = "Skipping '%s'";
-
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
PrintStream printStream = new PrintStream(outputStream);
TaskListener taskListener = createTaskListener(printStream);
LogHandler logHandler = new LogHandler(taskListener, LOG_HANDLER_NAME);
- logHandler.log(logFormat, MESSAGE);
+ logHandler.log(LOGGER_MESSAGE);
assertThat(outputStream.toString()).isEqualTo(
- String.format("[%s] " + logFormat + "%s", LOG_HANDLER_NAME, MESSAGE, LINE_SEPARATOR)
+ String.format("[%s] %s%n", LOG_HANDLER_NAME, LOGGER_MESSAGE)
);
}
