-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the server info included in the "initialize" response configurable
- Loading branch information
Showing
7 changed files
with
195 additions
and
4 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
deployment/src/test/java/io/quarkiverse/mcp/server/test/serverinfo/CustomServerInfoTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package io.quarkiverse.mcp.server.test.serverinfo; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
import java.net.URISyntaxException; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkiverse.mcp.server.test.McpClient; | ||
import io.quarkiverse.mcp.server.test.McpServerTest; | ||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.vertx.core.json.JsonObject; | ||
|
||
public class CustomServerInfoTest extends McpServerTest { | ||
|
||
private static final String NAME = "Foo"; | ||
private static final String VERSION = "1.0"; | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.withApplicationRoot(root -> root.addClasses(McpClient.class)) | ||
.overrideConfigKey("quarkus.mcp-server.server-info.name", NAME) | ||
.overrideConfigKey("quarkus.mcp-server.server-info.version", VERSION); | ||
|
||
@Test | ||
public void testServerInfo() throws URISyntaxException { | ||
initClient(result -> { | ||
JsonObject serverInfo = result.getJsonObject("serverInfo"); | ||
assertNotNull(serverInfo); | ||
assertEquals(NAME, serverInfo.getString("name")); | ||
assertEquals(VERSION, serverInfo.getString("version")); | ||
}); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...oyment/src/test/java/io/quarkiverse/mcp/server/test/serverinfo/DefaultServerInfoTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package io.quarkiverse.mcp.server.test.serverinfo; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
import java.net.URISyntaxException; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkiverse.mcp.server.test.McpClient; | ||
import io.quarkiverse.mcp.server.test.McpServerTest; | ||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.vertx.core.json.JsonObject; | ||
|
||
public class DefaultServerInfoTest extends McpServerTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.withApplicationRoot(root -> root.addClasses(McpClient.class)); | ||
|
||
@Test | ||
public void testServerInfo() throws URISyntaxException { | ||
initClient(result -> { | ||
JsonObject serverInfo = result.getJsonObject("serverInfo"); | ||
assertNotNull(serverInfo); | ||
assertEquals("quarkus-mcp-server-deployment", serverInfo.getString("name")); | ||
assertEquals("999-SNAPSHOT", serverInfo.getString("version")); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters