fix: correct typos in variable names, method names, and commentsj (#159)
This commit is contained in:
parent
f7f8ccd0ac
commit
84adde16a5
11 changed files with 32 additions and 32 deletions
|
|
@ -141,7 +141,7 @@ public class WebFluxSseServerTransportProvider implements McpServerTransportProv
|
|||
* Constructs a new WebFlux SSE server transport provider instance.
|
||||
* @param objectMapper The ObjectMapper to use for JSON serialization/deserialization
|
||||
* of MCP messages. Must not be null.
|
||||
* @param baseUrl webflux messag base path
|
||||
* @param baseUrl webflux message base path
|
||||
* @param messageEndpoint The endpoint URI where clients should send their JSON-RPC
|
||||
* messages. This endpoint will be communicated to clients during SSE connection
|
||||
* setup. Must not be null.
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ class WebFluxSseIntegrationTests {
|
|||
McpServerFeatures.AsyncToolSpecification tool = new McpServerFeatures.AsyncToolSpecification(
|
||||
new McpSchema.Tool("tool1", "tool1 description", emptyJsonSchema), (exchange, request) -> {
|
||||
|
||||
var craeteMessageRequest = McpSchema.CreateMessageRequest.builder()
|
||||
var createMessageRequest = McpSchema.CreateMessageRequest.builder()
|
||||
.messages(List.of(new McpSchema.SamplingMessage(McpSchema.Role.USER,
|
||||
new McpSchema.TextContent("Test message"))))
|
||||
.modelPreferences(ModelPreferences.builder()
|
||||
|
|
@ -163,7 +163,7 @@ class WebFluxSseIntegrationTests {
|
|||
.build())
|
||||
.build();
|
||||
|
||||
return exchange.createMessage(craeteMessageRequest)
|
||||
return exchange.createMessage(createMessageRequest)
|
||||
.doOnNext(samplingResult::set)
|
||||
.thenReturn(callResponse);
|
||||
});
|
||||
|
|
@ -421,7 +421,7 @@ class WebFluxSseIntegrationTests {
|
|||
|
||||
@ParameterizedTest(name = "{0} : {displayName} ")
|
||||
@ValueSource(strings = { "httpclient", "webflux" })
|
||||
void testRootsNotifciationWithEmptyRootsList(String clientType) {
|
||||
void testRootsNotificationWithEmptyRootsList(String clientType) {
|
||||
var clientBuilder = clientBuilders.get(clientType);
|
||||
|
||||
AtomicReference<List<Root>> rootsRef = new AtomicReference<>();
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ class WebMvcSseIntegrationTests {
|
|||
McpServerFeatures.AsyncToolSpecification tool = new McpServerFeatures.AsyncToolSpecification(
|
||||
new McpSchema.Tool("tool1", "tool1 description", emptyJsonSchema), (exchange, request) -> {
|
||||
|
||||
var craeteMessageRequest = McpSchema.CreateMessageRequest.builder()
|
||||
var createMessageRequest = McpSchema.CreateMessageRequest.builder()
|
||||
.messages(List.of(new McpSchema.SamplingMessage(McpSchema.Role.USER,
|
||||
new McpSchema.TextContent("Test message"))))
|
||||
.modelPreferences(ModelPreferences.builder()
|
||||
|
|
@ -180,7 +180,7 @@ class WebMvcSseIntegrationTests {
|
|||
.build())
|
||||
.build();
|
||||
|
||||
StepVerifier.create(exchange.createMessage(craeteMessageRequest)).consumeNextWith(result -> {
|
||||
StepVerifier.create(exchange.createMessage(createMessageRequest)).consumeNextWith(result -> {
|
||||
assertThat(result).isNotNull();
|
||||
assertThat(result.role()).isEqualTo(Role.USER);
|
||||
assertThat(result.content()).isInstanceOf(McpSchema.TextContent.class);
|
||||
|
|
@ -438,7 +438,7 @@ class WebMvcSseIntegrationTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
void testRootsNotifciationWithEmptyRootsList() {
|
||||
void testRootsNotificationWithEmptyRootsList() {
|
||||
AtomicReference<List<Root>> rootsRef = new AtomicReference<>();
|
||||
|
||||
var mcpServer = McpServer.sync(mcpServerTransportProvider)
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ public abstract class AbstractMcpAsyncServerTests {
|
|||
.build();
|
||||
|
||||
StepVerifier.create(mcpAsyncServer.addTool(new McpServerFeatures.AsyncToolSpecification(newTool,
|
||||
(excnage, args) -> Mono.just(new CallToolResult(List.of(), false)))))
|
||||
(exchange, args) -> Mono.just(new CallToolResult(List.of(), false)))))
|
||||
.verifyComplete();
|
||||
|
||||
assertThatCode(() -> mcpAsyncServer.closeGracefully().block(Duration.ofSeconds(10))).doesNotThrowAnyException();
|
||||
|
|
|
|||
|
|
@ -200,16 +200,16 @@ public abstract class AbstractMcpSyncServerTests {
|
|||
|
||||
Resource resource = new Resource(TEST_RESOURCE_URI, "Test Resource", "text/plain", "Test resource description",
|
||||
null);
|
||||
McpServerFeatures.SyncResourceSpecification specificaiton = new McpServerFeatures.SyncResourceSpecification(
|
||||
McpServerFeatures.SyncResourceSpecification specification = new McpServerFeatures.SyncResourceSpecification(
|
||||
resource, (exchange, req) -> new ReadResourceResult(List.of()));
|
||||
|
||||
assertThatCode(() -> mcpSyncServer.addResource(specificaiton)).doesNotThrowAnyException();
|
||||
assertThatCode(() -> mcpSyncServer.addResource(specification)).doesNotThrowAnyException();
|
||||
|
||||
assertThatCode(() -> mcpSyncServer.closeGracefully()).doesNotThrowAnyException();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testAddResourceWithNullSpecifiation() {
|
||||
void testAddResourceWithNullSpecification() {
|
||||
var mcpSyncServer = McpServer.sync(createMcpTransportProvider())
|
||||
.serverInfo("test-server", "1.0.0")
|
||||
.capabilities(ServerCapabilities.builder().resources(true, false).build())
|
||||
|
|
@ -279,11 +279,11 @@ public abstract class AbstractMcpSyncServerTests {
|
|||
.build();
|
||||
|
||||
Prompt prompt = new Prompt(TEST_PROMPT_NAME, "Test Prompt", List.of());
|
||||
McpServerFeatures.SyncPromptSpecification specificaiton = new McpServerFeatures.SyncPromptSpecification(prompt,
|
||||
McpServerFeatures.SyncPromptSpecification specification = new McpServerFeatures.SyncPromptSpecification(prompt,
|
||||
(exchange, req) -> new GetPromptResult("Test prompt description", List
|
||||
.of(new PromptMessage(McpSchema.Role.ASSISTANT, new McpSchema.TextContent("Test content")))));
|
||||
|
||||
assertThatThrownBy(() -> serverWithoutPrompts.addPrompt(specificaiton)).isInstanceOf(McpError.class)
|
||||
assertThatThrownBy(() -> serverWithoutPrompts.addPrompt(specification)).isInstanceOf(McpError.class)
|
||||
.hasMessage("Server must be configured with prompt capabilities");
|
||||
}
|
||||
|
||||
|
|
@ -300,14 +300,14 @@ public abstract class AbstractMcpSyncServerTests {
|
|||
@Test
|
||||
void testRemovePrompt() {
|
||||
Prompt prompt = new Prompt(TEST_PROMPT_NAME, "Test Prompt", List.of());
|
||||
McpServerFeatures.SyncPromptSpecification specificaiton = new McpServerFeatures.SyncPromptSpecification(prompt,
|
||||
McpServerFeatures.SyncPromptSpecification specification = new McpServerFeatures.SyncPromptSpecification(prompt,
|
||||
(exchange, req) -> new GetPromptResult("Test prompt description", List
|
||||
.of(new PromptMessage(McpSchema.Role.ASSISTANT, new McpSchema.TextContent("Test content")))));
|
||||
|
||||
var mcpSyncServer = McpServer.sync(createMcpTransportProvider())
|
||||
.serverInfo("test-server", "1.0.0")
|
||||
.capabilities(ServerCapabilities.builder().prompts(true).build())
|
||||
.prompts(specificaiton)
|
||||
.prompts(specification)
|
||||
.build();
|
||||
|
||||
assertThatCode(() -> mcpSyncServer.removePrompt(TEST_PROMPT_NAME)).doesNotThrowAnyException();
|
||||
|
|
@ -340,7 +340,7 @@ public abstract class AbstractMcpSyncServerTests {
|
|||
|
||||
var singleConsumerServer = McpServer.sync(createMcpTransportProvider())
|
||||
.serverInfo("test-server", "1.0.0")
|
||||
.rootsChangeHandlers(List.of((exchage, roots) -> {
|
||||
.rootsChangeHandlers(List.of((exchange, roots) -> {
|
||||
consumerCalled[0] = true;
|
||||
if (!roots.isEmpty()) {
|
||||
rootsReceived[0] = roots.get(0);
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ public interface McpClient {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param initializationTimeout The duration to wait for the initializaiton
|
||||
* @param initializationTimeout The duration to wait for the initialization
|
||||
* lifecycle step to complete.
|
||||
* @return This builder instance for method chaining
|
||||
* @throws IllegalArgumentException if initializationTimeout is null
|
||||
|
|
@ -435,7 +435,7 @@ public interface McpClient {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param initializationTimeout The duration to wait for the initializaiton
|
||||
* @param initializationTimeout The duration to wait for the initialization
|
||||
* lifecycle step to complete.
|
||||
* @return This builder instance for method chaining
|
||||
* @throws IllegalArgumentException if initializationTimeout is null
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ public class McpAsyncServer {
|
|||
}
|
||||
else {
|
||||
logger.warn(
|
||||
"Client requested unsupported protocol version: {}, so the server will sugggest the {} version instead",
|
||||
"Client requested unsupported protocol version: {}, so the server will suggest the {} version instead",
|
||||
initializeRequest.protocolVersion(), serverProtocolVersion);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1103,7 +1103,7 @@ public final class McpSchema {
|
|||
* setting minimum log levels, with servers sending notifications containing severity
|
||||
* levels, optional logger names, and arbitrary JSON-serializable data.
|
||||
*
|
||||
* @param level The severity levels. The mimimum log level is set by the client.
|
||||
* @param level The severity levels. The minimum log level is set by the client.
|
||||
* @param logger The logger that generated the message.
|
||||
* @param data JSON-serializable logging data.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ public abstract class AbstractMcpAsyncServerTests {
|
|||
.build();
|
||||
|
||||
StepVerifier.create(mcpAsyncServer.addTool(new McpServerFeatures.AsyncToolSpecification(newTool,
|
||||
(excnage, args) -> Mono.just(new CallToolResult(List.of(), false)))))
|
||||
(exchange, args) -> Mono.just(new CallToolResult(List.of(), false)))))
|
||||
.verifyComplete();
|
||||
|
||||
assertThatCode(() -> mcpAsyncServer.closeGracefully().block(Duration.ofSeconds(10))).doesNotThrowAnyException();
|
||||
|
|
|
|||
|
|
@ -199,16 +199,16 @@ public abstract class AbstractMcpSyncServerTests {
|
|||
|
||||
Resource resource = new Resource(TEST_RESOURCE_URI, "Test Resource", "text/plain", "Test resource description",
|
||||
null);
|
||||
McpServerFeatures.SyncResourceSpecification specificaiton = new McpServerFeatures.SyncResourceSpecification(
|
||||
McpServerFeatures.SyncResourceSpecification specification = new McpServerFeatures.SyncResourceSpecification(
|
||||
resource, (exchange, req) -> new ReadResourceResult(List.of()));
|
||||
|
||||
assertThatCode(() -> mcpSyncServer.addResource(specificaiton)).doesNotThrowAnyException();
|
||||
assertThatCode(() -> mcpSyncServer.addResource(specification)).doesNotThrowAnyException();
|
||||
|
||||
assertThatCode(() -> mcpSyncServer.closeGracefully()).doesNotThrowAnyException();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testAddResourceWithNullSpecifiation() {
|
||||
void testAddResourceWithNullSpecification() {
|
||||
var mcpSyncServer = McpServer.sync(createMcpTransportProvider())
|
||||
.serverInfo("test-server", "1.0.0")
|
||||
.capabilities(ServerCapabilities.builder().resources(true, false).build())
|
||||
|
|
@ -278,11 +278,11 @@ public abstract class AbstractMcpSyncServerTests {
|
|||
.build();
|
||||
|
||||
Prompt prompt = new Prompt(TEST_PROMPT_NAME, "Test Prompt", List.of());
|
||||
McpServerFeatures.SyncPromptSpecification specificaiton = new McpServerFeatures.SyncPromptSpecification(prompt,
|
||||
McpServerFeatures.SyncPromptSpecification specification = new McpServerFeatures.SyncPromptSpecification(prompt,
|
||||
(exchange, req) -> new GetPromptResult("Test prompt description", List
|
||||
.of(new PromptMessage(McpSchema.Role.ASSISTANT, new McpSchema.TextContent("Test content")))));
|
||||
|
||||
assertThatThrownBy(() -> serverWithoutPrompts.addPrompt(specificaiton)).isInstanceOf(McpError.class)
|
||||
assertThatThrownBy(() -> serverWithoutPrompts.addPrompt(specification)).isInstanceOf(McpError.class)
|
||||
.hasMessage("Server must be configured with prompt capabilities");
|
||||
}
|
||||
|
||||
|
|
@ -299,14 +299,14 @@ public abstract class AbstractMcpSyncServerTests {
|
|||
@Test
|
||||
void testRemovePrompt() {
|
||||
Prompt prompt = new Prompt(TEST_PROMPT_NAME, "Test Prompt", List.of());
|
||||
McpServerFeatures.SyncPromptSpecification specificaiton = new McpServerFeatures.SyncPromptSpecification(prompt,
|
||||
McpServerFeatures.SyncPromptSpecification specification = new McpServerFeatures.SyncPromptSpecification(prompt,
|
||||
(exchange, req) -> new GetPromptResult("Test prompt description", List
|
||||
.of(new PromptMessage(McpSchema.Role.ASSISTANT, new McpSchema.TextContent("Test content")))));
|
||||
|
||||
var mcpSyncServer = McpServer.sync(createMcpTransportProvider())
|
||||
.serverInfo("test-server", "1.0.0")
|
||||
.capabilities(ServerCapabilities.builder().prompts(true).build())
|
||||
.prompts(specificaiton)
|
||||
.prompts(specification)
|
||||
.build();
|
||||
|
||||
assertThatCode(() -> mcpSyncServer.removePrompt(TEST_PROMPT_NAME)).doesNotThrowAnyException();
|
||||
|
|
@ -339,7 +339,7 @@ public abstract class AbstractMcpSyncServerTests {
|
|||
|
||||
var singleConsumerServer = McpServer.sync(createMcpTransportProvider())
|
||||
.serverInfo("test-server", "1.0.0")
|
||||
.rootsChangeHandlers(List.of((exchage, roots) -> {
|
||||
.rootsChangeHandlers(List.of((exchange, roots) -> {
|
||||
consumerCalled[0] = true;
|
||||
if (!roots.isEmpty()) {
|
||||
rootsReceived[0] = roots.get(0);
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ class HttpServletSseServerTransportProviderIntegrationTests {
|
|||
McpServerFeatures.AsyncToolSpecification tool = new McpServerFeatures.AsyncToolSpecification(
|
||||
new McpSchema.Tool("tool1", "tool1 description", emptyJsonSchema), (exchange, request) -> {
|
||||
|
||||
var craeteMessageRequest = McpSchema.CreateMessageRequest.builder()
|
||||
var createMessageRequest = McpSchema.CreateMessageRequest.builder()
|
||||
.messages(List.of(new McpSchema.SamplingMessage(McpSchema.Role.USER,
|
||||
new McpSchema.TextContent("Test message"))))
|
||||
.modelPreferences(ModelPreferences.builder()
|
||||
|
|
@ -163,7 +163,7 @@ class HttpServletSseServerTransportProviderIntegrationTests {
|
|||
.build())
|
||||
.build();
|
||||
|
||||
StepVerifier.create(exchange.createMessage(craeteMessageRequest)).consumeNextWith(result -> {
|
||||
StepVerifier.create(exchange.createMessage(createMessageRequest)).consumeNextWith(result -> {
|
||||
assertThat(result).isNotNull();
|
||||
assertThat(result.role()).isEqualTo(Role.USER);
|
||||
assertThat(result.content()).isInstanceOf(McpSchema.TextContent.class);
|
||||
|
|
@ -417,7 +417,7 @@ class HttpServletSseServerTransportProviderIntegrationTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
void testRootsNotifciationWithEmptyRootsList() {
|
||||
void testRootsNotificationWithEmptyRootsList() {
|
||||
AtomicReference<List<Root>> rootsRef = new AtomicReference<>();
|
||||
|
||||
var mcpServer = McpServer.sync(mcpServerTransportProvider)
|
||||
|
|
|
|||
Loading…
Reference in a new issue