Class<SpringJUnit4ClassRunner> cannot be resolved to a type

SEOP·2023년 4월 9일

ERROR

새로운 프로젝트를 만들고, Junit을 이용한 테스트 파일을 만들었는데 오류가 떴다.

Multiple markers at this line
- Class cannot be resolved to a type
- SpringJUnit4ClassRunner cannot be resolved to a type

  <!-- Test -->
<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.7</version>
  <scope>test</scope>
</dependency>

나는 Junit이 pom.xml 파일에 있어서 아무생각 없이 테스트를 돌리고자 했으나,

test를 돌리기 위해서는 spring-test가 필요했다.
그래서 pom.xml dependencies 사이에 아래 코드를 추가했다.

  <!-- spring-test -->
<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-test</artifactId>
  <version>${org.springframework-version}</version>
<scope>test</scope>
</dependency>

profile
응애 나 애기 개발자

0개의 댓글