Skip to content

Commit e119eb7

Browse files
committed
Minor test formating improvements
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
1 parent ad93613 commit e119eb7

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

auto-configurations/mcp/spring-ai-autoconfigure-mcp-server-webflux/src/test/java/org/springframework/ai/mcp/server/autoconfigure/SseWebClientWebFluxServerIT.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,9 @@ public List<McpServerFeatures.SyncToolSpecification> myTools() {
286286
""").build())
287287
.callHandler((exchange, request) -> {
288288

289-
exchange.progressNotification(
290-
new ProgressNotification("test-progress-token", 0.0, 1.0, "tool call start"));
289+
var progressToken = request.progressToken();
290+
291+
exchange.progressNotification(new ProgressNotification(progressToken, 0.0, 1.0, "tool call start"));
291292

292293
exchange.ping(); // call client ping
293294

@@ -301,7 +302,7 @@ public List<McpServerFeatures.SyncToolSpecification> myTools() {
301302
ElicitResult elicitationResult = exchange.createElicitation(elicitationRequest);
302303

303304
exchange.progressNotification(
304-
new ProgressNotification("test-progress-token", 0.50, 1.0, "elicitation completed"));
305+
new ProgressNotification(progressToken, 0.50, 1.0, "elicitation completed"));
305306

306307
// call sampling
307308
var createMessageRequest = McpSchema.CreateMessageRequest.builder()
@@ -317,8 +318,8 @@ public List<McpServerFeatures.SyncToolSpecification> myTools() {
317318

318319
CreateMessageResult samplingResponse = exchange.createMessage(createMessageRequest);
319320

320-
exchange.progressNotification(
321-
new ProgressNotification("test-progress-token", 1.0, 1.0, "sampling completed"));
321+
exchange
322+
.progressNotification(new ProgressNotification(progressToken, 1.0, 1.0, "sampling completed"));
322323

323324
return new McpSchema.CallToolResult(List.of(new McpSchema.TextContent(
324325
"CALL RESPONSE: " + samplingResponse.toString() + ", " + elicitationResult.toString())),

auto-configurations/mcp/spring-ai-autoconfigure-mcp-server-webflux/src/test/java/org/springframework/ai/mcp/server/autoconfigure/StatelessWebClientWebFluxServerIT.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ void clientServerCapabilities() {
137137
CallToolRequest toolRequest = CallToolRequest.builder()
138138
.name("tool1")
139139
.arguments(Map.of())
140-
.progressToken("test-progress-token")
141140
.build();
142141

143142
CallToolResult response = mcpClient.callTool(toolRequest);

auto-configurations/mcp/spring-ai-autoconfigure-mcp-server-webflux/src/test/java/org/springframework/ai/mcp/server/autoconfigure/StreamableWebClientWebFluxServerIT.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,9 @@ public List<McpServerFeatures.SyncToolSpecification> myTools() {
281281
}
282282
""").build())
283283
.callHandler((exchange, request) -> {
284+
var progressToken = request.progressToken();
284285

285-
exchange.progressNotification(
286-
new ProgressNotification("test-progress-token", 0.0, 1.0, "tool call start"));
286+
exchange.progressNotification(new ProgressNotification(progressToken, 0.0, 1.0, "tool call start"));
287287

288288
exchange.ping(); // call client ping
289289

@@ -297,7 +297,7 @@ public List<McpServerFeatures.SyncToolSpecification> myTools() {
297297
ElicitResult elicitationResult = exchange.createElicitation(elicitationRequest);
298298

299299
exchange.progressNotification(
300-
new ProgressNotification("test-progress-token", 0.50, 1.0, "elicitation completed"));
300+
new ProgressNotification(progressToken, 0.50, 1.0, "elicitation completed"));
301301

302302
// call sampling
303303
var createMessageRequest = McpSchema.CreateMessageRequest.builder()
@@ -313,8 +313,8 @@ public List<McpServerFeatures.SyncToolSpecification> myTools() {
313313

314314
CreateMessageResult samplingResponse = exchange.createMessage(createMessageRequest);
315315

316-
exchange.progressNotification(
317-
new ProgressNotification("test-progress-token", 1.0, 1.0, "sampling completed"));
316+
exchange
317+
.progressNotification(new ProgressNotification(progressToken, 1.0, 1.0, "sampling completed"));
318318

319319
return new McpSchema.CallToolResult(List.of(new McpSchema.TextContent(
320320
"CALL RESPONSE: " + samplingResponse.toString() + ", " + elicitationResult.toString())),

0 commit comments

Comments
 (0)