Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat : 예약과 회원 연관관계 매핑 #87

Merged
merged 17 commits into from
Jan 9, 2024
Merged

feat : 예약과 회원 연관관계 매핑 #87

merged 17 commits into from
Jan 9, 2024

Conversation

dlswns2480
Copy link
Member

close #64

⛏ 작업 상세 내용

  • Reservation
    • 예약 생성시에 회원을 받는 것으로 생성자 변경했습니다. 예약엔 회원이 꼭 있어야 하기 때문에!
  • MemberReservationService, ReservationRepository
    • 예약 선점, 등록, 조회 시 요청한 회원에 대한 것만 등록, 조회 하도록 수정하였습니다.
    • 기존 쿼리는 예약을 그냥 다 가져오는거였는데 쿼리 조건에 회원아이디와 일치하는 예약을 가져오는 것으로 쿼리 수정했습니다.
  • 수정한 것에 대해서 테스트 코드도 전부 수정하였습니다.
  • BaseIntegrationTest
    • 컨트롤러 통합 테스트 시 토큰이 필요하기 때문에 이에 필요한 헤더, 토큰 관련 의존성 추가했습니다.
    • 컨트롤러 테스트 시 활용하면 됩니다! MemberReservationControllerTest 보고 참고하시면 됩니다.

📝 작업 요약

  • 예약-회원 연관관계 매핑 및 테스트

☑️ 중점적으로 리뷰 할 부분

  • BaseIntegrationTest 추가된 내용
  • 수정된 쿼리
  • 수정된 로직

@dlswns2480 dlswns2480 self-assigned this Jan 9, 2024
Copy link

github-actions bot commented Jan 9, 2024

Test Results

92 tests  +4   91 ✅ +4   7s ⏱️ -1s
24 suites ±0    1 💤 ±0 
24 files   ±0    0 ❌ ±0 

Results for commit 06820f7. ± Comparison against base commit fe8a226.

♻️ This comment has been updated with latest results.

Copy link
Member

@hyun2371 hyun2371 left a comment

Choose a reason for hiding this comment

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

로직 구현하느라 고생 많으셨습니다! MemberReservationControllerTest 참고해 기존 컨트롤러 테스트 수정하겠습니다!

@@ -157,9 +167,11 @@ void getAllReservation() {
@Test
@DisplayName("예약 내역이 하나도 없을 시 조회되는 예약이 없다.")
void getAllReservationWithNoResult() {
when(reservationRepository.findAllWithReservationTimeAndShop()).thenReturn(List.of());
Member member = MemberFixture.member("[email protected]");
when(reservationRepository.findAllWithReservationTimeAndShopByMemberId(member)).thenReturn(
Copy link
Member

Choose a reason for hiding this comment

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

email을 따로 상수로 빼도 좋을 것 같아요!

Copy link
Collaborator

@kkangh00n kkangh00n left a comment

Choose a reason for hiding this comment

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

오우..!! 추가된 작업이 반복된 작업이라 귀찮으실수도 있었을텐데 고생하셨습니다~

@hyun2371 hyun2371 merged commit c56dc1b into dev Jan 9, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants