Skip to content

Commit d64112f

Browse files
fix: 테스트코드 작동되게 notificationSchedule데이터가 필요한 곳에 코드 추가
1 parent 9a5f532 commit d64112f

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

ontime-back/src/test/java/devkor/ontime_back/service/ScheduleServiceTest.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ class ScheduleServiceTest {
4747

4848
@Autowired
4949
private PasswordEncoder passwordEncoder;
50+
@Autowired
51+
private NotificationScheduleRepository notificationScheduleRepository;
5052

5153
@AfterEach
5254
void tearDown() {
@@ -647,8 +649,13 @@ void deleteSchedule_success() {
647649
.place(place1)
648650
.user(newUser)
649651
.build();
650-
652+
NotificationSchedule notificationSchedule = NotificationSchedule.builder()
653+
.notificationTime(LocalDateTime.of(2025, 2, 23, 6, 55))
654+
.isSent(false)
655+
.schedule(addedSchedule1)
656+
.build();
651657
scheduleRepository.save(addedSchedule1);
658+
notificationScheduleRepository.save(notificationSchedule);
652659

653660
// when
654661
scheduleService.deleteSchedule(addedSchedule1.getScheduleId(), newUser.getId());
@@ -799,6 +806,12 @@ void modifySchedule_success() {
799806
.scheduleSpareTime(5)
800807
.latenessTime(10)
801808
.build();
809+
NotificationSchedule notificationSchedule = NotificationSchedule.builder()
810+
.notificationTime(LocalDateTime.of(2025, 2, 23, 6, 55))
811+
.isSent(false)
812+
.schedule(addedSchedule1)
813+
.build();
814+
notificationScheduleRepository.save(notificationSchedule);
802815

803816
// when
804817
scheduleService.modifySchedule(newUser.getId(), addedSchedule1.getScheduleId(), scheduleModDto);
@@ -859,6 +872,12 @@ void modifySchedule_withNewPlace() {
859872
.scheduleSpareTime(5)
860873
.latenessTime(10)
861874
.build();
875+
NotificationSchedule notificationSchedule = NotificationSchedule.builder()
876+
.notificationTime(LocalDateTime.of(2025, 2, 23, 6, 55))
877+
.isSent(false)
878+
.schedule(addedSchedule1)
879+
.build();
880+
notificationScheduleRepository.save(notificationSchedule);
862881

863882
// when
864883
scheduleService.modifySchedule(newUser.getId(), scheduleId, scheduleModDto);

0 commit comments

Comments
 (0)