Closed so3500 closed 4 years ago
ref. CardControllerIntegrationTest#createCard
ref. CardController#createCard
ref. CardControllerTest#createCard_titleIsEmpty
import static org.hamcrest.Matchers.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.BDDMockito.*; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
{ "rooms": [ // jsonPath: $.rooms { "id": 1, // jsonPath: $.rooms[0].id "title": "study spring" // jsonPath: $.rooms[0].title }, { "id": 2, // jsonPath: $.rooms[1].id "title": "study react" // jsonPath: $.rooms[1].title }, { "id": 3, "title": "landvibeDev" } ] }
🥤 추가 기능
RoomControllerIntegrationTest#createRoom 구현
ref. CardControllerIntegrationTest#createCard
RoomControllerTest#createRoom 구현
ref. CardController#createCard
RoomControllerTest#createRoom_titleLengthLessThan_2 구현
ref. CardControllerTest#createCard_titleIsEmpty
참고
테스트 코드 작성 시 참고할 클래스
json-path/JsonPath