• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

JUnit4 library not found in the module

22.12.12 16:26 작성 조회수 1.1k

0

추가도 했는데 모듈이 없다고 뜨는데용 ㅜㅜ

답변 3

·

답변을 작성해보세요.

1

plugins {
   id 'org.springframework.boot' version '2.4.1'
   id 'io.spring.dependency-management' version '1.0.10.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-validation'
   implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
   implementation 'org.springframework.boot:spring-boot-starter-web'
   testImplementation 'junit:junit:4.13.1'
   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()
}

0

David님의 프로필

David

2022.12.12

안녕하세요. 재미사마님, 공식 서포터즈 David입니다.

build.gradle에 문법 오류가 있는 것 같습니다.

강의안 또는 강의내용과 동일하게 작성하셨는지 확인 부탁드립니다.

감사합니다.

testMember는 통과햇는데 initialzationErro가 나요...

David님의 프로필

David

2022.12.12

@RunWith을 지우시고 다시 시도해보시겠어요?

import org.junit.jupiter.api.Test;

밑에 있는걸로 변경하니깐

import org.junit.Test;

성공 했습니다.

감사합니다!!!!!!!David 님!!

 

 

 

0

에러 메세지가 납니다 ㅠㅠ