MemberRepositoryTest 실행시 오류
728
投稿した質問数 2
실행시 다음과 같은 에러가 발생합니다.
initializationError()

build.gradle 파일코드는 아래와 같습니다.
plugins {
id 'org.springframework.boot' version '2.7.2'
id 'io.spring.dependency-management' version '1.0.12.RELEASE'
id 'java'
}
group = 'jpabook'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-devtools'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
//JUnit4 추가
testImplementation("org.junit.vintage:junit-vintage-engine") {
exclude group: "org.hamcrest", module: "hamcrest-core"
}
}
test {
useJUnitPlatform()
}
ylm 파일 띄어쓰기도 맞췄고, url의 MVCC=TRUE도 제거했으며
build Tools > Gradle 도 IntelliJ IDEA로 맞췄는데
어느부분이 문제인지 모르겠습니다.
H2 콘솔도 잘 켠 것 같습니다만..


어디가 잘못된걸까요..?
回答 2
0
안녕하세요 , 저도 질문자분과 동일한 오류가 발생했어서 답변을 남깁니다.
저의 경우 테스트 클래스 위에 붙인 2개의 어노테이션
@RunWith(SpringRunner.class)
@SpringBootTest
public class MemberRepositoryTest {
중 @RunWith(SpringRunner.class)를 없애니 테스트를 정상 통과했습니다!
혹시 해결된 이유가 무엇일까요?
0
안녕하세요. 신동윤님 @RunWith는 Junit4일때 사용하는데요. 현재 스프링 부트의 경우 JUnit5를 기본으로 사용해서 해당 코드를 제거해야 동작합니다.
감사합니다.
sdk 설정 오류
0
49
2
오탈자 - @Transactional
0
55
1
src/test/resources 테스트 경로 문제
0
50
1
상품 등록후 H2 db 출력 순서 바꿀 수 있나요?
0
63
1
MemberRepositoryTest 실행오류
0
81
1
boot 4.x >>> trasasction rolled back log & p6spy(영한님, 수업 자료 업데이트 해주시면 감사하겠습니다!!)
1
183
2
강의 마지막 QueryDSL 사용 부분 질문있습니다
1
137
2
클라이언트에서 isbn과 author 수정 요청을 한 경우에 대해 질문드립니다.
0
51
1
도메인 모델 패턴 vs 트랜잭션 스크립트 패턴
0
71
1
기본 생성자
0
60
1
h2 DB 연결시 jdbc url 변경 이유가 궁금합니다.
0
100
1
멤버서비스테스트 부분에서 막힙니다.
0
164
4
실무에서도 EntityManager를 이용해서 많이 작업하는 편일까요?
0
116
1
초반에 h2 다운로드 과정 꼭 필요한가요?
0
118
2
자신 필드에도 get으로 접근하는 이유가 있을까요?
0
112
1
24분 27초 연관관계 편의 메서드 위치
0
113
1
단건 주문만 가능하게 한건 의도한 부분이신가요?
0
108
2
빌드 툴, Gradle
0
59
1
h2연결은 된 것 같은데 엔티티 테이블까지 작성 후 확인해보아도 테이블이 안보입니다
0
76
2
Repository에서 EntityManager 주입 방식 차이
0
88
1
롬복과 사용자 정의 setter 메서드
0
71
1
주문 목록 조회 fetch join 질문드립니다
0
81
1
dirty checking 질문드립니다.
0
81
1
동시성 관련 질문입니다
0
74
1

