@Test
void shouldLogFormattedMessage() {

    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    PrintStream printStream = new PrintStream(outputStream);
    TaskListener taskListener = createTaskListener(printStream);
    LogHandler logHandler = new LogHandler(taskListener, LOG_HANDLER_NAME);
    logHandler.log(LOGGER_MESSAGE);
    assertThat(outputStream.toString())
            .isEqualTo(String.format("[%s] %s%n", LOG_HANDLER_NAME, LOGGER_MESSAGE));
}