|
1 | 1 | package com.github.codeboyzhou.mcp.declarative;
|
2 | 2 |
|
3 | 3 | import com.github.codeboyzhou.mcp.declarative.annotation.McpTools;
|
4 |
| -import com.github.codeboyzhou.mcp.declarative.server.TestMcpTools; |
5 | 4 | import com.github.codeboyzhou.mcp.declarative.server.TestMcpComponentScanBasePackageClass;
|
6 | 5 | import com.github.codeboyzhou.mcp.declarative.server.TestMcpComponentScanBasePackageString;
|
7 | 6 | import com.github.codeboyzhou.mcp.declarative.server.TestMcpComponentScanDefault;
|
8 | 7 | import com.github.codeboyzhou.mcp.declarative.server.TestMcpComponentScanIsNull;
|
| 8 | +import com.github.codeboyzhou.mcp.declarative.server.TestMcpTools; |
9 | 9 | import org.junit.jupiter.api.AfterEach;
|
10 | 10 | import org.junit.jupiter.api.BeforeEach;
|
| 11 | +import org.junit.jupiter.api.Test; |
11 | 12 | import org.junit.jupiter.params.ParameterizedTest;
|
12 | 13 | import org.junit.jupiter.params.provider.ValueSource;
|
13 | 14 | import org.reflections.Reflections;
|
|
17 | 18 | import java.util.Map;
|
18 | 19 | import java.util.Set;
|
19 | 20 |
|
| 21 | +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; |
20 | 22 | import static org.junit.jupiter.api.Assertions.assertEquals;
|
21 | 23 | import static org.junit.jupiter.api.Assertions.assertNotNull;
|
22 | 24 |
|
@@ -52,6 +54,14 @@ void testRun(Class<?> applicationMainClass) {
|
52 | 54 | McpServers.run(applicationMainClass, EMPTY_ARGS);
|
53 | 55 | }
|
54 | 56 |
|
| 57 | + @Test |
| 58 | + void testStartSyncStdioServer() { |
| 59 | + assertDoesNotThrow(() -> { |
| 60 | + McpServers servers = McpServers.run(TestMcpComponentScanDefault.class, EMPTY_ARGS); |
| 61 | + servers.startSyncStdioServer("test-mcp-sync-stdio-server", "1.0.0"); |
| 62 | + }); |
| 63 | + } |
| 64 | + |
55 | 65 | private Reflections getReflectionsField() throws NoSuchFieldException, IllegalAccessException {
|
56 | 66 | Field reflectionsField = McpServers.class.getDeclaredField("reflections");
|
57 | 67 | reflectionsField.setAccessible(true);
|
|
0 commit comments