나를 기록하다
article thumbnail
[Spring Boot] initializationError 해결(@RunWith 관련)
Error/Spring Boot 2023. 7. 11. 21:42

@RunWith(SpringRunner.class) 매핑 시 initializationError 발생 1) 발생 package jpabook.jpashop; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import org.spring..

article thumbnail
[Spring Boot] assertThat 호출 오류 해결
Error/Spring Boot 2023. 7. 11. 21:38

1. assertThat 호출 오류(import 구문 문제) 1) 발생 위와 같이 Assertions을 임포트하였으나 assertThat에 빨간줄이 그이는 것을 확인할 수 있다. 2) 원인 이유를 찾기 위해 서핑 결과, Intellij에서 자동으로 import 해주는 구문의 문제라는 것을 알 수 있었다. 3) 해결 [intelliJ] assertThat import 안되는 오류 [intelliJ] assertThat import 안되는 오류 문제 발생 assertThat을 사용하기 위해 AssertJ를 import를 하려고 했는데 import가 안되는 문제가 발생했다. 해결 방법 import static org.junit.Assert.*; 테스트를 생성할 때 자동으로 들어가는 import문을 지워주 sh..

profile on loading

Loading...