Skip to content

Commit c9e4e6d

Browse files
committed
test(server): Add unit tests for McpServers
1 parent 95130fa commit c9e4e6d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/test/java/com/github/codeboyzhou/mcp/declarative/McpServersTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.github.codeboyzhou.mcp.declarative.annotation.McpPrompts;
44
import com.github.codeboyzhou.mcp.declarative.annotation.McpResources;
55
import com.github.codeboyzhou.mcp.declarative.annotation.McpTools;
6+
import com.github.codeboyzhou.mcp.declarative.common.GuiceInjectorModule;
67
import com.github.codeboyzhou.mcp.declarative.server.McpServerInfo;
78
import com.github.codeboyzhou.mcp.declarative.server.McpSseServerInfo;
89
import com.github.codeboyzhou.mcp.declarative.server.TestMcpComponentScanBasePackageClass;
@@ -12,7 +13,6 @@
1213
import com.github.codeboyzhou.mcp.declarative.server.TestMcpPrompts;
1314
import com.github.codeboyzhou.mcp.declarative.server.TestMcpResources;
1415
import com.github.codeboyzhou.mcp.declarative.server.TestMcpTools;
15-
import com.github.codeboyzhou.mcp.declarative.common.GuiceInjectorModule;
1616
import com.google.inject.Guice;
1717
import com.google.inject.Injector;
1818
import org.junit.jupiter.api.AfterEach;
@@ -73,7 +73,7 @@ void testRun(Class<?> applicationMainClass) {
7373
}
7474

7575
@Test
76-
void testStartSyncStdioServer() {
76+
void testStartStdioServer() {
7777
assertDoesNotThrow(() -> {
7878
McpServers servers = McpServers.run(TestMcpComponentScanIsNull.class, EMPTY_ARGS);
7979
McpServerInfo serverInfo = McpServerInfo.builder()
@@ -82,12 +82,12 @@ void testStartSyncStdioServer() {
8282
.name("test-mcp-sync-stdio-server")
8383
.version("1.0.0")
8484
.build();
85-
servers.startSyncStdioServer(serverInfo);
85+
servers.startStdioServer(serverInfo);
8686
});
8787
}
8888

8989
@Test
90-
void testStartSyncSseServer() {
90+
void testStartSseServer() {
9191
McpServers servers = McpServers.run(TestMcpComponentScanIsNull.class, EMPTY_ARGS);
9292
assertDoesNotThrow(() -> {
9393
McpSseServerInfo serverInfo = McpSseServerInfo.builder()
@@ -100,7 +100,7 @@ void testStartSyncSseServer() {
100100
.name("test-mcp-sync-sse-server")
101101
.version("1.0.0")
102102
.build();
103-
servers.startSyncSseServer(serverInfo);
103+
servers.startSseServer(serverInfo);
104104
});
105105
}
106106

0 commit comments

Comments
 (0)