Skip to content

Commit

Permalink
refactor : 문제 목록 마감기간 기준 최신순 정렬 (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
rladmstn authored Nov 27, 2024
1 parent b8eb3f8 commit b4c4026
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

public class ProblemController {
private final ProblemService problemService;
private final String PROBLEM_SORT_BY = "startDate";
private final String PROBLEM_SORT_BY = "endDate";

@PostMapping(value = "/groups/{groupId}/problems")
@Operation(summary = "문제 생성 API")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ void editProblemDeadlineFailed_6() throws Exception {
@DisplayName("진행 중인 문제 목록 조회 성공")
void getProblemList() throws Exception {
// given
Pageable pageable = PageRequest.of(0, 20, Sort.by("startDate").descending());
Pageable pageable = PageRequest.of(0, 20, Sort.by("endDate").descending());
Page<GetProblemResponse> response = new PageImpl<>(new ArrayList<>());
when(problemService.getInProgressProblems(any(User.class), anyLong(), any(Pageable.class))).thenReturn(
response);
Expand All @@ -318,7 +318,7 @@ void getProblemList() throws Exception {
@DisplayName("문제 목록 조회 실패 : 권한 없음")
void getProblemListFailed_1() throws Exception {
// given
Pageable pageable = PageRequest.of(0, 20, Sort.by("startDate").descending());
Pageable pageable = PageRequest.of(0, 20, Sort.by("endDate").descending());
when(problemService.getInProgressProblems(any(User.class), anyLong(), any(Pageable.class))).thenThrow(
new ProblemValidationException(HttpStatus.FORBIDDEN.value(), "문제를 조회할 권한이 없습니다."));
// when, then
Expand Down

0 comments on commit b4c4026

Please sign in to comment.