Refine McpJsonDefaults method names (#789)

As a follow-up of #779, this commit refines McpJsonDefaults
method names by shortening them to not repeat the qualifiers
already expressed at type level.
This commit is contained in:
Sébastien Deleuze 2026-02-13 16:54:01 +01:00 • committed by GitHub
commit e60a0743a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 94 additions and 108 deletions

View file

@ -600,9 +600,8 @@ public class WebMvcSseServerTransportProvider implements McpServerTransportProvi
if (messageEndpoint == null) {
throw new IllegalStateException("MessageEndpoint must be set");
}
return new WebMvcSseServerTransportProvider(
jsonMapper == null ? McpJsonDefaults.getDefaultMcpJsonMapper() : jsonMapper, baseUrl,
messageEndpoint, sseEndpoint, keepAliveInterval, contextExtractor, securityValidator);
return new WebMvcSseServerTransportProvider(jsonMapper == null ? McpJsonDefaults.getMapper() : jsonMapper,
baseUrl, messageEndpoint, sseEndpoint, keepAliveInterval, contextExtractor, securityValidator);
}
}

View file

@ -264,9 +264,8 @@ public class WebMvcStatelessServerTransport implements McpStatelessServerTranspo
*/
public WebMvcStatelessServerTransport build() {
Assert.notNull(mcpEndpoint, "Message endpoint must be set");
return new WebMvcStatelessServerTransport(
jsonMapper == null ? McpJsonDefaults.getDefaultMcpJsonMapper() : jsonMapper, mcpEndpoint,
contextExtractor, securityValidator);
return new WebMvcStatelessServerTransport(jsonMapper == null ? McpJsonDefaults.getMapper() : jsonMapper,
mcpEndpoint, contextExtractor, securityValidator);
}
}

View file

@ -731,8 +731,8 @@ public class WebMvcStreamableServerTransportProvider implements McpStreamableSer
public WebMvcStreamableServerTransportProvider build() {
Assert.notNull(this.mcpEndpoint, "MCP endpoint must be set");
return new WebMvcStreamableServerTransportProvider(
jsonMapper == null ? McpJsonDefaults.getDefaultMcpJsonMapper() : jsonMapper, mcpEndpoint,
disallowDelete, contextExtractor, keepAliveInterval, securityValidator);
jsonMapper == null ? McpJsonDefaults.getMapper() : jsonMapper, mcpEndpoint, disallowDelete,
contextExtractor, keepAliveInterval, securityValidator);
}
}

View file

@ -239,7 +239,7 @@ public class ServerTransportSecurityIntegrationTests {
McpSyncClient createMcpClient(McpSyncHttpClientRequestCustomizer requestCustomizer) {
var transport = HttpClientSseClientTransport.builder(baseUrl)
.httpRequestCustomizer(requestCustomizer)
.jsonMapper(McpJsonDefaults.getDefaultMcpJsonMapper())
.jsonMapper(McpJsonDefaults.getMapper())
.build();
return McpClient.sync(transport).initializationTimeout(Duration.ofMillis(500)).build();
}
@ -278,7 +278,7 @@ public class ServerTransportSecurityIntegrationTests {
McpSyncClient createMcpClient(McpSyncHttpClientRequestCustomizer requestCustomizer) {
var transport = HttpClientStreamableHttpTransport.builder(baseUrl)
.httpRequestCustomizer(requestCustomizer)
.jsonMapper(McpJsonDefaults.getDefaultMcpJsonMapper())
.jsonMapper(McpJsonDefaults.getMapper())
.openConnectionOnStartup(true)
.build();
return McpClient.sync(transport).initializationTimeout(Duration.ofMillis(500)).build();
@ -316,7 +316,7 @@ public class ServerTransportSecurityIntegrationTests {
McpSyncClient createMcpClient(McpSyncHttpClientRequestCustomizer requestCustomizer) {
var transport = HttpClientStreamableHttpTransport.builder(baseUrl)
.httpRequestCustomizer(requestCustomizer)
.jsonMapper(McpJsonDefaults.getDefaultMcpJsonMapper())
.jsonMapper(McpJsonDefaults.getMapper())
.openConnectionOnStartup(true)
.build();
return McpClient.sync(transport).initializationTimeout(Duration.ofMillis(500)).build();

View file

@ -105,7 +105,7 @@ class WebMvcSseServerTransportProviderTests {
.baseUrl("http://localhost:" + PORT + "/")
.messageEndpoint(MESSAGE_ENDPOINT)
.sseEndpoint(WebMvcSseServerTransportProvider.DEFAULT_SSE_ENDPOINT)
.jsonMapper(McpJsonDefaults.getDefaultMcpJsonMapper())
.jsonMapper(McpJsonDefaults.getMapper())
.contextExtractor(req -> McpTransportContext.EMPTY)
.build();
}