package com.easyagents.agent.runtime.mcp;

import com.easyagents.agent.runtime.AgentRuntimeException;
import org.junit.Assert;
import org.junit.Test;

/**
 * 测试 MCP 连接方式解析。
 */
public class McpTransportTypeTest {

    @Test
    public void shouldParseCompatibleTransportValues() {
        Assert.assertEquals(McpTransportType.STDIO, McpTransportType.from(null));
        Assert.assertEquals(McpTransportType.STDIO, McpTransportType.from("stdio"));
        Assert.assertEquals(McpTransportType.SSE, McpTransportType.from("http-sse"));
        Assert.assertEquals(McpTransportType.SSE, McpTransportType.from("SSE"));
        Assert.assertEquals(McpTransportType.HTTP, McpTransportType.from("http-stream"));
        Assert.assertEquals(McpTransportType.HTTP, McpTransportType.from("HTTP"));
        Assert.assertEquals(McpTransportType.HTTP, McpTransportType.from("streamable-http"));
    }

    @Test(expected = AgentRuntimeException.class)
    public void shouldRejectUnsupportedTransportValue() {
        McpTransportType.from("websocket");
    }
}
