개요
- 테스트 코드에서 @Slf4j 어노테이션을 사용해 log를 사용하려 하는데 다음과 같은 에러가 발생한다.
BookControllerUnitTest
@Slf4j
@WebMvcTest
public class BookControllerUnitTest {
@Autowired
private MockMvc mockMvc;
@Test
public void save_테스트() {
log.info("save 테스트 시작 ================");
}
}
해결
- build.gradle 파일에 다음을 추가 작성한다.
testAnnotationProcessor 'org.projectlombok:lombok'