From 734153a445585cd452f041520583e6517f3674f3 Mon Sep 17 00:00:00 2001 From: jitokim Date: Sun, 6 Apr 2025 02:10:43 +0900 Subject: [PATCH] fix typo in WebFluxSseIntegrationTests Signed-off-by: jitokim --- .../WebFluxSseIntegrationTests.java | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/mcp-spring/mcp-spring-webflux/src/test/java/io/modelcontextprotocol/WebFluxSseIntegrationTests.java b/mcp-spring/mcp-spring-webflux/src/test/java/io/modelcontextprotocol/WebFluxSseIntegrationTests.java index 2be2f81..dbfad82 100644 --- a/mcp-spring/mcp-spring-webflux/src/test/java/io/modelcontextprotocol/WebFluxSseIntegrationTests.java +++ b/mcp-spring/mcp-spring-webflux/src/test/java/io/modelcontextprotocol/WebFluxSseIntegrationTests.java @@ -52,8 +52,6 @@ public class WebFluxSseIntegrationTests { private static final int PORT = 8182; - // private static final String MESSAGE_ENDPOINT = "/mcp/message"; - private static final String CUSTOM_SSE_ENDPOINT = "/somePath/sse"; private static final String CUSTOM_MESSAGE_ENDPOINT = "/otherPath/mcp/message"; @@ -62,7 +60,7 @@ public class WebFluxSseIntegrationTests { private WebFluxSseServerTransportProvider mcpServerTransportProvider; - ConcurrentHashMap clientBulders = new ConcurrentHashMap<>(); + ConcurrentHashMap clientBuilders = new ConcurrentHashMap<>(); @BeforeEach public void before() { @@ -77,11 +75,11 @@ public class WebFluxSseIntegrationTests { ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(httpHandler); this.httpServer = HttpServer.create().port(PORT).handle(adapter).bindNow(); - clientBulders.put("httpclient", + clientBuilders.put("httpclient", McpClient.sync(HttpClientSseClientTransport.builder("http://localhost:" + PORT) .sseEndpoint(CUSTOM_SSE_ENDPOINT) .build())); - clientBulders.put("webflux", + clientBuilders.put("webflux", McpClient .sync(WebFluxSseClientTransport.builder(WebClient.builder().baseUrl("http://localhost:" + PORT)) .sseEndpoint(CUSTOM_SSE_ENDPOINT) @@ -103,7 +101,7 @@ public class WebFluxSseIntegrationTests { @ValueSource(strings = { "httpclient", "webflux" }) void testCreateMessageWithoutSamplingCapabilities(String clientType) { - var clientBuilder = clientBulders.get(clientType); + var clientBuilder = clientBuilders.get(clientType); McpServerFeatures.AsyncToolSpecification tool = new McpServerFeatures.AsyncToolSpecification( new McpSchema.Tool("tool1", "tool1 description", emptyJsonSchema), (exchange, request) -> { @@ -134,7 +132,7 @@ public class WebFluxSseIntegrationTests { void testCreateMessageSuccess(String clientType) throws InterruptedException { // Client - var clientBuilder = clientBulders.get(clientType); + var clientBuilder = clientBuilders.get(clientType); Function samplingHandler = request -> { assertThat(request.messages()).hasSize(1); @@ -203,7 +201,7 @@ public class WebFluxSseIntegrationTests { @ParameterizedTest(name = "{0} : {displayName} ") @ValueSource(strings = { "httpclient", "webflux" }) void testRootsSuccess(String clientType) { - var clientBuilder = clientBulders.get(clientType); + var clientBuilder = clientBuilders.get(clientType); List roots = List.of(new Root("uri1://", "root1"), new Root("uri2://", "root2")); @@ -250,7 +248,7 @@ public class WebFluxSseIntegrationTests { @ValueSource(strings = { "httpclient", "webflux" }) void testRootsWithoutCapability(String clientType) { - var clientBuilder = clientBulders.get(clientType); + var clientBuilder = clientBuilders.get(clientType); McpServerFeatures.SyncToolSpecification tool = new McpServerFeatures.SyncToolSpecification( new McpSchema.Tool("tool1", "tool1 description", emptyJsonSchema), (exchange, request) -> { @@ -284,7 +282,7 @@ public class WebFluxSseIntegrationTests { @ParameterizedTest(name = "{0} : {displayName} ") @ValueSource(strings = { "httpclient", "webflux" }) void testRootsNotifciationWithEmptyRootsList(String clientType) { - var clientBuilder = clientBulders.get(clientType); + var clientBuilder = clientBuilders.get(clientType); AtomicReference> rootsRef = new AtomicReference<>(); var mcpServer = McpServer.sync(mcpServerTransportProvider) @@ -311,7 +309,7 @@ public class WebFluxSseIntegrationTests { @ParameterizedTest(name = "{0} : {displayName} ") @ValueSource(strings = { "httpclient", "webflux" }) void testRootsWithMultipleHandlers(String clientType) { - var clientBuilder = clientBulders.get(clientType); + var clientBuilder = clientBuilders.get(clientType); List roots = List.of(new Root("uri1://", "root1")); @@ -345,7 +343,7 @@ public class WebFluxSseIntegrationTests { @ValueSource(strings = { "httpclient", "webflux" }) void testRootsServerCloseWithActiveSubscription(String clientType) { - var clientBuilder = clientBulders.get(clientType); + var clientBuilder = clientBuilders.get(clientType); List roots = List.of(new Root("uri1://", "root1")); @@ -390,7 +388,7 @@ public class WebFluxSseIntegrationTests { @ValueSource(strings = { "httpclient", "webflux" }) void testToolCallSuccess(String clientType) { - var clientBuilder = clientBulders.get(clientType); + var clientBuilder = clientBuilders.get(clientType); var callResponse = new McpSchema.CallToolResult(List.of(new McpSchema.TextContent("CALL RESPONSE")), null); McpServerFeatures.SyncToolSpecification tool1 = new McpServerFeatures.SyncToolSpecification( @@ -430,7 +428,7 @@ public class WebFluxSseIntegrationTests { @ValueSource(strings = { "httpclient", "webflux" }) void testToolListChangeHandlingSuccess(String clientType) { - var clientBuilder = clientBulders.get(clientType); + var clientBuilder = clientBuilders.get(clientType); var callResponse = new McpSchema.CallToolResult(List.of(new McpSchema.TextContent("CALL RESPONSE")), null); McpServerFeatures.SyncToolSpecification tool1 = new McpServerFeatures.SyncToolSpecification( @@ -500,7 +498,7 @@ public class WebFluxSseIntegrationTests { @ValueSource(strings = { "httpclient", "webflux" }) void testInitialize(String clientType) { - var clientBuilder = clientBulders.get(clientType); + var clientBuilder = clientBuilders.get(clientType); var mcpServer = McpServer.sync(mcpServerTransportProvider).build();