강의

멘토링

커뮤니티

Inflearn コミュニティ Q&A

yeong のプロフィール画像
yeong

投稿した質問数

SpringベースのREST APIの開発

入力値を制限する

org.hamcrest.Matchers 에서 Junit Test가 실패 하고 있습니다.

解決済みの質問

作成

·

385

0

java.lang.SecurityException: class "org.hamcrest.Matchers"'s signer information does not match signer information of other classes in the same package

이라는 오류가 발생 하고 잇습니다.

결과 값은 예상한것과 마찬가지로 

Body = {"id":1,"name":"Spring","description":"REST API Development with Spring","beginEnrollmentDateTime":"2018-11-23T14:21:00","closeEnrollmentDateTime":"2018-11-24T14:21:00","beginEventDateTime":"2018-11-25T14:21:00","endEventDateTime":"2018-11-26T14:21:00","location":"강남역 D2 스타텁 íŒ©í† ë¦¬","basePrice":100,"maxPrice":200,"limitOfEnrollment":100,"offline":false,"free":false,"eventStatus":"DRAFT"}

정상적으로 값이 떨어지고 있어서 

맞게는 따라간거 같은데...

왜 SecurityException 이 발생 하는지 알수 있을까요?

번역을 돌려보니 서명자정보가 동일한 패키지에 있는 다른 클래스의 서명자 정보와 일치 하지 않습니다, 

라고 나오네요.

javarest-apispring

回答 2

1

whiteship님의 프로필 이미지
whiteship
インストラクター

static import를 잘못하신거 아닐까 싶네요. 제 코드랑 import 문을 비교해 보세요.요.https://github.com/keesun/study/blob/master/rest-api-with-spring/src/test/java/me/whiteship/demoinfleanrestapi/events/EventControllerTests.java

0

yeong님의 프로필 이미지
yeong
質問者

해결 하였습니다. 제가 인텔리제이를 못쓰고 예전 STS버전을 사용 하였더니 빌드패쓰에서 메이븐에 있는 hamcrest.jar를 쓰는게 아니라 STS안에 있는 jar파일을 참조 하더라구요..;; JUNIT5로 올려서 참조 안하게 하니까 통과가 되었습니다.

yeong のプロフィール画像
yeong

投稿した質問数

質問する