기존
spring initializer 를 통해 스프링 부트 프로젝트를 생성하였고
스프링 프레임워크 학습을 진행하던 중
테스트를 위해
@RunWith, @SpringBootTest 어노테이션이 import 되지 않는
즉 패키지를 찾지 못하는 문제점을 발견했다.
[1. @RunWith 사용을 위해 "추가" 해야 할 dependency - maven 기준 ]
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
버전은 꼭 4.7로 하지 않아도 된다.
추가한 후 maven refresh를 해주면
@RunWith를 import할 수 있게 되었다.
[2. @SpringBootTest ]
문제는 간단했다
스프링 이니셜라이저로 스프링 부트를 생성할 때
생성된 <scope>test<scope> 때문에
@SpringBootTest 어노테이션 패키지를 못 찾았던 것
제거한 후
maven refresh를 해주면
@SpringBootTest 어노테이션을 import 할 수 있게 되었다.
'개발 환경 설정 및 툴 사용법' 카테고리의 다른 글
깃허브(git) 토큰(token) 대신에 OAuth 인증으로 작업하기 with 소스트리 (0) | 2023.12.28 |
---|---|
인텔리제이(IntelliJ) - import static(정적 임포트) 하는 방법 (1) | 2023.12.27 |
IntelliJ - 한글 깨질 때 또는 MessageSource 물음표로 출력될 때 setting (0) | 2023.11.06 |
프로젝트 개발을 위한 환경설정 - Spring Boot, 의존성(pom.xml), 및 빌드툴 설정 (0) | 2023.10.19 |
윈도우 git 설치 방법 (0) | 2023.10.18 |