package core.log.service;

import core.framework.kafka.MessagePublisher;
import core.framework.log.message.ActionLogMessage;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;

import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.verify;

/**
 * @author neo
 */
@ExtendWith(MockitoExtension.class)
class ActionLogForwarderTest {
    @Mock
    MessagePublisher<ActionLogMessage> publisher;
    private ActionLogForwarder forwarder;

    @BeforeEach
    void createActionLogForwarder() {
        forwarder = new ActionLogForwarder(publisher, "action", List.of("website"), List.of());
    }

    @Test
    void forward() {
        var message = new ActionLogMessage();
        message.app = "website";
        message.traceLog = "trace";
        forwarder.forward(List.of(message));
        assertThat(message.traceLog).isNull();
        verify(publisher).publish("action", null, message);
    }
}

@@ -350,66 +350,8 @@
 t;%0A%0A
-import static org.assertj.core.api.Assertions.assertThat;%0A
 impo
@@ -934,55 +934,8 @@
 ));%0A
-        assertThat(message.traceLog).isNull();%0A
     

fix unit test