Notice
Recent Posts
Recent Comments
Link
07-22 06:02
«   2025/07   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Archives
Today
Total
관리 메뉴

study-project

[오류]Class<SpringJUnit4ClassRunner> cannot be resolved to a type 본문

TIL/Spring

[오류]Class<SpringJUnit4ClassRunner> cannot be resolved to a type

귤식빵 2021. 2. 17. 16:19

코드로 배우는 스프링 웹프로젝트 책을 따라해보는 중에 생긴 문제

책을 따라했지만 생기는 문제..  그래서 검색을좀 했더니 

test 관련된 설정을 import 못하는 문제라고 한다 

캡쳐에는 없지만 import org.springframework.test.context........... 이부분들에 다 빨간줄이 나와있다

책에서는 이런 부분은 못봤는데 pom.xml에 추가해야할게 빠져있어서 생긴 문제다

		<!-- https://mvnrepository.com/artifact/org.springframework/spring-test 테스트 오류시 이걸 추가 -->
		<dependency>
		    <groupId>org.springframework</groupId>
		    <artifactId>spring-test</artifactId>
		    <version>5.2.9.RELEASE</version>
		    <scope>test</scope>
		</dependency>

그러고나서 어노테이션에 문제가 있다면 

import org.springframework.beans.factory.annotation.Autowired;//이걸 추가 

 

Comments