refactor: improve MCP client code organization and robustness
- Add null parameter validation in client builders - Enhance JavaDoc documentation for tools and resources - Reorganize McpAsyncClient methods by functionality - Fix sampling handler test setup
This commit is contained in:
parent
9130e742fd
commit
36b951558d
2 changed files with 267 additions and 159 deletions
|
|
@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
|
|
@ -225,7 +226,8 @@ public abstract class AbstractMcpAsyncClientTests {
|
|||
.hasMessageContaining("Root with uri 'nonexistent-uri' not found");
|
||||
}
|
||||
|
||||
// @Test
|
||||
@Test
|
||||
@Disabled
|
||||
void testReadResource() {
|
||||
StepVerifier.create(mcpAsyncClient.listResources()).consumeNextWith(resources -> {
|
||||
if (!resources.resources().isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -365,7 +365,6 @@ class McpAsyncClientResponseHandlerTests {
|
|||
// Create client with sampling capability but null handler
|
||||
McpAsyncClient asyncMcpClient = McpClient.using(transport)
|
||||
.capabilities(ClientCapabilities.builder().sampling().build())
|
||||
.sampling(null) // Null handler
|
||||
.async();
|
||||
|
||||
// Create a mock create message request
|
||||
|
|
|
|||
Loading…
Reference in a new issue