Skip to content

Commit 7795757

Browse files
committed
test(recruit-board): 모집글 수정 기능 변경에 따른 테스트
- region 필드 추가
1 parent 0fa62f5 commit 7795757

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

src/test/java/com/somemore/recruitboard/controller/RecruitBoardCommandApiControllerTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ void updateRecruitBoard() throws Exception {
135135
RecruitBoardUpdateRequestDto requestDto = RecruitBoardUpdateRequestDto.builder()
136136
.title("서울 청계천 환경 미화 봉사 모집")
137137
.content("서울 청계천 주변 환경 미화 봉사 모집합니다. <br>")
138+
.region("서울 특별시")
138139
.recruitmentCount(10)
139140
.volunteerStartDateTime(startDateTime)
140141
.volunteerEndDateTime(endDateTime)

src/test/java/com/somemore/recruitboard/domain/RecruitmentInfoTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,15 @@ void updateRecruitmentInfo() {
5555
// given
5656
RecruitmentInfo recruitmentInfo = createRecruitmentInfo();
5757

58+
String region = "서울특별시";
5859
Integer count = 2;
5960
VolunteerCategory volunteerCategory = SAFETY_PREVENTION;
6061
LocalDateTime startDateTime = createUpdateStartDateTime();
6162
LocalDateTime endDateTime = startDateTime.plusHours(2);
6263
Boolean admitted = false;
6364

6465
// when
65-
recruitmentInfo.updateWith(count, volunteerCategory, startDateTime,
66+
recruitmentInfo.updateWith(region, count, volunteerCategory, startDateTime,
6667
endDateTime, admitted);
6768

6869
// then
@@ -99,7 +100,7 @@ void updateRecruitBoardWithInValidVolunteerTime(long minutesOffset) {
99100

100101
// when & then
101102
assertThatThrownBy(
102-
() -> recruitmentInfo.updateWith(3, ADMINISTRATIVE_SUPPORT, startDateTime, endDateTime,
103+
() -> recruitmentInfo.updateWith("",3, ADMINISTRATIVE_SUPPORT, startDateTime, endDateTime,
103104
false)
104105
).isInstanceOf(IllegalArgumentException.class);
105106

src/test/java/com/somemore/recruitboard/service/command/UpdateRecruitBoardServiceTest.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,15 @@ void updateRecruitBoard() {
6868
LocalDateTime newEndDateTime = newStartDateTime.plusHours(3);
6969
String newImgUrl = "https://image.domain.com/updates";
7070
RecruitBoardUpdateRequestDto dto = RecruitBoardUpdateRequestDto.builder()
71-
.title("업데이트 제목")
72-
.content("업데이트 내용")
73-
.recruitmentCount(1111)
74-
.volunteerStartDateTime(newStartDateTime)
75-
.volunteerEndDateTime(newEndDateTime)
76-
.volunteerCategory(ADMINISTRATIVE_SUPPORT)
77-
.admitted(false)
78-
.build();
71+
.title("업데이트 제목")
72+
.content("업데이트 내용")
73+
.recruitmentCount(1111)
74+
.region("서울특별시")
75+
.volunteerStartDateTime(newStartDateTime)
76+
.volunteerEndDateTime(newEndDateTime)
77+
.volunteerCategory(ADMINISTRATIVE_SUPPORT)
78+
.admitted(false)
79+
.build();
7980

8081
// when
8182
updateRecruitBoardService.updateRecruitBoard(dto, recruitBoard.getId(), centerId,

0 commit comments

Comments
 (0)