Client Auth Conformance Tests - change parent POM (#827)

- Small javaformat fixes
- Closes gh-827

Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
This commit is contained in:
Daniel Garnier-Moiroux 2026-03-02 11:31:34 +01:00
commit 81a18ed02e
4 changed files with 34 additions and 17 deletions

View file

@ -67,7 +67,7 @@ cd conformance-tests/client-spring-http-client
This creates an executable JAR at: This creates an executable JAR at:
``` ```
target/client-spring-http-client-0.18.0-SNAPSHOT.jar target/client-spring-http-client-1.1.0-SNAPSHOT.jar
``` ```
## Running Tests ## Running Tests
@ -79,7 +79,7 @@ Run the full auth suite:
```bash ```bash
npx @modelcontextprotocol/conformance@0.1.15 client \ npx @modelcontextprotocol/conformance@0.1.15 client \
--spec-version 2025-11-25 \ --spec-version 2025-11-25 \
--command "java -jar conformance-tests/client-spring-http-client/target/client-spring-http-client-0.18.0-SNAPSHOT.jar" \ --command "java -jar conformance-tests/client-spring-http-client/target/client-spring-http-client-1.1.0-SNAPSHOT.jar" \
--suite auth --suite auth
``` ```
@ -88,7 +88,7 @@ Run a single scenario:
```bash ```bash
npx @modelcontextprotocol/conformance@0.1.15 client \ npx @modelcontextprotocol/conformance@0.1.15 client \
--spec-version 2025-11-25 \ --spec-version 2025-11-25 \
--command "java -jar conformance-tests/client-spring-http-client/target/client-spring-http-client-0.18.0-SNAPSHOT.jar" \ --command "java -jar conformance-tests/client-spring-http-client/target/client-spring-http-client-1.1.0-SNAPSHOT.jar" \
--scenario auth/metadata-default --scenario auth/metadata-default
``` ```
@ -97,7 +97,7 @@ Run with verbose output:
```bash ```bash
npx @modelcontextprotocol/conformance@0.1.15 client \ npx @modelcontextprotocol/conformance@0.1.15 client \
--spec-version 2025-11-25 \ --spec-version 2025-11-25 \
--command "java -jar conformance-tests/client-spring-http-client/target/client-spring-http-client-0.18.0-SNAPSHOT.jar" \ --command "java -jar conformance-tests/client-spring-http-client/target/client-spring-http-client-1.1.0-SNAPSHOT.jar" \
--scenario auth/metadata-default \ --scenario auth/metadata-default \
--verbose --verbose
``` ```
@ -108,7 +108,7 @@ You can also run the client manually if you have a test server:
```bash ```bash
export MCP_CONFORMANCE_SCENARIO=auth/metadata-default export MCP_CONFORMANCE_SCENARIO=auth/metadata-default
java -jar conformance-tests/client-spring-http-client/target/client-spring-http-client-0.18.0-SNAPSHOT.jar http://localhost:3000/mcp java -jar conformance-tests/client-spring-http-client/target/client-spring-http-client-1.1.0-SNAPSHOT.jar http://localhost:3000/mcp
``` ```
## Known Issues ## Known Issues

View file

@ -4,14 +4,11 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>conformance-tests</artifactId>
<version>4.0.2</version> <version>1.1.0-SNAPSHOT</version>
<relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>client-spring-http-client</artifactId> <artifactId>client-spring-http-client</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>MCP Conformance Tests - Spring HTTP Client</name> <name>MCP Conformance Tests - Spring HTTP Client</name>
<description>Spring HTTP Client conformance tests for the Java MCP SDK</description> <description>Spring HTTP Client conformance tests for the Java MCP SDK</description>
@ -25,10 +22,23 @@
<properties> <properties>
<java.version>17</java.version> <java.version>17</java.version>
<spring-boot.version>4.0.2</spring-boot.version>
<spring-ai.version>2.0.0-M2</spring-ai.version> <spring-ai.version>2.0.0-M2</spring-ai.version>
<maven.deploy.skip>true</maven.deploy.skip> <maven.deploy.skip>true</maven.deploy.skip>
</properties> </properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@ -63,6 +73,14 @@
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>

View file

@ -24,8 +24,8 @@ public class DefaultConfiguration {
@Bean @Bean
DefaultScenario defaultScenario(McpClientRegistrationRepository clientRegistrationRepository, DefaultScenario defaultScenario(McpClientRegistrationRepository clientRegistrationRepository,
ServletWebServerApplicationContext serverCtx, ServletWebServerApplicationContext serverCtx,
OAuth2AuthorizedClientRepository oAuth2AuthorizedClientRepository) { OAuth2AuthorizedClientRepository oAuth2AuthorizedClientRepository) {
return new DefaultScenario(clientRegistrationRepository, serverCtx, oAuth2AuthorizedClientRepository); return new DefaultScenario(clientRegistrationRepository, serverCtx, oAuth2AuthorizedClientRepository);
} }

View file

@ -29,8 +29,7 @@ import static io.modelcontextprotocol.conformance.client.ConformanceSpringClient
public class DefaultScenario implements Scenario { public class DefaultScenario implements Scenario {
private static final Logger log = LoggerFactory private static final Logger log = LoggerFactory.getLogger(DefaultScenario.class);
.getLogger(DefaultScenario.class);
private final ServletWebServerApplicationContext serverCtx; private final ServletWebServerApplicationContext serverCtx;
@ -39,8 +38,8 @@ public class DefaultScenario implements Scenario {
private McpSyncClient client; private McpSyncClient client;
public DefaultScenario(McpClientRegistrationRepository clientRegistrationRepository, public DefaultScenario(McpClientRegistrationRepository clientRegistrationRepository,
ServletWebServerApplicationContext serverCtx, ServletWebServerApplicationContext serverCtx,
OAuth2AuthorizedClientRepository oAuth2AuthorizedClientRepository) { OAuth2AuthorizedClientRepository oAuth2AuthorizedClientRepository) {
this.serverCtx = serverCtx; this.serverCtx = serverCtx;
this.authorizedClientManager = new DefaultOAuth2AuthorizedClientManager(clientRegistrationRepository, this.authorizedClientManager = new DefaultOAuth2AuthorizedClientManager(clientRegistrationRepository,
oAuth2AuthorizedClientRepository); oAuth2AuthorizedClientRepository);