Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,11 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-jackson2</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>dev.learning.xapi</groupId>
<artifactId>xapi-model</artifactId>
Expand Down
9 changes: 7 additions & 2 deletions samples/xapi-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,18 @@
</dependency>
<dependency>
<groupId>io.hypersistence</groupId>
<artifactId>hypersistence-utils-hibernate-60</artifactId>
<version>3.8.3</version>
<artifactId>hypersistence-utils-hibernate-70</artifactId>
<version>3.12.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-webmvc-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest;
import org.springframework.http.MediaType;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.test.web.servlet.MockMvc;
Expand All @@ -25,7 +25,7 @@
*/
@WebMvcTest(
value = {StatementController.class},
properties = "spring.jackson.deserialization.ACCEPT_SINGLE_VALUE_AS_ARRAY = true")
properties = "spring.jackson2.deserialization.ACCEPT_SINGLE_VALUE_AS_ARRAY = true")
class StatementControllerTest {

@Autowired private MockMvc mvc;
Expand Down
10 changes: 10 additions & 0 deletions xapi-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jackson</artifactId>
Comment on lines 18 to +22

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Wrong exclusion keeps Jackson 3 in xapi-client

The webflux starter still pulls in Jackson 3 via spring-boot-starter-json, not spring-boot-starter-jackson, so this exclusion is a no-op. With the new spring-boot-jackson2 dependency in the same pom, Maven will still resolve the Jackson artifacts from the webflux starter (3.x), so the compatibility layer never takes effect and you end up running against Jackson 3—the very scenario this change is trying to avoid. Please exclude the actual JSON starter or override the Jackson BOM to 2.x so the classpath aligns with the compatibility module.

Useful? React with 👍 / 👎.

</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-jackson2</artifactId>
</dependency>
<dependency>
<groupId>dev.learning.xapi</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright 2016-2025 Berry Cloud Ltd. All rights reserved.
*/

package dev.learning.xapi.client.configuration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.client.WebClient;

/**
* Test configuration to provide WebClient.Builder bean for tests.
*
* <p>In Spring Boot 4.0, WebClient.Builder autoconfiguration was moved/removed. This configuration
* provides the bean for testing purposes.
*/
@Configuration
public class WebClientTestConfiguration {

@Bean
public WebClient.Builder webClientBuilder() {
return WebClient.builder();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
import org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration;
import org.springframework.boot.http.codec.autoconfigure.CodecsAutoConfiguration;
import org.springframework.boot.jackson2.autoconfigure.Jackson2AutoConfiguration;
import org.springframework.boot.reactor.autoconfigure.ReactorAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.HttpHeaders;
import org.springframework.web.reactive.function.client.WebClient.Builder;
Expand All @@ -31,9 +32,11 @@
@SpringBootTest(
classes = {
XapiClientAutoConfiguration.class,
WebClientAutoConfiguration.class,
WebClientTestConfiguration.class,
CodecsAutoConfiguration.class,
ReactorAutoConfiguration.class,
XapiTestClientConfiguration2.class,
JacksonAutoConfiguration.class
Jackson2AutoConfiguration.class
},
properties = "xapi.client.authorization = bearer 1234")
class XapiClientAutoConfigurationAuthorizationTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
import org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration;
import org.springframework.boot.http.codec.autoconfigure.CodecsAutoConfiguration;
import org.springframework.boot.jackson2.autoconfigure.Jackson2AutoConfiguration;
import org.springframework.boot.reactor.autoconfigure.ReactorAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;

/**
Expand All @@ -28,8 +29,10 @@
@SpringBootTest(
classes = {
XapiClientAutoConfiguration.class,
WebClientAutoConfiguration.class,
JacksonAutoConfiguration.class
WebClientTestConfiguration.class,
CodecsAutoConfiguration.class,
ReactorAutoConfiguration.class,
Jackson2AutoConfiguration.class
},
properties = {"xapi.client.baseUrl = http://127.0.0.1:55123/"})
class XapiClientAutoConfigurationBaseUrlTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
import org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration;
import org.springframework.boot.http.codec.autoconfigure.CodecsAutoConfiguration;
import org.springframework.boot.jackson2.autoconfigure.Jackson2AutoConfiguration;
import org.springframework.boot.reactor.autoconfigure.ReactorAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.HttpHeaders;
import org.springframework.web.reactive.function.client.WebClient.Builder;
Expand All @@ -31,9 +32,11 @@
@SpringBootTest(
classes = {
XapiClientAutoConfiguration.class,
WebClientAutoConfiguration.class,
WebClientTestConfiguration.class,
CodecsAutoConfiguration.class,
ReactorAutoConfiguration.class,
XapiTestClientConfiguration.class,
JacksonAutoConfiguration.class
Jackson2AutoConfiguration.class
},
properties = {"xapi.client.username = username", "xapi.client.password = password"})
class XapiClientAutoConfigurationUsernamePasswordTest {
Expand Down
10 changes: 10 additions & 0 deletions xapi-model-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jackson</artifactId>
Comment on lines 16 to +20

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Wrong exclusion keeps Jackson 3 in model starter

Similar to the client module, spring-boot-starter-web depends on spring-boot-starter-json, not spring-boot-starter-jackson, so this exclusion does nothing. After adding spring-boot-jackson2, the project still resolves Jackson 3 from the web starter, meaning the compatibility module will not actually switch the application to Jackson 2 and you’ll run with the unsupported Jackson 3 API. Exclude the JSON starter or pin the Jackson BOM to 2.x to make the Jackson 2 compatibility effective.

Useful? React with 👍 / 👎.

</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-jackson2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.boot.autoconfigure.jackson.JacksonProperties;
import org.springframework.boot.jackson2.autoconfigure.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.boot.jackson2.autoconfigure.Jackson2Properties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

Expand All @@ -40,7 +40,7 @@
* @author István Rátkai (Selindek)
*/
@Configuration
@AutoConfigureBefore(JacksonProperties.class)
@AutoConfigureBefore(Jackson2Properties.class)
public class XapiModelAutoConfiguration {

/**
Expand Down