Skip to content

fix typo in WebFluxSseIntegrationTests #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,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() {
Expand All @@ -77,11 +77,11 @@ public void before() {
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)
Expand All @@ -103,7 +103,7 @@ public void after() {
@ValueSource(strings = { "httpclient", "webflux" })
void testCreateMessageWithoutSamplingCapabilities(String clientType) {

var clientBuilder = clientBulders.get(clientType);
var clientBuilder = this.clientBuilders.get(clientType);

McpServerFeatures.AsyncToolSpecification tool = new McpServerFeatures.AsyncToolSpecification(
new McpSchema.Tool("tool1", "tool1 description", emptyJsonSchema), (exchange, request) -> {
Expand Down Expand Up @@ -134,7 +134,7 @@ void testCreateMessageWithoutSamplingCapabilities(String clientType) {
void testCreateMessageSuccess(String clientType) throws InterruptedException {

// Client
var clientBuilder = clientBulders.get(clientType);
var clientBuilder = this.clientBuilders.get(clientType);

Function<CreateMessageRequest, CreateMessageResult> samplingHandler = request -> {
assertThat(request.messages()).hasSize(1);
Expand Down Expand Up @@ -203,7 +203,7 @@ void testCreateMessageSuccess(String clientType) throws InterruptedException {
@ParameterizedTest(name = "{0} : {displayName} ")
@ValueSource(strings = { "httpclient", "webflux" })
void testRootsSuccess(String clientType) {
var clientBuilder = clientBulders.get(clientType);
var clientBuilder = this.clientBuilders.get(clientType);

List<Root> roots = List.of(new Root("uri1://", "root1"), new Root("uri2://", "root2"));

Expand Down Expand Up @@ -250,7 +250,7 @@ void testRootsSuccess(String clientType) {
@ValueSource(strings = { "httpclient", "webflux" })
void testRootsWithoutCapability(String clientType) {

var clientBuilder = clientBulders.get(clientType);
var clientBuilder = this.clientBuilders.get(clientType);

McpServerFeatures.SyncToolSpecification tool = new McpServerFeatures.SyncToolSpecification(
new McpSchema.Tool("tool1", "tool1 description", emptyJsonSchema), (exchange, request) -> {
Expand Down Expand Up @@ -284,7 +284,7 @@ void testRootsWithoutCapability(String clientType) {
@ParameterizedTest(name = "{0} : {displayName} ")
@ValueSource(strings = { "httpclient", "webflux" })
void testRootsNotifciationWithEmptyRootsList(String clientType) {
var clientBuilder = clientBulders.get(clientType);
var clientBuilder = this.clientBuilders.get(clientType);

AtomicReference<List<Root>> rootsRef = new AtomicReference<>();
var mcpServer = McpServer.sync(mcpServerTransportProvider)
Expand All @@ -311,7 +311,7 @@ void testRootsNotifciationWithEmptyRootsList(String clientType) {
@ParameterizedTest(name = "{0} : {displayName} ")
@ValueSource(strings = { "httpclient", "webflux" })
void testRootsWithMultipleHandlers(String clientType) {
var clientBuilder = clientBulders.get(clientType);
var clientBuilder = this.clientBuilders.get(clientType);

List<Root> roots = List.of(new Root("uri1://", "root1"));

Expand Down Expand Up @@ -345,7 +345,7 @@ void testRootsWithMultipleHandlers(String clientType) {
@ValueSource(strings = { "httpclient", "webflux" })
void testRootsServerCloseWithActiveSubscription(String clientType) {

var clientBuilder = clientBulders.get(clientType);
var clientBuilder = this.clientBuilders.get(clientType);

List<Root> roots = List.of(new Root("uri1://", "root1"));

Expand Down Expand Up @@ -390,7 +390,7 @@ void testRootsServerCloseWithActiveSubscription(String clientType) {
@ValueSource(strings = { "httpclient", "webflux" })
void testToolCallSuccess(String clientType) {

var clientBuilder = clientBulders.get(clientType);
var clientBuilder = this.clientBuilders.get(clientType);

var callResponse = new McpSchema.CallToolResult(List.of(new McpSchema.TextContent("CALL RESPONSE")), null);
McpServerFeatures.SyncToolSpecification tool1 = new McpServerFeatures.SyncToolSpecification(
Expand Down Expand Up @@ -430,7 +430,7 @@ void testToolCallSuccess(String clientType) {
@ValueSource(strings = { "httpclient", "webflux" })
void testToolListChangeHandlingSuccess(String clientType) {

var clientBuilder = clientBulders.get(clientType);
var clientBuilder = this.clientBuilders.get(clientType);

var callResponse = new McpSchema.CallToolResult(List.of(new McpSchema.TextContent("CALL RESPONSE")), null);
McpServerFeatures.SyncToolSpecification tool1 = new McpServerFeatures.SyncToolSpecification(
Expand Down Expand Up @@ -500,7 +500,7 @@ void testToolListChangeHandlingSuccess(String clientType) {
@ValueSource(strings = { "httpclient", "webflux" })
void testInitialize(String clientType) {

var clientBuilder = clientBulders.get(clientType);
var clientBuilder = this.clientBuilders.get(clientType);

var mcpServer = McpServer.sync(mcpServerTransportProvider).build();

Expand Down