일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 제이피큐엘쿼리
- springbootH2
- OSIV
- JPA값타입
- 에이치투데이터베이스
- jpqlquery
- 자바제너릭
- httppie
- 데이터베이트h2
- jpa
- Open EntityManager
- JPA프록시
- sql
- spring
- 스프링부트
- javageneric
- JPAproxy
- springboot기본설정
- gitinitial
- JPA Hint & Lock
- embededtype
- springbootproxy
- dockercmd
- MySqlType
- Git
- 임베디드타입
- JPAmapping
- 이해와 원리
- JDBC connection pool
- 스프링부트기본설정
Archives
- Today
- Total
빡코
[Spring-boot] JsonPathResultMatchers_Import_에러 본문
JUnit 5
import static org.hamcrest.CoreMatchers.is;
참조:
JUnit 4 상황
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; 임포트가 되었지만,
이런 상황이며
아래와 같은 에러메세지가 디스클로징
Testing started at 오전 12:46 ...
> Task :cleanTest
> Task :compileJava
> Task :processResources NO-SOURCE
> Task :classes
> Task :compileTestJava FAILED
C:\sts-bundle\springboot\freelec-springboot2-webservice\src\test\java\com\jojoldu\book\springboot\web\HelloControllerTest.java:44: error: incompatible types: JsonPathResultMatchers cannot be converted to ResultMatcher
.andExpect(jsonPath("$.name",is(name)))
^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileTestJava'.
> Compilation failed; see the compiler error output for details.
* 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 5s
3 actionable tasks: 3 executed
무엇이 문제?
그냥 수동으로 Import 해준다 .
import static org.hamcrest.Matchers.is;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
'Java > Spring-boot' 카테고리의 다른 글
[스프링]스프링 컨테이너 (0) | 2023.12.27 |
---|---|
[스프링+DB]Spring에서 Database 접근하기 (0) | 2023.12.26 |
[스프링부트] 프로젝트 초기 기본 설정 (0) | 2023.02.05 |
스프링부트_JPA_데이터베이스_에러 (0) | 2020.01.05 |
[Spring-boot][에러] build.gradle_lombok_dependecies_에러 (0) | 2020.01.05 |