Skip to content

Commit

Permalink
[test] 테스트코드 복구
Browse files Browse the repository at this point in the history
  • Loading branch information
suhhyun524 committed Nov 14, 2023
1 parent 7191ede commit 530d249
Showing 1 changed file with 12 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.filter.CharacterEncodingFilter;
import sungdong29.backend.BackendApplication;
import sungdong29.backend.domain.place.dto.response.PlaceListResponseDTO;
import sungdong29.backend.domain.place.service.PlaceService;

import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
Expand All @@ -23,6 +26,9 @@ public class PlaceControllerTest {

private MockMvc mockMvc;

@Autowired
PlaceService placeService;

@Autowired
ObjectMapper objectMapper;

Expand All @@ -34,30 +40,18 @@ void before(WebApplicationContext wac) {
.build();
}

@DisplayName("근처 장소 보드 조회")
@DisplayName("근처 장소 조회")
@Test
void getBoardPlaces() throws Exception {
void getListPlaces() {
// given
String xCoordinate = "127";
String yCoordinate = "37";

// when, then
mockMvc.perform(MockMvcRequestBuilders.get("/places/board?xCoordinate={xCoordinate}&yCoordinate={yCoordinate}", xCoordinate, yCoordinate)
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk());
}

@DisplayName("근처 장소 카드리스트 조회")
@Test
void getListPlaces() throws Exception {
// given
String xCoordinate = "127";
String yCoordinate = "37";
// when
PlaceListResponseDTO placeListDTO = placeService.getPlaceList(xCoordinate, yCoordinate);

// when, then
mockMvc.perform(MockMvcRequestBuilders.get("/places/card?xCoordinate={xCoordinate}&yCoordinate={yCoordinate}", xCoordinate, yCoordinate)
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk());
// then
assertThat(placeListDTO.getPlaces()).isNotNull();
}

@DisplayName("근처 장소 하나 조회")
Expand Down

0 comments on commit 530d249

Please sign in to comment.