강의

멘토링

커뮤니티

Inflearn Community Q&A

whdudgns26545253's profile image
whdudgns26545253

asked

Real-world! Spring Boot and JPA Utilization 1 - Web Application Development

JPA and DB Configuration, Operation Verification

테스트 도중 에러 발생

Written on

·

27K

4

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':test'.

> No tests found for given includes: [jpabook.jpashop.MemberRepositoryTest](filter.includeTestsMatching)

* 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.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s

테스트 맴버 실행 도중에 위와 같은 오류가 발생하였습니다.

뭐가 문제인걸까요? ㅠ

웹앱springspring-bootJPAjava

Answer 15

67

저도 계속 에러나서 아래와 같이 수정 하니 잘되네요..

RUN TEST USING 을 INTELLIJ 로 수정 하시면 잘됩니다.

https://stackoverflow.com/questions/55405441/intelij-2019-1-update-breaks-junit-tests

생명의 은인이십니다. 복받으실꺼에요:0

감사합니다!! 

은인이십니다...

11

저도 주금성님이 주신링크로 해결되었네요 ㅠㅠ

혹시 junit 5로 하신분들은 꼭 import의 test를 아래처럼 다시 써주세요!

import org.junit.jupiter.api.Test;

 

감사합니다 ㅠㅠ

org.junit.Test로 하고 있었는데, 이렇게 바꾸니까 바로 되었어요 ㅎㅎ

7

yh님의 프로필 이미지
yh
Instructor

다들 Junit5로 설정하신 분들이군요^^!

메뉴얼에 해결 방안을 update 해두었습니다. v1.11

모두 감사합니다.

2

yh님의 프로필 이미지
yh
Instructor

class MemberRepositoryTest

-> public class MemberRepositoryTest로 변경해봐주세요.

전체 프로젝트를 압축해서 올려주세요.

2

yh님의 프로필 이미지
yh
Instructor

안녕하세요 HA HA님

보내주신 곳을 보니 

> No tests found for given includes: [jpabook.jpashop.MemberRepositoryTest](filter.includeTestsMatching)

MemberRepositoryTest 클래스에 테스트가 없어서 실패하는 것 같아요.

해당 클래스에 테스트를 추가하거나 @Ignore 등을 추가해보세요^^

1

implementation 'junit:junit:4.12'

이걸로 build.gradle에 추가해두었는데, 주금석님 방법으로 해결되었습니다ㅠㅠㅠ

1

고맙습니다 주금석님 ㅠ-ㅠ

1

저도 주금석님 방법으로 해결하였습니다!

1

주금석님 처럼 하니까 저도 되네요.

와, 저도 저 방법대로 하니까 되네요. JUNIT5 입니다.

1

dsdsd님의 프로필 이미지
dsdsd
Questioner

감사합니다.

1

yh님의 프로필 이미지
yh
Instructor

테스트 클래스가 자바가 아닌 groovy 언어로 생성 되었던 것 같아요^^(아닐 수 도 있습니다)

그래도 잘해결되셨다니 다행입니다 ㅎㅎ

1

dsdsd님의 프로필 이미지
dsdsd
Questioner

답변 감사합니다. 강의 도중 알려주신? test class 단축키로 생성된 class를 제거하고 새로 직접 생성하니까 잘되었습니다.

새로 생성할때는 public이 회색?이 아니여서 테스트시 해당 클레시를 읽을것 같습니다. 여러번 해봐도 

해당 클레스가 왜 회색에 되어 클래스를 읽었는지는 잘 모르겠습니다. ㅠㅠ

1

dsdsd님의 프로필 이미지
dsdsd
Questioner

강의에서 위와 같이 설명해주신거 처럼 타이핑 하면서 했는데요.

테스트가 없다고? 문제가 발생합니다.

1

yh님의 프로필 이미지
yh
Instructor

MemberRepositoryTest 클래스에 테스트 케이스 있어야 합니다. 그러니까 아래와 같은 테스트 클래스가 있어야 하는데 없어서 오류가 발생하는 것 같아요.

아래 처럼 더미 테스트 메소드를 하나 넣어보시겠어요?

@Test

public void test () {

}

1

dsdsd님의 프로필 이미지
dsdsd
Questioner

MemberRepositoryTest 클래스에 테스트가 없다는게 무슨 의미인가요??

whdudgns26545253's profile image
whdudgns26545253

asked

Ask a question