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