@@ -52,8 +52,6 @@ public class WebFluxSseIntegrationTests {
52
52
53
53
private static final int PORT = 8182 ;
54
54
55
- // private static final String MESSAGE_ENDPOINT = "/mcp/message";
56
-
57
55
private static final String CUSTOM_SSE_ENDPOINT = "/somePath/sse" ;
58
56
59
57
private static final String CUSTOM_MESSAGE_ENDPOINT = "/otherPath/mcp/message" ;
@@ -62,7 +60,7 @@ public class WebFluxSseIntegrationTests {
62
60
63
61
private WebFluxSseServerTransportProvider mcpServerTransportProvider ;
64
62
65
- ConcurrentHashMap <String , McpClient .SyncSpec > clientBulders = new ConcurrentHashMap <>();
63
+ ConcurrentHashMap <String , McpClient .SyncSpec > clientBuilders = new ConcurrentHashMap <>();
66
64
67
65
@ BeforeEach
68
66
public void before () {
@@ -77,11 +75,11 @@ public void before() {
77
75
ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter (httpHandler );
78
76
this .httpServer = HttpServer .create ().port (PORT ).handle (adapter ).bindNow ();
79
77
80
- clientBulders .put ("httpclient" ,
78
+ clientBuilders .put ("httpclient" ,
81
79
McpClient .sync (HttpClientSseClientTransport .builder ("http://localhost:" + PORT )
82
80
.sseEndpoint (CUSTOM_SSE_ENDPOINT )
83
81
.build ()));
84
- clientBulders .put ("webflux" ,
82
+ clientBuilders .put ("webflux" ,
85
83
McpClient
86
84
.sync (WebFluxSseClientTransport .builder (WebClient .builder ().baseUrl ("http://localhost:" + PORT ))
87
85
.sseEndpoint (CUSTOM_SSE_ENDPOINT )
@@ -103,7 +101,7 @@ public void after() {
103
101
@ ValueSource (strings = { "httpclient" , "webflux" })
104
102
void testCreateMessageWithoutSamplingCapabilities (String clientType ) {
105
103
106
- var clientBuilder = clientBulders .get (clientType );
104
+ var clientBuilder = clientBuilders .get (clientType );
107
105
108
106
McpServerFeatures .AsyncToolSpecification tool = new McpServerFeatures .AsyncToolSpecification (
109
107
new McpSchema .Tool ("tool1" , "tool1 description" , emptyJsonSchema ), (exchange , request ) -> {
@@ -134,7 +132,7 @@ void testCreateMessageWithoutSamplingCapabilities(String clientType) {
134
132
void testCreateMessageSuccess (String clientType ) throws InterruptedException {
135
133
136
134
// Client
137
- var clientBuilder = clientBulders .get (clientType );
135
+ var clientBuilder = clientBuilders .get (clientType );
138
136
139
137
Function <CreateMessageRequest , CreateMessageResult > samplingHandler = request -> {
140
138
assertThat (request .messages ()).hasSize (1 );
@@ -203,7 +201,7 @@ void testCreateMessageSuccess(String clientType) throws InterruptedException {
203
201
@ ParameterizedTest (name = "{0} : {displayName} " )
204
202
@ ValueSource (strings = { "httpclient" , "webflux" })
205
203
void testRootsSuccess (String clientType ) {
206
- var clientBuilder = clientBulders .get (clientType );
204
+ var clientBuilder = clientBuilders .get (clientType );
207
205
208
206
List <Root > roots = List .of (new Root ("uri1://" , "root1" ), new Root ("uri2://" , "root2" ));
209
207
@@ -250,7 +248,7 @@ void testRootsSuccess(String clientType) {
250
248
@ ValueSource (strings = { "httpclient" , "webflux" })
251
249
void testRootsWithoutCapability (String clientType ) {
252
250
253
- var clientBuilder = clientBulders .get (clientType );
251
+ var clientBuilder = clientBuilders .get (clientType );
254
252
255
253
McpServerFeatures .SyncToolSpecification tool = new McpServerFeatures .SyncToolSpecification (
256
254
new McpSchema .Tool ("tool1" , "tool1 description" , emptyJsonSchema ), (exchange , request ) -> {
@@ -284,7 +282,7 @@ void testRootsWithoutCapability(String clientType) {
284
282
@ ParameterizedTest (name = "{0} : {displayName} " )
285
283
@ ValueSource (strings = { "httpclient" , "webflux" })
286
284
void testRootsNotifciationWithEmptyRootsList (String clientType ) {
287
- var clientBuilder = clientBulders .get (clientType );
285
+ var clientBuilder = clientBuilders .get (clientType );
288
286
289
287
AtomicReference <List <Root >> rootsRef = new AtomicReference <>();
290
288
var mcpServer = McpServer .sync (mcpServerTransportProvider )
@@ -311,7 +309,7 @@ void testRootsNotifciationWithEmptyRootsList(String clientType) {
311
309
@ ParameterizedTest (name = "{0} : {displayName} " )
312
310
@ ValueSource (strings = { "httpclient" , "webflux" })
313
311
void testRootsWithMultipleHandlers (String clientType ) {
314
- var clientBuilder = clientBulders .get (clientType );
312
+ var clientBuilder = clientBuilders .get (clientType );
315
313
316
314
List <Root > roots = List .of (new Root ("uri1://" , "root1" ));
317
315
@@ -345,7 +343,7 @@ void testRootsWithMultipleHandlers(String clientType) {
345
343
@ ValueSource (strings = { "httpclient" , "webflux" })
346
344
void testRootsServerCloseWithActiveSubscription (String clientType ) {
347
345
348
- var clientBuilder = clientBulders .get (clientType );
346
+ var clientBuilder = clientBuilders .get (clientType );
349
347
350
348
List <Root > roots = List .of (new Root ("uri1://" , "root1" ));
351
349
@@ -390,7 +388,7 @@ void testRootsServerCloseWithActiveSubscription(String clientType) {
390
388
@ ValueSource (strings = { "httpclient" , "webflux" })
391
389
void testToolCallSuccess (String clientType ) {
392
390
393
- var clientBuilder = clientBulders .get (clientType );
391
+ var clientBuilder = clientBuilders .get (clientType );
394
392
395
393
var callResponse = new McpSchema .CallToolResult (List .of (new McpSchema .TextContent ("CALL RESPONSE" )), null );
396
394
McpServerFeatures .SyncToolSpecification tool1 = new McpServerFeatures .SyncToolSpecification (
@@ -430,7 +428,7 @@ void testToolCallSuccess(String clientType) {
430
428
@ ValueSource (strings = { "httpclient" , "webflux" })
431
429
void testToolListChangeHandlingSuccess (String clientType ) {
432
430
433
- var clientBuilder = clientBulders .get (clientType );
431
+ var clientBuilder = clientBuilders .get (clientType );
434
432
435
433
var callResponse = new McpSchema .CallToolResult (List .of (new McpSchema .TextContent ("CALL RESPONSE" )), null );
436
434
McpServerFeatures .SyncToolSpecification tool1 = new McpServerFeatures .SyncToolSpecification (
@@ -500,7 +498,7 @@ void testToolListChangeHandlingSuccess(String clientType) {
500
498
@ ValueSource (strings = { "httpclient" , "webflux" })
501
499
void testInitialize (String clientType ) {
502
500
503
- var clientBuilder = clientBulders .get (clientType );
501
+ var clientBuilder = clientBuilders .get (clientType );
504
502
505
503
var mcpServer = McpServer .sync (mcpServerTransportProvider ).build ();
506
504
0 commit comments