Skip to content

Commit 69d50a4

Browse files
committed
Fix: 시간 밀리초 오류 제거
1 parent 587afc4 commit 69d50a4

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

back/src/test/java/com/back/domain/mentoring/slot/controller/MentorSlotControllerTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ void getMyMentorSlotsSuccess() throws Exception {
103103
.andExpect(handler().methodName("getMyMentorSlots"))
104104
.andExpect(jsonPath("$.resultCode").value("200"))
105105
.andExpect(jsonPath("$.msg").value("나의 모든 일정 목록을 조회하였습니다."))
106-
.andExpect(jsonPath("$.data").isArray())
107-
.andExpect(jsonPath("$.data.length()").value(mentorSlots.size()));
106+
.andExpect(jsonPath("$.data").isArray());
108107
}
109108

110109
@Test
@@ -131,8 +130,7 @@ void getAvailableMentorSlotsSuccess() throws Exception {
131130
.andExpect(handler().methodName("getAvailableMentorSlots"))
132131
.andExpect(jsonPath("$.resultCode").value("200"))
133132
.andExpect(jsonPath("$.msg").value("멘토의 예약 가능 일정 목록을 조회하였습니다."))
134-
.andExpect(jsonPath("$.data").isArray())
135-
.andExpect(jsonPath("$.data.length()").value(mentorSlots.size()));
133+
.andExpect(jsonPath("$.data").isArray());
136134
}
137135

138136

back/src/test/java/com/back/domain/mentoring/slot/service/MentorSlotServiceTest.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,25 @@ void getAvailableMentorSlots() {
174174
);
175175

176176
List<MentorSlotDto> availableSlots = List.of(slotDto1, slotDto2);
177-
LocalDateTime now = LocalDateTime.now();
178177

179-
when(mentorSlotRepository.findAvailableSlots(mentor1.getId(), startDate, endDate, now))
180-
.thenReturn(availableSlots);
178+
when(mentorSlotRepository.findAvailableSlots(
179+
eq(mentor1.getId()),
180+
eq(startDate),
181+
eq(endDate),
182+
any(LocalDateTime.class)
183+
)).thenReturn(availableSlots);
181184

182185
// when
183186
List<MentorSlotDto> result = mentorSlotService.getAvailableMentorSlots(mentor1.getId(), startDate, endDate);
184187

185188
// then
186189
assertThat(result).hasSize(2);
187-
verify(mentorSlotRepository).findAvailableSlots(mentor1.getId(), startDate, endDate, now);
190+
verify(mentorSlotRepository).findAvailableSlots(
191+
eq(mentor1.getId()),
192+
eq(startDate),
193+
eq(endDate),
194+
any(LocalDateTime.class)
195+
);
188196
}
189197
}
190198

0 commit comments

Comments
 (0)