Move mcp-core integration tests to mcp-test package
- The integration tests pass with both Jackson 2 and Jackson 3. - Modified McpSchemaTests.testContentDeserializationWrongType to work with both Jackson 2 and Jackson 3. Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
This commit is contained in:
parent
c3b9ab09ea
commit
6f3906480d
2 changed files with 135 additions and 94 deletions
|
|
@ -11,6 +11,7 @@ import io.modelcontextprotocol.client.McpClient;
|
|||
import io.modelcontextprotocol.client.McpSyncClient;
|
||||
import io.modelcontextprotocol.client.transport.WebClientStreamableHttpTransport;
|
||||
import io.modelcontextprotocol.client.transport.WebFluxSseClientTransport;
|
||||
import io.modelcontextprotocol.json.McpJsonDefaults;
|
||||
import io.modelcontextprotocol.json.McpJsonMapper;
|
||||
import io.modelcontextprotocol.server.McpServer;
|
||||
import io.modelcontextprotocol.server.TestUtil;
|
||||
|
|
@ -194,7 +195,7 @@ public class WebFluxServerTransportSecurityIntegrationTests {
|
|||
TestOriginHeaderExchangeFilterFunction exchangeFilterFunction) {
|
||||
var transport = WebFluxSseClientTransport
|
||||
.builder(WebClient.builder().baseUrl(baseUrl).filter(exchangeFilterFunction))
|
||||
.jsonMapper(McpJsonMapper.getDefault())
|
||||
.jsonMapper(McpJsonDefaults.getDefaultMcpJsonMapper())
|
||||
.build();
|
||||
return McpClient.sync(transport).initializationTimeout(Duration.ofMillis(500)).build();
|
||||
}
|
||||
|
|
@ -226,7 +227,7 @@ public class WebFluxServerTransportSecurityIntegrationTests {
|
|||
TestOriginHeaderExchangeFilterFunction exchangeFilterFunction) {
|
||||
var transport = WebClientStreamableHttpTransport
|
||||
.builder(WebClient.builder().baseUrl(baseUrl).filter(exchangeFilterFunction))
|
||||
.jsonMapper(McpJsonMapper.getDefault())
|
||||
.jsonMapper(McpJsonDefaults.getDefaultMcpJsonMapper())
|
||||
.openConnectionOnStartup(true)
|
||||
.build();
|
||||
return McpClient.sync(transport).initializationTimeout(Duration.ofMillis(500)).build();
|
||||
|
|
@ -259,7 +260,7 @@ public class WebFluxServerTransportSecurityIntegrationTests {
|
|||
TestOriginHeaderExchangeFilterFunction exchangeFilterFunction) {
|
||||
var transport = WebClientStreamableHttpTransport
|
||||
.builder(WebClient.builder().baseUrl(baseUrl).filter(exchangeFilterFunction))
|
||||
.jsonMapper(McpJsonMapper.getDefault())
|
||||
.jsonMapper(McpJsonDefaults.getDefaultMcpJsonMapper())
|
||||
.openConnectionOnStartup(true)
|
||||
.build();
|
||||
return McpClient.sync(transport).initializationTimeout(Duration.ofMillis(500)).build();
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import io.modelcontextprotocol.client.transport.HttpClientSseClientTransport;
|
|||
import io.modelcontextprotocol.client.transport.HttpClientStreamableHttpTransport;
|
||||
import io.modelcontextprotocol.client.transport.customizer.McpSyncHttpClientRequestCustomizer;
|
||||
import io.modelcontextprotocol.common.McpTransportContext;
|
||||
import io.modelcontextprotocol.json.McpJsonDefaults;
|
||||
import io.modelcontextprotocol.json.McpJsonMapper;
|
||||
import io.modelcontextprotocol.server.McpServer;
|
||||
import io.modelcontextprotocol.server.McpStatelessSyncServer;
|
||||
|
|
@ -209,7 +210,7 @@ public class ServerTransportSecurityIntegrationTests {
|
|||
McpSyncClient createMcpClient(McpSyncHttpClientRequestCustomizer requestCustomizer) {
|
||||
var transport = HttpClientSseClientTransport.builder(baseUrl)
|
||||
.httpRequestCustomizer(requestCustomizer)
|
||||
.jsonMapper(McpJsonMapper.getDefault())
|
||||
.jsonMapper(McpJsonDefaults.getDefaultMcpJsonMapper())
|
||||
.build();
|
||||
return McpClient.sync(transport).initializationTimeout(Duration.ofMillis(500)).build();
|
||||
}
|
||||
|
|
@ -248,7 +249,7 @@ public class ServerTransportSecurityIntegrationTests {
|
|||
McpSyncClient createMcpClient(McpSyncHttpClientRequestCustomizer requestCustomizer) {
|
||||
var transport = HttpClientStreamableHttpTransport.builder(baseUrl)
|
||||
.httpRequestCustomizer(requestCustomizer)
|
||||
.jsonMapper(McpJsonMapper.getDefault())
|
||||
.jsonMapper(McpJsonDefaults.getDefaultMcpJsonMapper())
|
||||
.openConnectionOnStartup(true)
|
||||
.build();
|
||||
return McpClient.sync(transport).initializationTimeout(Duration.ofMillis(500)).build();
|
||||
|
|
@ -286,7 +287,7 @@ public class ServerTransportSecurityIntegrationTests {
|
|||
McpSyncClient createMcpClient(McpSyncHttpClientRequestCustomizer requestCustomizer) {
|
||||
var transport = HttpClientStreamableHttpTransport.builder(baseUrl)
|
||||
.httpRequestCustomizer(requestCustomizer)
|
||||
.jsonMapper(McpJsonMapper.getDefault())
|
||||
.jsonMapper(McpJsonDefaults.getDefaultMcpJsonMapper())
|
||||
.openConnectionOnStartup(true)
|
||||
.build();
|
||||
return McpClient.sync(transport).initializationTimeout(Duration.ofMillis(500)).build();
|
||||
|
|
|
|||
Loading…
Reference in a new issue