Skip to content

Commit

Permalink
test: 지출 내역 생성 테스트 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
khabh committed Jul 21, 2024
1 parent 507676e commit a91426a
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.assertj.core.api.Assertions.tuple;

import java.util.Comparator;
import java.util.List;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -42,16 +41,12 @@ void saveAllBillAction() {

billActionService.saveAllBillAction(token, requests);

List<BillAction> actions = billActionRepository.findByAction_Event(savedEvent)
.stream()
.sorted(Comparator.comparing(BillAction::getSequence).reversed())
.limit(requests.size())
.toList();
List<BillAction> actions = billActionRepository.findByAction_Event(savedEvent);

assertThat(actions).extracting("title", "price")
.containsExactly(
tuple("인생맥주", 15_000L),
tuple("뽕족", 10_000L)
assertThat(actions).extracting(BillAction::getTitle, BillAction::getPrice, BillAction::getSequence)
.containsExactlyInAnyOrder(
tuple("뽕족", 10_000L, 1L),
tuple("인생맥주", 15_000L, 2L)
);
}

Expand Down

0 comments on commit a91426a

Please sign in to comment.