package core.framework.impl.log;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;

/**
 * @author neo
 */
class ConsoleAppenderTest {
    private ConsoleAppender appender;

    @BeforeEach
    void createConsoleAppender() {
        appender = new ConsoleAppender();
    }

    @Test
    void filterLineSeparator() {
        String message = "line1\nline2";
        String filteredMessage = appender.filterLineSeparator(message);
        assertEquals("line1 line2", filteredMessage);
    }

    @Test
    void message() {
        ActionLog action = new ActionLog("begin");
        action.action("action");
        action.end("end");

        String message = appender.message(action);
        assertThat(message).contains("| OK |").contains("| action=action |");
    }
}

@@ -165,69 +165,8 @@
 hat;
-%0Aimport static org.junit.jupiter.api.Assertions.assertEquals;
 %0A%0A/*
@@ -408,74 +408,110 @@
     
-String message = %22line1%5Cnline2%22;%0A        String filteredMessage = 
+assertThat(appender.filterLineSeparator(%22line1%5Cnline2%22)).isEqualTo(%22line1 line2%22);%0A        assertThat(
 appe
@@ -539,46 +539,44 @@
 tor(
-message);%0A        assert
+%22line1%5Cr%5Cnline2%22)).is
 Equal
-s
+To
 (%22line1 
 line
@@ -575,31 +575,15 @@
 ne1 
+ 
 line2%22
-, filteredMessage
 );%0A 
@@ -627,25 +627,19 @@
         
-ActionLog
+var
  action 

refactor test