Intro::
@ParameterizedTest
์ ์ฌ์ฉํ๋ค๋ฉด ๋งค๊ฐ๋ณ์๋ก ํ ์คํธ ์ธ์๋ฅผ ์ฃผ์ด ๋์ผํ ํ ์คํธ๋ฅผ ์คํํ ์ ์๋ค.
ย
@ParameterizedTest @EnumSource(NewsCategory.class) @DisplayName("success") void success(NewsCategory category) throws Exception { // given System.out.println(category); String url = "/" + category; // when, then String contentAsString = mockMvc.perform(get(url)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(); HotNewsResponseDtoList responseDto = objectMapper.readValue(contentAsString, HotNewsResponseDtoList.class); Assertions.assertThat(responseDto.getHotNewsResponseDtoList().size()).isEqualTo(newsCnt); }
ย
Loading Comments...