1

It works in spring boot or normal projects but it didn't work when junit running

I saw many many solutions about lombok but, didn't work

for example

  1. install lombok plugin in intellij

  2. Build, Execution, Deployment -> Compiler -> Annotation Processors -> Enable annotation processing check!

import lombok.extern.java.Log;
import org.junit.Test;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Tag;

import static org.junit.jupiter.api.Assertions.assertEquals;

@Tag("fast")
@Log
public class MainTest {

    @BeforeAll
    static void setup() {
        log.info("@BeforeAll - executes once before all test methods in this class");
    }

    @BeforeEach
    void init() {
        log.info("@BeforeEach - executes before each test method in this class");
    }

    @Test
    @DisplayName("My first junit 5 test")
    void additionTest() {
        assertEquals(1+1, 1);
    }
}
error: package lombok.extern.java does not exist
error: cannot find symbol @Log
Joon
  • 87
  • 3
  • 7

0 Answers0