Open
Conversation
…er.kt에 HandlerMethodArgumentResolver 구현)
# Conflicts: # src/main/kotlin/WebConfig.kt # src/main/kotlin/user/controller/UserController.kt # src/main/kotlin/user/controller/UserControllerV2.kt # src/main/kotlin/user/repository/UserRepository.kt # src/main/kotlin/user/service/UserServiceImpl.kt # src/test/kotlin/kotlin/KotlinTest.kt
PFCJeong
approved these changes
Oct 21, 2023
Member
PFCJeong
left a comment
There was a problem hiding this comment.
과제 꼼꼼히 잘해주셨네요~
@transactional을 붙이라 공지 드린 이유는, 생성된 데이터를 롤백하기 위함입니다.
delete 테스트는 좋아요 데이터가 없어서 실패하는 거라 @transactional이랑은 관계가 없습니다.
delete 테스트 성공을 위해서 좋아요 데이터를 미리 추가해야겠네요~
| val songEntities = songRepository.findByTitleContainingWithArtists(keyword=keyword) //키워드를 포함한 노래의 songentitiy를 다 받아온다(리스트로) | ||
|
|
||
| return songEntities.map { sEntity-> //songEntity로서 곡에 대한 정보 전체를 controller로 넘겨 준다 | ||
| Song(id = sEntity.id, |
| import java.time.Instant | ||
|
|
||
| //이 캐시 레이어를 두는 방식에 대해서는 추후에 추가 공부 필요 | ||
| class NormalCache<Key, Value>(private val ttl:Long) { //캐시 구현체 클래스를 따로 정의 -> 만들고 저장하는 등의 기능을 넣는다 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
먼저 친절한 리뷰 감사드립니다.
아직 코드에서 테스트 중 "플레이리스트 좋아요 취소" 테스트는 fail 중인 상태입니다.
로그를 보면서 이유를 찾아봤더니, 이미 좋아요가 없는 상태에서 테스트 시 좋아요 취소 명령을 또 내려서 오류가 생긴 것 같더군요..
사실 바로 위의 테스트에서 좋아요를 넣기 때문에 그 데이터가 그대로 연결되리라고 생각했고, 세미나장님께서 알려주신 Transactional을 넣어도 문제는 해결되지 않았습니다.
다른 분들이 하신 걸 참고해서 해결해보려 했는데 대부분 데모유저를 만들어서 고유의 인증키를 생성하고, 그걸로 하나의 테스트 객체(?) 처럼 테스트를 진행해서 해결하셨더군요..
저처럼 테스트를 진행하는 방식에서 오류가 발생하는 것을 막을 수 있는 방법은 없을지 궁금합니다. 감사합니다.
(p.s. 몇몇 커밋 기록만 지우고 싶어서 커밋 삭제를 눌렀는데, 아예 작업했던 내용이 다 날아가버리더군요.. 로컬 레포 구석에다가 백업해둔 내용으로 급하게 다시 커밋들을 만들어서 올렸습니다.)