Skip to content

Commit

Permalink
Refactor: getAnswerRecordDaysTest 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
gunGeongun committed Nov 9, 2024
1 parent 1b375b6 commit caa1fb8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,18 +241,19 @@ void answerToGroupQuestionTest() throws Exception {
assertThat(finalPoint).isEqualTo(100 + AnswerConstants.ANSWER_POINT);
}

//@Test
@Test
@DisplayName("해당 월에 질문이 있는 날짜 반환 테스트")
void getAnswerRecordDaysTest() throws Exception {
LocalDate date = LocalDate.of(2024, 11, 1); // 해당 월 전체 조회
int todayDay = LocalDate.now().getDayOfMonth();

mockMvc.perform(get("/api/answer/record/days")
.param("date", date.toString())
.requestAttr("userId", "1")
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(jsonPath("$.days").isArray())
.andExpect(jsonPath("$.days").value(org.hamcrest.Matchers.containsInAnyOrder(8)));
.andExpect(jsonPath("$.days").value(org.hamcrest.Matchers.containsInAnyOrder(todayDay)));

}

Expand Down

0 comments on commit caa1fb8

Please sign in to comment.