File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
mcp/src/test/java/io/modelcontextprotocol/server Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ class McpCompletionTests {
41
41
42
42
private HttpServletSseServerTransportProvider mcpServerTransportProvider ;
43
43
44
+ private static final int PORT = TomcatTestUtil .findAvailablePort ();
45
+
44
46
private static final String CUSTOM_MESSAGE_ENDPOINT = "/otherPath/mcp/message" ;
45
47
46
48
McpClient .SyncSpec clientBuilder ;
@@ -55,7 +57,7 @@ public void before() {
55
57
.messageEndpoint (CUSTOM_MESSAGE_ENDPOINT )
56
58
.build ();
57
59
58
- tomcat = TomcatTestUtil .createTomcatServer ("" , 3400 , mcpServerTransportProvider );
60
+ tomcat = TomcatTestUtil .createTomcatServer ("" , PORT , mcpServerTransportProvider );
59
61
try {
60
62
tomcat .start ();
61
63
assertThat (tomcat .getServer ().getState ()).isEqualTo (LifecycleState .STARTED );
@@ -64,7 +66,7 @@ public void before() {
64
66
throw new RuntimeException ("Failed to start Tomcat" , e );
65
67
}
66
68
67
- this .clientBuilder = McpClient .sync (HttpClientSseClientTransport .builder ("http://localhost:" + 3400 ).build ());
69
+ this .clientBuilder = McpClient .sync (HttpClientSseClientTransport .builder ("http://localhost:" + PORT ).build ());
68
70
}
69
71
70
72
@ AfterEach
You can’t perform that action at this time.
0 commit comments