asserThat 사용 안됨 문제 해결 (import해도 안되는 경우)

2025. 3. 30. 17:43·백엔드/spring

강의를 보면서 강의에서는 asserThat을 사용하는데 나는 아무리 import를 해주어도 뜨질 않았다

알고보니 build gradle에 junit관련해서 추가해준게 이 부분밖에 없었던 것이다.

testRuntimeOnly 'org.junit.platform:junit-platform-launcher

 

이는 JUnit5 플랫폼 실행기만 추가된 상황이다. 그렇기때문에 Junit이 실행은 되지만 AssertJ 같은 확장 라이브러리는 포함되어 있지 않기때문에 아무리 import를 해줘도 사용이 불가능 했던 것이다.

dependencies {
	//이 코드 추가
    testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0'
    //기존코드
    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

 

 

이렇게 수정해주면 assertThat을 사용할 수 있는 걸 확인할 수 있다.

 

초기설정을 제대로 안해준걸 모르고 실행이 되긴하다보니 계속 하느라 문제를 인식하지 못했던 케이스이다..

'백엔드 > spring' 카테고리의 다른 글

Java 프로그래밍 기초2  (4) 2025.08.08
Java 프로그래밍 기초  (4) 2025.08.07
[Spring] java.lang.NoClassDefFoundError: org.springframework.core.NestedIOException 해결  (2) 2025.01.22
[Intelli J 에러 해결] Unknown host 'root'.Please ensure the host name is correct. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.  (1) 2024.12.10
[spring] intellij 로 새 프로젝트 시작시 Unknown host 'root'.Please ensure the host name is correct. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle 오류 문구 해결  (0) 2024.07.31
'백엔드/spring' 카테고리의 다른 글
  • Java 프로그래밍 기초2
  • Java 프로그래밍 기초
  • [Spring] java.lang.NoClassDefFoundError: org.springframework.core.NestedIOException 해결
  • [Intelli J 에러 해결] Unknown host 'root'.Please ensure the host name is correct. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.
hiwon
hiwon
천천히 굴러가는 코딩일기
  • hiwon
    하이원의 코딩 일기
    hiwon
  • 전체
    오늘
    어제
    • 분류 전체보기 (83)
      • 프론트엔드 (0)
        • react (0)
      • 백엔드 (13)
        • node.js (1)
        • spring (6)
      • 코딩테스트 (57)
        • 백준 (41)
        • 프로그래머스 (15)
      • 프로디지털아카데미 (9)
        • 클라우드 (1)
        • JavaScript (1)
      • github (1)
      • AWS (2)
      • Infra (1)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    알고리즘
    K디지털트레이닝
    코테
    MSA
    파이썬
    알파코
    다익스트라
    UnionFind
    프로디지털아카데미
    백준
    신한투자증권
    알파코캠퍼스
    깃허브
    프로그래머스
    IT기획
    spring
    EC2
    kdt교육
    AWS
    Java
    프디아
    python
    코딩테스트
    백엔드
    bastion host
    BFS
    github
    백트래킹
    투포인터
    그리디
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.0
hiwon
asserThat 사용 안됨 문제 해결 (import해도 안되는 경우)
상단으로

티스토리툴바