File tree Expand file tree Collapse file tree 2 files changed +0
-29
lines changed
main/java/com/gamzabat/algohub/feature/problem/service
test/java/com/gamzabat/algohub/service Expand file tree Collapse file tree 2 files changed +0
-29
lines changed Original file line number Diff line number Diff line change @@ -128,11 +128,6 @@ private void checkProblemValidation(Problem problem) {
128128 throw new ProblemValidationException (HttpStatus .FORBIDDEN .value (),
129129 "문제 수정이 불가합니다. : 이미 종료된 문제입니다." );
130130 }
131- if (problem .getStartDate ().isBefore (LocalDate .now ()) || problem .getStartDate ().equals (LocalDate .now ())) {
132- throw new ProblemValidationException (HttpStatus .FORBIDDEN .value (),
133- "문제 수정이 불가합니다. : 이미 진행 중인 문제입니다." );
134- }
135-
136131 }
137132
138133 private void checkProblemEndDate (EditProblemRequest request , Problem problem ) {
Original file line number Diff line number Diff line change @@ -358,30 +358,6 @@ void editProblemFailed_4() {
358358 .hasFieldOrPropertyWithValue ("error" , "문제 수정 권한이 없습니다. 방장, 부방장일 경우에만 수정이 가능합니다." );
359359 }
360360
361- @ Test
362- @ DisplayName ("문제 정보 수정 실패 : 이미 진행 중인 문제인데 시작날짜 수정을 요청하는 경우" )
363- void editProblemFailed_5 () {
364- // given
365- Problem problem = Problem .builder ()
366- .studyGroup (group )
367- .link ("link" )
368- .startDate (LocalDate .now ().minusDays (1 ))
369- .endDate (LocalDate .now ().plusDays (10 ))
370- .build ();
371- EditProblemRequest request = EditProblemRequest .builder ()
372- .startDate (LocalDate .now ().plusDays (1 ))
373- .endDate (LocalDate .now ().plusDays (7 ))
374- .build ();
375- when (problemRepository .findById (20L )).thenReturn (Optional .ofNullable (problem ));
376- when (groupRepository .findById (10L )).thenReturn (Optional .ofNullable (group ));
377- when (groupMemberRepository .findByUserAndStudyGroup (user , group )).thenReturn (Optional .ofNullable (groupMember1 ));
378- // when, then
379- assertThatThrownBy (() -> problemService .editProblem (user , 20L , request ))
380- .isInstanceOf (ProblemValidationException .class )
381- .hasFieldOrPropertyWithValue ("code" , HttpStatus .FORBIDDEN .value ())
382- .hasFieldOrPropertyWithValue ("error" , "문제 수정이 불가합니다. : 이미 진행 중인 문제입니다." );
383- }
384-
385361 @ Test
386362 @ DisplayName ("문제 정보 수정 실패 : 문제 시작 날짜를 오늘 이전의 날짜로 요청한 경우" )
387363 void editProblemFailed_6 () {
You can’t perform that action at this time.
0 commit comments