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

구매 입찰 취소 기능 테스트 추가 #241

Merged
merged 15 commits into from
Feb 6, 2024
Merged

Conversation

Mayst1232
Copy link
Collaborator

개요

구매 입찰 취소 기능 테스트 추가

작업사항

  • 구매 입찰 취소 컨트롤러 테스트 추가
  • 구매 입찰 취소 provider 테스트 추가
  • 구매 Query Service 테스트 추가
  • 구매 Command Service 테스트 추가

관련 이슈

@Mayst1232 Mayst1232 added the test 테스트추가 label Feb 5, 2024
@Mayst1232 Mayst1232 self-assigned this Feb 5, 2024
Copy link

github-actions bot commented Feb 5, 2024

Test Results

95 tests   85 ✅  4s ⏱️
41 suites  10 💤
41 files     0 ❌

Results for commit a9c7fef.

♻️ This comment has been updated with latest results.

vanillacake369
vanillacake369 previously approved these changes Feb 6, 2024
Copy link
Collaborator

@vanillacake369 vanillacake369 left a comment

Choose a reason for hiding this comment

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

코드양이나 테스트 케이스 퀄리티를 보아하니
상당한 고민 끝에 작성하신 게 드러나네욥!!
고생 많으셨습니다!! 👍👏

Comment on lines +89 to +96
int start = (int) pageable.getOffset();
int end = Math.min((start + pageable.getPageSize()), responseDtoList.size());
Page<BuyPriceToQuantityResponseDto> responseDtoPage = new PageImpl<>(responseDtoList.subList(start, end), pageable,
responseDtoList.size());

given(buyRepository.findAllPriceToQuantityOf(any(Product.class), any(Pageable.class))).willReturn(responseDtoPage);
// when
Page<BuyPriceToQuantityResponseDto> returnPage = buyQueryService.findAllBuyBidsOf(TEST_PRODUCT, pageable);
Copy link
Collaborator

Choose a reason for hiding this comment

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

요부분 mockito 로 하시기 쉽지 않으셨을텐데 고생하셨네요 👍

.buyId((long) i)
.price(1000L * i)
.discountPrice(1000L * i)
.coupon((i % 2 == 0) ? TEST_COUPON_FIX : null)
Copy link
Collaborator

Choose a reason for hiding this comment

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

어떤 건 쿠폰주고 어떤 건 쿠폰 안 주게끔 하신걸까요??

구매 관련 조회 테스트 추가
즉시 구매 테스트 코드 작성
Copy link
Collaborator

@vanillacake369 vanillacake369 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다! 👍

@Mayst1232 Mayst1232 merged commit 98d9b5b into main Feb 6, 2024
2 checks passed
@Mayst1232 Mayst1232 deleted the test/BuyCancelBid branch February 6, 2024 07:08
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.

구매 입찰 취소 테스트 코드 추가
2 participants