Skip to content

[Test] 쿠폰 API 테스트#228

Merged
Moses249 merged 8 commits into
developfrom
test/#223-coupon-api
Oct 29, 2025
Merged

[Test] 쿠폰 API 테스트#228
Moses249 merged 8 commits into
developfrom
test/#223-coupon-api

Conversation

@Moses249

Copy link
Copy Markdown
Contributor

🛠️ Issue Number

closes #223

📌 작업 내용 및 특이사항
쿠폰 API 테스트

📚 참고사항

@willjsw willjsw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다! 다만 한가지 UserDail을 사용한 코드가 있는데, 해당 부분은 MemberUtil이 이미 그 기능을 대체하고 있기 떄문에 삭제해주시기 바랍니다!(저희 시스템에서는 MemberDetail이라는 커스텀 클래스로 해당 타입을 상속받아 구현하고 있습니다.)
혹시 다른 부분에서도 해당 어노테이션 사용한 예가 있다면, 동일하게 적용 부탁드립니다.
테스트 코드 자체는 잘 작성하신 것 같습니다!

@@ -32,13 +32,12 @@ public ResponseEntity<CouponGenerateRequest> createCoupon(
public ResponseEntity<List<CouponResponse>> getCoupon(
@AuthenticationPrincipal UserDetails userDetails) {

@willjsw willjsw Oct 27, 2025

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q(P1) 해당 어노테이션은 SecurityContextHolder에서 유저 인증 정보를 꺼내오는 것인데, 저희는 MemberUtil을 통해 Service 레어어에서 이를 해결하고 있습니다. 혹시 특별히 사용하신 이유가 있는지 궁금합니다!

P3: 또한 공통 응답 포맷도 신경 써주시면 좋겠습니다!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 포맷이 member util을 가져오는 걸로 잘못 이해하고 있었습니다. 내일은 신경쓰고 작성하겠습니다!


@WebMvcTest(CouponController.class)
@AutoConfigureRestDocs
@Import({SecurityTestConfig.class, CouponControllerTest.TestConfig.class})

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: 아마 제가 #211 에 올린 커밋을 참고하신 것 같습니다! 테스트 중앙화를 위해 TestConfig를 별도로 분리하였는데, 아직 Develop 머지 전이라 이너 클래스를 참조하도록 자동완성된 듯 합니다!
해당 PR Develop 머지했으니, develop 브랜치 머지하신 뒤 다시 시도해보시기 바랍니다! 그렇게 하시면서 내부 static TestConfig 클래스는 삭제하시면 됩니다:)

@willjsw willjsw added this to the Sprint 3 milestone Oct 27, 2025
@willjsw willjsw added the ✅ test 테스트를 작성, 또는 수정합니다. label Oct 27, 2025

@isak-kang isak-kang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다.!
정말 작은 수정 사항있는데 확인 부탁드립니다!

Comment thread src/docs/asciidoc/_coupon.adoc Outdated
include::{snippets}/coupon-list/http-response.adoc[]


=== 7. 쿠폰 삭제

@isak-kang isak-kang Oct 28, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p1 : 3. 쿠폰 삭제로 바꾸시면 좋을것 같습니다.

@willjsw willjsw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!

@Moses249
Moses249 merged commit db6591b into develop Oct 29, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✅ test 테스트를 작성, 또는 수정합니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Test] Coupon API 테스트

3 participants