Skip to content

Commit

Permalink
[test] : 질문 게시물 검색 쿼리에 최신순 정렬 추가 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
hyun2371 committed Aug 18, 2024
1 parent dd6632d commit 328e2b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ void searchQuestionPost() throws Exception {
.andExpect(status().isOk())
.andDo(MockMvcResultHandlers.print())
.andExpect(jsonPath("$.size").value(2))
.andExpect(jsonPath("$.content[0].questionPostId").value(questionPost1.getId()))
.andExpect(jsonPath("$.content[1].questionPostId").value(questionPost2.getId()));
.andExpect(jsonPath("$.content[0].questionPostId").value(questionPost2.getId())) //최신순 정렬
.andExpect(jsonPath("$.content[1].questionPostId").value(questionPost1.getId()));
}

@DisplayName("[질문글을 여러 직군들로 필터링할 수 있다.]")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void setup() {
member = memberRepository.save(MemberFixture.member());
}

@DisplayName("검색어로 필터링할 수 있다.")
@DisplayName("검색어로 필터링할 수 있다. 최신순으로 조회한다.")
@Test
void question_post_search_filter() {
//given
Expand All @@ -78,8 +78,8 @@ void question_post_search_filter() {
//then
Assertions.assertAll(
() -> assertThat(responses).hasSize(2),
() -> assertThat(responses.get(0).questionPostId()).isEqualTo(questionPost1.getId()),
() -> assertThat(responses.get(1).questionPostId()).isEqualTo(questionPost2.getId())
() -> assertThat(responses.get(0).questionPostId()).isEqualTo(questionPost2.getId()),
() -> assertThat(responses.get(1).questionPostId()).isEqualTo(questionPost1.getId())
);
}

Expand Down Expand Up @@ -107,8 +107,8 @@ void question_post_jobgroup_filter() {
//then
Assertions.assertAll(
() -> assertThat(responses).hasSize(2),
() -> assertThat(responses.get(0).questionPostId()).isEqualTo(questionPost1.getId()),
() -> assertThat(responses.get(1).questionPostId()).isEqualTo(questionPost2.getId())
() -> assertThat(responses.get(0).questionPostId()).isEqualTo(questionPost2.getId()),
() -> assertThat(responses.get(1).questionPostId()).isEqualTo(questionPost1.getId())
);
}

Expand Down

0 comments on commit 328e2b8

Please sign in to comment.