[ Intellj / 인텔리제이 ] Execution failed for task ':test'.
개발 유틸리티/intellij

[ Intellj / 인텔리제이 ] Execution failed for task ':test'.

1. 상황

Intellij를 통해 간단한 출력용 코드를 junit으로 돌리는데 에러가 발생

  • class를 public으로 변경해도 동일 에러 발생
  • 메소드에 public으로 변경해도 동일 에러 발생
@SpringBootTest
public class UserSearchRepositoryTest {

    @Test
    void 사용자_생성() {
        System.out.println("aaaa");
    }
}
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///D:/sideProject/elastic-jdk17-toy/build/reports/tests/test/index.html

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

 

파일에 들어가서 확인하니 gradle이 테스트 실행할때 Exception이 발생

 

org.gradle.api.internal.tasks.testing.TestSuiteExecutionException: Could not execute test class 'com.mile.elasticjdk17toy.repository.rdb.UserRepositoryTest'.

2. 해결방법

File > Setting > Gradle에 빨간색 부분을 Gradle -> Intellij IDEA로 변경하여 해결