@@ -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 () {
@@ -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,15 +388,15 @@ 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 (
397
395
new McpSchema .Tool ("tool1" , "tool1 description" , emptyJsonSchema ), (exchange , request ) -> {
398
396
// perform a blocking call to a remote service
399
397
String response = RestClient .create ()
400
398
.get ()
401
- .uri ("https://github. com/modelcontextprotocol/specification/blob /main/README.md" )
399
+ .uri ("https://raw.githubusercontent. com/modelcontextprotocol/java-sdk/refs/heads /main/README.md" )
402
400
.retrieve ()
403
401
.body (String .class );
404
402
assertThat (response ).isNotBlank ();
@@ -430,15 +428,15 @@ 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 (
437
435
new McpSchema .Tool ("tool1" , "tool1 description" , emptyJsonSchema ), (exchange , request ) -> {
438
436
// perform a blocking call to a remote service
439
437
String response = RestClient .create ()
440
438
.get ()
441
- .uri ("https://github. com/modelcontextprotocol/specification/blob /main/README.md" )
439
+ .uri ("https://raw.githubusercontent. com/modelcontextprotocol/java-sdk/refs/heads /main/README.md" )
442
440
.retrieve ()
443
441
.body (String .class );
444
442
assertThat (response ).isNotBlank ();
@@ -455,7 +453,7 @@ void testToolListChangeHandlingSuccess(String clientType) {
455
453
// perform a blocking call to a remote service
456
454
String response = RestClient .create ()
457
455
.get ()
458
- .uri ("https://github. com/modelcontextprotocol/specification/blob /main/README.md" )
456
+ .uri ("https://raw.githubusercontent. com/modelcontextprotocol/java-sdk/refs/heads /main/README.md" )
459
457
.retrieve ()
460
458
.body (String .class );
461
459
assertThat (response ).isNotBlank ();
@@ -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