Skip to content

Commit

Permalink
test : PayServiceTest 테스트 케이스 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
seongjunnoh committed Nov 10, 2024
1 parent 87ea6b3 commit e23312a
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ void getPayHomeInfos1() throws Exception {
// seohyun 이 testSpace 에서 생성한 1개의 정산 요청
PayRequest inCompletePay_seohyun = PayRequest.create(seohyun, testSpace, 40000, "국민은행", "111-111");

// Kyeongmin 이 testSpace에서 생성한 1개의 정산 요청
PayRequest completePay_kyeongmin = PayRequest.create(kyeongmin, testSpace, 20000, "우리은행", "222-222");
completePay_kyeongmin.changeCompleteStatus(true);

// 각 정산 요청의 타겟들
PayRequestTarget inCompleteTarget1 = PayRequestTarget.create(inCompletePay1_seongjun, sangjun.getUserId(), 10000);
PayRequestTarget inCompleteTarget2 = PayRequestTarget.create(inCompletePay1_seongjun, kyeongmin.getUserId(), 10000);
Expand All @@ -97,10 +101,14 @@ void getPayHomeInfos1() throws Exception {
PayRequestTarget inCompleteTarget5 = PayRequestTarget.create(inCompletePay_seohyun, seongjun.getUserId(), 20000);
PayRequestTarget inCompleteTarget6 = PayRequestTarget.create(inCompletePay_seohyun, sangjun.getUserId(), 20000);

PayRequestTarget completeTarget3 = PayRequestTarget.create(completePay_kyeongmin, seongjun.getUserId(), 20000);
completeTarget3.changeCompleteStatus(true);

payRequestRepository.save(inCompletePay1_seongjun);
payRequestRepository.save(inCompletePay2_seongjun);
payRequestRepository.save(completePay_seongjun);
payRequestRepository.save(inCompletePay_seohyun);
payRequestRepository.save(completePay_kyeongmin);

payRequestTargetRepository.save(inCompleteTarget1);
payRequestTargetRepository.save(inCompleteTarget2);
Expand All @@ -110,6 +118,7 @@ void getPayHomeInfos1() throws Exception {
payRequestTargetRepository.save(completeTarget2);
payRequestTargetRepository.save(inCompleteTarget5);
payRequestTargetRepository.save(inCompleteTarget6);
payRequestTargetRepository.save(completeTarget3);

//when
PayHomeViewResponse payHomeInfos = payService.getPayHomeInfos(seongjun.getUserId(), testSpace.getSpaceId());
Expand Down

0 comments on commit e23312a

Please sign in to comment.