package com.starry.admin.api;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

import org.junit.jupiter.api.Test;

class HealthControllerApiTest extends AbstractApiTest {

    @Test
    // 测试用例：模拟带上默认用户与租户请求 /health/ping 接口，校验接口必须返回 200 且 data = "pong"，确认健康检查链路畅通。
    void pingReturnsPong() throws Exception {
        mockMvc.perform(get("/health/ping")
                        .header(USER_HEADER, DEFAULT_USER)
                        .header(TENANT_HEADER, DEFAULT_TENANT))
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.code").value(200))
                .andExpect(jsonPath("$.data").value("pong"));
    }
}
