LandvibeDev / web-chat-backend

Web Chat Application 🛩
1 stars 3 forks source link

테스트 케이스 실패한 경우에도 에러 메시지 출력하도록 변경 #31

Closed raccoonback closed 4 years ago

raccoonback commented 4 years ago

🍉 기존 기능

        mockMvc.perform(get("/api/rooms/{id}/messages", 1))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.*", not(empty())))
            .andExpect(jsonPath("$.*", hasSize(1)))
            .andExpect(jsonPath("$.messages[0].id", is(1)))
            .andExpect(jsonPath("$.messages[0].contents", is("foo")))
            .andExpect(jsonPath("$.messages[0].messageType", is("TEXT")))
                        .andDo(print());

📎 변경할 내용

        mockMvc.perform(get("/api/rooms/{id}/messages", 1))
            .andDo(print())
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.*", not(empty())))
            .andExpect(jsonPath("$.*", hasSize(1)))
            .andExpect(jsonPath("$.messages[0].id", is(1)))
            .andExpect(jsonPath("$.messages[0].contents", is("foo")))
            .andExpect(jsonPath("$.messages[0].messageType", is("TEXT")));

🌾 ps