diff --git a/src/test/java/com/dnd/gongmuin/chat_inquiry/repository/ChatInquiryRepositoryTest.java b/src/test/java/com/dnd/gongmuin/chat_inquiry/repository/ChatInquiryRepositoryTest.java index 1accbbf9..dd7ff6bf 100644 --- a/src/test/java/com/dnd/gongmuin/chat_inquiry/repository/ChatInquiryRepositoryTest.java +++ b/src/test/java/com/dnd/gongmuin/chat_inquiry/repository/ChatInquiryRepositoryTest.java @@ -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(); @@ -115,14 +115,14 @@ void changeUpdatedAtWhenChangeStatusOfChatInquiry() { List 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();