LandvibeDev / web-chat-backend

Web Chat Application 🛩
1 stars 3 forks source link

채팅방 목록 내려주는 api 관련 tc 추가 #20

Closed so3500 closed 4 years ago

so3500 commented 4 years ago

🥤 추가 기능

RoomControllerIntegrationTest#getRooms 구현

ref. CardControllerIntegrationTest#getCards

RoomControllerTest#getRooms 구현

ref. CardController#getCards

RoomControllerTest#createRoom_titleLengthExceed_20 구현

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.*;

json-path/JsonPath

{
    "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"
        }
    ]
}