[Test] Cart API Test#240
Merged
Merged
Conversation
- Cart → OptionValue → OptionGroup → Product → ProductImage 경로에 LEFT JOIN FETCH 추가 - 장바구니 조회 시 상품 이미지 지연로딩 제거로 성능 개선
- CartController CRUD API 테스트 코드 작성 (MockMvc 기반) - 장바구니 생성, 조회, 수정, 삭제 성공 케이스 검증 - Spring REST Docs 스니펫(cart-create, cart-get-list, cart-update, cart-delete) 생성 - TestConfig 적용으로 Mock 서비스 주입 - CartRepository fetch join 개선 반영
- CartCreateRequest에서 memberId 필드 제거 (토큰 기반 회원 식별로 변경) - CartResponse에 cartId 포함하여 생성 후 식별 가능하도록 수정 - CartController 및 CartControllerTest 로직 수정 - REST Docs 스니펫 응답 필드(cartId) 반영
isak-kang
added a commit
that referenced
this pull request
Oct 29, 2025
This reverts commit c0957fc.
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.
🛠️ Issue Number
closes #200
📌 작업 내용 및 특이사항
Cart(장바구니) API Test
POST /carts)GET /carts)PATCH /carts/{cartId})DELETE /carts/{cartId})성공 케이스 중심으로 테스트 코드 작성 및 문서화 (Spring REST Docs 적용)
CartRepository에 ProductImage fetch join 추가로 N+1 문제 개선
MockMvc 기반 단위 테스트 환경 구성 (SecurityTestConfig, TestConfig 연동)
REST Docs 스니펫(cart-create, cart-get-list, cart-update, cart-delete) 생성
📚 참고사항