fix typo in WebFluxSseIntegrationTests
Signed-off-by: jitokim <pigberger70@gmail.com>
This commit is contained in:
parent
cd624a7d57
commit
734153a445
1 changed files with 13 additions and 15 deletions
|
|
@ -52,8 +52,6 @@ public class WebFluxSseIntegrationTests {
|
|||
|
||||
private static final int PORT = 8182;
|
||||
|
||||
// private static final String MESSAGE_ENDPOINT = "/mcp/message";
|
||||
|
||||
private static final String CUSTOM_SSE_ENDPOINT = "/somePath/sse";
|
||||
|
||||
private static final String CUSTOM_MESSAGE_ENDPOINT = "/otherPath/mcp/message";
|
||||
|
|
@ -62,7 +60,7 @@ public class WebFluxSseIntegrationTests {
|
|||
|
||||
private WebFluxSseServerTransportProvider mcpServerTransportProvider;
|
||||
|
||||
ConcurrentHashMap<String, McpClient.SyncSpec> clientBulders = new ConcurrentHashMap<>();
|
||||
ConcurrentHashMap<String, McpClient.SyncSpec> clientBuilders = new ConcurrentHashMap<>();
|
||||
|
||||
@BeforeEach
|
||||
public void before() {
|
||||
|
|
@ -77,11 +75,11 @@ public class WebFluxSseIntegrationTests {
|
|||
ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(httpHandler);
|
||||
this.httpServer = HttpServer.create().port(PORT).handle(adapter).bindNow();
|
||||
|
||||
clientBulders.put("httpclient",
|
||||
clientBuilders.put("httpclient",
|
||||
McpClient.sync(HttpClientSseClientTransport.builder("http://localhost:" + PORT)
|
||||
.sseEndpoint(CUSTOM_SSE_ENDPOINT)
|
||||
.build()));
|
||||
clientBulders.put("webflux",
|
||||
clientBuilders.put("webflux",
|
||||
McpClient
|
||||
.sync(WebFluxSseClientTransport.builder(WebClient.builder().baseUrl("http://localhost:" + PORT))
|
||||
.sseEndpoint(CUSTOM_SSE_ENDPOINT)
|
||||
|
|
@ -103,7 +101,7 @@ public class WebFluxSseIntegrationTests {
|
|||
@ValueSource(strings = { "httpclient", "webflux" })
|
||||
void testCreateMessageWithoutSamplingCapabilities(String clientType) {
|
||||
|
||||
var clientBuilder = clientBulders.get(clientType);
|
||||
var clientBuilder = clientBuilders.get(clientType);
|
||||
|
||||
McpServerFeatures.AsyncToolSpecification tool = new McpServerFeatures.AsyncToolSpecification(
|
||||
new McpSchema.Tool("tool1", "tool1 description", emptyJsonSchema), (exchange, request) -> {
|
||||
|
|
@ -134,7 +132,7 @@ public class WebFluxSseIntegrationTests {
|
|||
void testCreateMessageSuccess(String clientType) throws InterruptedException {
|
||||
|
||||
// Client
|
||||
var clientBuilder = clientBulders.get(clientType);
|
||||
var clientBuilder = clientBuilders.get(clientType);
|
||||
|
||||
Function<CreateMessageRequest, CreateMessageResult> samplingHandler = request -> {
|
||||
assertThat(request.messages()).hasSize(1);
|
||||
|
|
@ -203,7 +201,7 @@ public class WebFluxSseIntegrationTests {
|
|||
@ParameterizedTest(name = "{0} : {displayName} ")
|
||||
@ValueSource(strings = { "httpclient", "webflux" })
|
||||
void testRootsSuccess(String clientType) {
|
||||
var clientBuilder = clientBulders.get(clientType);
|
||||
var clientBuilder = clientBuilders.get(clientType);
|
||||
|
||||
List<Root> roots = List.of(new Root("uri1://", "root1"), new Root("uri2://", "root2"));
|
||||
|
||||
|
|
@ -250,7 +248,7 @@ public class WebFluxSseIntegrationTests {
|
|||
@ValueSource(strings = { "httpclient", "webflux" })
|
||||
void testRootsWithoutCapability(String clientType) {
|
||||
|
||||
var clientBuilder = clientBulders.get(clientType);
|
||||
var clientBuilder = clientBuilders.get(clientType);
|
||||
|
||||
McpServerFeatures.SyncToolSpecification tool = new McpServerFeatures.SyncToolSpecification(
|
||||
new McpSchema.Tool("tool1", "tool1 description", emptyJsonSchema), (exchange, request) -> {
|
||||
|
|
@ -284,7 +282,7 @@ public class WebFluxSseIntegrationTests {
|
|||
@ParameterizedTest(name = "{0} : {displayName} ")
|
||||
@ValueSource(strings = { "httpclient", "webflux" })
|
||||
void testRootsNotifciationWithEmptyRootsList(String clientType) {
|
||||
var clientBuilder = clientBulders.get(clientType);
|
||||
var clientBuilder = clientBuilders.get(clientType);
|
||||
|
||||
AtomicReference<List<Root>> rootsRef = new AtomicReference<>();
|
||||
var mcpServer = McpServer.sync(mcpServerTransportProvider)
|
||||
|
|
@ -311,7 +309,7 @@ public class WebFluxSseIntegrationTests {
|
|||
@ParameterizedTest(name = "{0} : {displayName} ")
|
||||
@ValueSource(strings = { "httpclient", "webflux" })
|
||||
void testRootsWithMultipleHandlers(String clientType) {
|
||||
var clientBuilder = clientBulders.get(clientType);
|
||||
var clientBuilder = clientBuilders.get(clientType);
|
||||
|
||||
List<Root> roots = List.of(new Root("uri1://", "root1"));
|
||||
|
||||
|
|
@ -345,7 +343,7 @@ public class WebFluxSseIntegrationTests {
|
|||
@ValueSource(strings = { "httpclient", "webflux" })
|
||||
void testRootsServerCloseWithActiveSubscription(String clientType) {
|
||||
|
||||
var clientBuilder = clientBulders.get(clientType);
|
||||
var clientBuilder = clientBuilders.get(clientType);
|
||||
|
||||
List<Root> roots = List.of(new Root("uri1://", "root1"));
|
||||
|
||||
|
|
@ -390,7 +388,7 @@ public class WebFluxSseIntegrationTests {
|
|||
@ValueSource(strings = { "httpclient", "webflux" })
|
||||
void testToolCallSuccess(String clientType) {
|
||||
|
||||
var clientBuilder = clientBulders.get(clientType);
|
||||
var clientBuilder = clientBuilders.get(clientType);
|
||||
|
||||
var callResponse = new McpSchema.CallToolResult(List.of(new McpSchema.TextContent("CALL RESPONSE")), null);
|
||||
McpServerFeatures.SyncToolSpecification tool1 = new McpServerFeatures.SyncToolSpecification(
|
||||
|
|
@ -430,7 +428,7 @@ public class WebFluxSseIntegrationTests {
|
|||
@ValueSource(strings = { "httpclient", "webflux" })
|
||||
void testToolListChangeHandlingSuccess(String clientType) {
|
||||
|
||||
var clientBuilder = clientBulders.get(clientType);
|
||||
var clientBuilder = clientBuilders.get(clientType);
|
||||
|
||||
var callResponse = new McpSchema.CallToolResult(List.of(new McpSchema.TextContent("CALL RESPONSE")), null);
|
||||
McpServerFeatures.SyncToolSpecification tool1 = new McpServerFeatures.SyncToolSpecification(
|
||||
|
|
@ -500,7 +498,7 @@ public class WebFluxSseIntegrationTests {
|
|||
@ValueSource(strings = { "httpclient", "webflux" })
|
||||
void testInitialize(String clientType) {
|
||||
|
||||
var clientBuilder = clientBulders.get(clientType);
|
||||
var clientBuilder = clientBuilders.get(clientType);
|
||||
|
||||
var mcpServer = McpServer.sync(mcpServerTransportProvider).build();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue