TA 역할 Spring 경계 smoke (role-ta-live-v2-001)

This commit is contained in:
forge-bot 2026-07-14 08:00:12 +00:00
parent c0edec657d
commit 66083b8c61

View file

@ -0,0 +1,26 @@
package com.runtimematrix.exception;
import com.runtimematrix.dto.ErrorResponse;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.test.web.servlet.MockMvc;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
@WebMvcTest
class GlobalExceptionHandlerTest {
@Autowired
private MockMvc mockMvc;
@Test
void businessException_returnsConsistentErrorFormat() throws Exception {
mockMvc.perform(get("/api/v1/roles/999"))
.andExpect(status().isNotFound())
.andExpect(jsonPath("$.code").value("ERR_ROLE_NOT_FOUND"))
.andExpect(jsonPath("$.timestamp").exists())
.andExpect(jsonPath("$.path").value("/api/v1/roles/999"));
}
}