Skip to content

Commit a2db082

Browse files
feat: 알림스케줄러쪽 코드 변경으로 인해 깨지는 테스트 코드 수정
1 parent 0426ec9 commit a2db082

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public class PreparationScheduleServiceTest {
3737
@Autowired
3838
private UserRepository userRepository;
3939

40+
@Autowired
41+
private NotificationScheduleRepository notificationScheduleRepository;
42+
4043
@Autowired
4144
private PreparationScheduleService preparationScheduleService;
4245

@@ -63,6 +66,7 @@ void makePreparationSchedules_withoutDeletingExisting() {
6366
.punctualityScore(-1f)
6467
.scheduleCountAfterReset(0)
6568
.latenessCountAfterReset(0)
69+
.spareTime(5)
6670
.build();
6771
userRepository.save(newUser);
6872

@@ -83,6 +87,12 @@ void makePreparationSchedules_withoutDeletingExisting() {
8387
.build();
8488
scheduleRepository.save(addedSchedule1);
8589

90+
NotificationSchedule notificationSchedule = NotificationSchedule.builder()
91+
.schedule(addedSchedule1)
92+
.notificationTime(LocalDateTime.of(2025, 1, 1, 0, 0))
93+
.build();
94+
notificationScheduleRepository.save(notificationSchedule);
95+
8696
UUID preparationSchedule1Id = UUID.randomUUID();
8797
UUID preparationSchedule2Id = UUID.randomUUID();
8898

@@ -112,6 +122,7 @@ void updatePreparationSchedules_withDeletingExisting() {
112122
.punctualityScore(-1f)
113123
.scheduleCountAfterReset(0)
114124
.latenessCountAfterReset(0)
125+
.spareTime(5)
115126
.build();
116127
userRepository.save(newUser);
117128

@@ -132,6 +143,12 @@ void updatePreparationSchedules_withDeletingExisting() {
132143
.build();
133144
scheduleRepository.save(addedSchedule1);
134145

146+
NotificationSchedule notificationSchedule = NotificationSchedule.builder()
147+
.schedule(addedSchedule1)
148+
.notificationTime(LocalDateTime.of(2025, 1, 1, 0, 0))
149+
.build();
150+
notificationScheduleRepository.save(notificationSchedule);
151+
135152
PreparationSchedule preparationSchedule3 = preparationScheduleRepository.save(new PreparationSchedule(
136153
UUID.randomUUID(), addedSchedule1, "화장", 10, null));
137154
PreparationSchedule preparationSchedule2= preparationScheduleRepository.save(new PreparationSchedule(
@@ -168,6 +185,7 @@ void handlePreparationSchedules_withoutDeletingExisting() {
168185
.punctualityScore(-1f)
169186
.scheduleCountAfterReset(0)
170187
.latenessCountAfterReset(0)
188+
.spareTime(5)
171189
.build();
172190
userRepository.save(newUser);
173191

@@ -188,6 +206,12 @@ void handlePreparationSchedules_withoutDeletingExisting() {
188206
.build();
189207
scheduleRepository.save(addedSchedule1);
190208

209+
NotificationSchedule notificationSchedule = NotificationSchedule.builder()
210+
.schedule(addedSchedule1)
211+
.notificationTime(LocalDateTime.of(2025, 1, 1, 0, 0))
212+
.build();
213+
notificationScheduleRepository.save(notificationSchedule);
214+
191215
UUID preparationSchedule1Id = UUID.randomUUID();
192216
UUID preparationSchedule2Id = UUID.randomUUID();
193217

@@ -217,6 +241,7 @@ void handlePreparationSchedules_withDeletingExisting() {
217241
.punctualityScore(-1f)
218242
.scheduleCountAfterReset(0)
219243
.latenessCountAfterReset(0)
244+
.spareTime(5)
220245
.build();
221246
userRepository.save(newUser);
222247

@@ -237,6 +262,12 @@ void handlePreparationSchedules_withDeletingExisting() {
237262
.build();
238263
scheduleRepository.save(addedSchedule1);
239264

265+
NotificationSchedule notificationSchedule = NotificationSchedule.builder()
266+
.schedule(addedSchedule1)
267+
.notificationTime(LocalDateTime.of(2025, 1, 1, 0, 0))
268+
.build();
269+
notificationScheduleRepository.save(notificationSchedule);
270+
240271
PreparationSchedule preparationSchedule3 = preparationScheduleRepository.save(new PreparationSchedule(
241272
UUID.randomUUID(), addedSchedule1, "화장", 10, null));
242273
PreparationSchedule preparationSchedule2= preparationScheduleRepository.save(new PreparationSchedule(

0 commit comments

Comments
 (0)