Skip to content

Commit

Permalink
[test #184] 벌크 연산 테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
dudxo committed Jan 12, 2025
1 parent a2c1126 commit 18d75bf
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void updateChatInquiryStatusRejected() {
ReflectionTestUtils.setField(chatInquiries.get(0), "createdAt", LocalDateTime.now().minusWeeks(1));

//when
chatInquiryRepository.updateChatInquiryStatusRejected();
chatInquiryRepository.updateChatInquiryStatusRejected(LocalDateTime.now());

em.flush();
em.clear();
Expand Down Expand Up @@ -115,14 +115,14 @@ void changeUpdatedAtWhenChangeStatusOfChatInquiry() {

List<ChatInquiry> chatInquiries = chatInquiryRepository.saveAll(List.of(chatInquiry1, chatInquiry2));
ReflectionTestUtils.setField(chatInquiry1, "createdAt", LocalDateTime.now().minusWeeks(1));

// when
ReflectionTestUtils.setField(chatInquiry1, "updatedAt", LocalDateTime.now().minusWeeks(1));
chatInquiryRepository.updateChatInquiryStatusRejected();

ReflectionTestUtils.setField(chatInquiry2, "updatedAt", LocalDateTime.now().minusWeeks(1));
em.flush();
em.clear();

// when
chatInquiryRepository.updateChatInquiryStatusRejected(LocalDateTime.now());

// then
ChatInquiry findChatInquiry1 = chatInquiryRepository.findById(chatInquiries.get(0).getId()).orElseThrow();
ChatInquiry findChatInquiry2 = chatInquiryRepository.findById(chatInquiries.get(1).getId()).orElseThrow();
Expand Down

0 comments on commit 18d75bf

Please sign in to comment.