Skip to content

Commit

Permalink
refactor: 클래스명 변경에 따른 변수명 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
seokmyungham committed Jul 25, 2024
1 parent bc4def3 commit 3514227
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ void create() {
AvailableDate tomorrow = availableDateRepository.save(new AvailableDate(LocalDate.now().plusDays(1), meeting));

List<LocalTime> times = List.of(Timeslot.TIME_0100.getLocalTime(), Timeslot.TIME_0130.getLocalTime());
List<DateTimesCreateRequest> dateWithTimes = List.of(
List<DateTimesCreateRequest> dateTimes = List.of(
new DateTimesCreateRequest(today.getDate(), times),
new DateTimesCreateRequest(tomorrow.getDate(), times)
);

ScheduleCreateRequest request = new ScheduleCreateRequest(attendee.name(), dateWithTimes);
ScheduleCreateRequest request = new ScheduleCreateRequest(attendee.name(), dateTimes);

RestAssured.given().log().all()
.contentType(ContentType.JSON)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.woowacourse.momo.support.IsolateDatabase;
import java.time.LocalDate;
import java.time.LocalTime;
import java.util.ArrayList;
import java.util.List;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
Expand Down Expand Up @@ -54,7 +53,7 @@ class ScheduleServiceTest {
private Attendee attendee;
private AvailableDate today;
private AvailableDate tomorrow;
private List<DateTimesCreateRequest> dateWithTimes;
private List<DateTimesCreateRequest> dateTimes;

@BeforeEach
void setUp() {
Expand All @@ -65,17 +64,17 @@ void setUp() {

List<LocalTime> times = List.of(Timeslot.TIME_0100.getLocalTime(), Timeslot.TIME_0130.getLocalTime());

dateWithTimes = new ArrayList<>(List.of(
dateTimes = List.of(
new DateTimesCreateRequest(today.getDate(), times),
new DateTimesCreateRequest(tomorrow.getDate(), times)
));
);
}

@DisplayName("스케줄 생성 요청의 UUID가 존재하지 않으면 예외를 발생시킨다.")
@Test
void throwsExceptionWhenInvalidUUID() {
Meeting other = MeetingFixture.DINNER.create();
ScheduleCreateRequest request = new ScheduleCreateRequest(attendee.name(), dateWithTimes);
ScheduleCreateRequest request = new ScheduleCreateRequest(attendee.name(), dateTimes);

assertThatThrownBy(() -> scheduleService.create(other.getUuid(), request))
.isInstanceOf(MomoException.class)
Expand All @@ -86,7 +85,7 @@ void throwsExceptionWhenInvalidUUID() {
@Test
void throwsExceptionWhenInvalidAttendee() {
String invalidAttendee = "invalidAttendee";
ScheduleCreateRequest request = new ScheduleCreateRequest(invalidAttendee, dateWithTimes);
ScheduleCreateRequest request = new ScheduleCreateRequest(invalidAttendee, dateTimes);

assertThatThrownBy(() -> scheduleService.create(meeting.getUuid(), request))
.isInstanceOf(MomoException.class)
Expand All @@ -96,7 +95,7 @@ void throwsExceptionWhenInvalidAttendee() {
@DisplayName("스케줄 생성 시 사용자의 기존 스케줄들을 모두 삭제하고 새로운 스케줄을 저장한다.")
@Test
void createSchedulesReplacesOldSchedules() {
ScheduleCreateRequest request = new ScheduleCreateRequest(attendee.name(), dateWithTimes);
ScheduleCreateRequest request = new ScheduleCreateRequest(attendee.name(), dateTimes);
scheduleRepository.saveAll(List.of(
new Schedule(attendee, today, Timeslot.TIME_0130),
new Schedule(attendee, tomorrow, Timeslot.TIME_0130)
Expand Down

0 comments on commit 3514227

Please sign in to comment.