에러메세지
org.junit.ComparisonFailure:
Expected :200 OK
Actual :401 UNAUTHORIZED
<Click to see difference>
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at com.eunyeong.book.springboot.web.PostsApiControllerTest.Posts_등록된다(PostsApiControllerTest.java:57)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
build.gradle에서 //compile('org.springframework.boot:spring-boot-starter-oauth2-client') 주석처리해서 해결함.
dependencies {
implementation 'org.testng:testng:7.5'
implementation 'org.assertj:assertj-core:3.22.0'
// 의존성 선언
compile('org.springframework.boot:spring-boot-starter-web') // 버전 명시 x
compile('org.projectlombok:lombok')
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-mustache')
compile('com.h2database:h2')
//compile('org.springframework.boot:spring-boot-starter-oauth2-client')
compile('org.springframework.session:spring-session-jdbc')
compile("org.mariadb.jdbc:mariadb-java-client")
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile("org.springframework.security:spring-security-test")
testCompile('org.assertj:assertj-core:3.22.0')
}
'Springboot' 카테고리의 다른 글
[Springboot] createdDate, modifiedDate 관리 클래스 작성 (0) | 2022.01.25 |
---|---|
[Springboot-error] 테스트코드 에러 (0) | 2022.01.25 |
[Springboot] 테스트코드 작성 (0) | 2022.01.19 |
[Springboot-error] 테스트코드 404에러 (1) | 2022.01.19 |
[Java] Final 키워드 (0) | 2022.01.19 |