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 {
4141
4242 private HttpServletSseServerTransportProvider mcpServerTransportProvider ;
4343
44+ private static final int PORT = TomcatTestUtil .findAvailablePort ();
45+
4446 private static final String CUSTOM_MESSAGE_ENDPOINT = "/otherPath/mcp/message" ;
4547
4648 McpClient .SyncSpec clientBuilder ;
@@ -55,7 +57,7 @@ public void before() {
5557 .messageEndpoint (CUSTOM_MESSAGE_ENDPOINT )
5658 .build ();
5759
58- tomcat = TomcatTestUtil .createTomcatServer ("" , 3400 , mcpServerTransportProvider );
60+ tomcat = TomcatTestUtil .createTomcatServer ("" , PORT , mcpServerTransportProvider );
5961 try {
6062 tomcat .start ();
6163 assertThat (tomcat .getServer ().getState ()).isEqualTo (LifecycleState .STARTED );
@@ -64,7 +66,7 @@ public void before() {
6466 throw new RuntimeException ("Failed to start Tomcat" , e );
6567 }
6668
67- this .clientBuilder = McpClient .sync (HttpClientSseClientTransport .builder ("http://localhost:" + 3400 ).build ());
69+ this .clientBuilder = McpClient .sync (HttpClientSseClientTransport .builder ("http://localhost:" + PORT ).build ());
6870 }
6971
7072 @ AfterEach
You can’t perform that action at this time.
0 commit comments