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
7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.5.7</version>
<version>4.0.0</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>dev.learning.xapi</groupId>
Expand Down 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
12 changes: 12 additions & 0 deletions xapi-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
<exclusions>
<!-- jjwt does not currently support Jackson 3. This exclusion should be
removed once jjwt adds Jackson 3 support. -->
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jackson</artifactId>
</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

Check warning on line 39 in xapi-client/src/test/java/dev/learning/xapi/client/configuration/XapiClientAutoConfigurationAuthorizationTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=BerryCloud_xapi-java&issues=AZq5A66eBlbkNXtvvB9Q&open=AZq5A66eBlbkNXtvvB9Q&pullRequest=409
},
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

Check warning on line 35 in xapi-client/src/test/java/dev/learning/xapi/client/configuration/XapiClientAutoConfigurationBaseUrlTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=BerryCloud_xapi-java&issues=AZq5A66qBlbkNXtvvB9R&open=AZq5A66qBlbkNXtvvB9R&pullRequest=409
},
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

Check warning on line 39 in xapi-client/src/test/java/dev/learning/xapi/client/configuration/XapiClientAutoConfigurationUsernamePasswordTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=BerryCloud_xapi-java&issues=AZq5A65SBlbkNXtvvB9P&open=AZq5A65SBlbkNXtvvB9P&pullRequest=409
},
properties = {"xapi.client.username = username", "xapi.client.password = password"})
class XapiClientAutoConfigurationUsernamePasswordTest {
Expand Down
12 changes: 12 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,18 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<!-- jjwt does not currently support Jackson 3. This exclusion should be
removed once jjwt adds Jackson 3 support. -->
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jackson</artifactId>
</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)

Check warning on line 43 in xapi-model-spring-boot-starter/src/main/java/dev/learning/xapi/autoconfigure/model/XapiModelAutoConfiguration.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=BerryCloud_xapi-java&issues=AZq5A666BlbkNXtvvB9S&open=AZq5A666BlbkNXtvvB9S&pullRequest=409
public class XapiModelAutoConfiguration {

/**
Expand All @@ -49,7 +49,7 @@
* @return the customizer bean
*/
@Bean
public Jackson2ObjectMapperBuilderCustomizer singleValueArrayCustomizer() {

Check warning on line 52 in xapi-model-spring-boot-starter/src/main/java/dev/learning/xapi/autoconfigure/model/XapiModelAutoConfiguration.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=BerryCloud_xapi-java&issues=AZq5A666BlbkNXtvvB9T&open=AZq5A666BlbkNXtvvB9T&pullRequest=409
return builder ->
builder.postConfigurer(
objectMapper ->
Expand All @@ -66,7 +66,7 @@
name = "xapi.model.validateObjectType",
havingValue = "true",
matchIfMissing = true)
public Jackson2ObjectMapperBuilderCustomizer validateObjectTypeCustomizer() {

Check warning on line 69 in xapi-model-spring-boot-starter/src/main/java/dev/learning/xapi/autoconfigure/model/XapiModelAutoConfiguration.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=BerryCloud_xapi-java&issues=AZq5A666BlbkNXtvvB9U&open=AZq5A666BlbkNXtvvB9U&pullRequest=409
return builder ->
builder.postConfigurer(
objectMapper -> objectMapper.registerModule(new XapiStrictObjectTypeModule()));
Expand All @@ -82,7 +82,7 @@
name = "xapi.model.validateLocale",
havingValue = "true",
matchIfMissing = true)
public Jackson2ObjectMapperBuilderCustomizer validateLocaleCustomizer() {

Check warning on line 85 in xapi-model-spring-boot-starter/src/main/java/dev/learning/xapi/autoconfigure/model/XapiModelAutoConfiguration.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=BerryCloud_xapi-java&issues=AZq5A666BlbkNXtvvB9V&open=AZq5A666BlbkNXtvvB9V&pullRequest=409
return builder ->
builder.postConfigurer(
objectMapper -> objectMapper.registerModule(new XapiStrictLocaleModule()));
Expand All @@ -98,7 +98,7 @@
name = "xapi.model.validateTimestamp",
havingValue = "true",
matchIfMissing = true)
public Jackson2ObjectMapperBuilderCustomizer validateTimestampCustomizer() {

Check warning on line 101 in xapi-model-spring-boot-starter/src/main/java/dev/learning/xapi/autoconfigure/model/XapiModelAutoConfiguration.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=BerryCloud_xapi-java&issues=AZq5A666BlbkNXtvvB9W&open=AZq5A666BlbkNXtvvB9W&pullRequest=409
return builder ->
builder.postConfigurer(
objectMapper -> objectMapper.registerModule(new XapiStrictTimestampModule()));
Expand All @@ -114,7 +114,7 @@
name = "xapi.model.validateNullValues",
havingValue = "true",
matchIfMissing = true)
public Jackson2ObjectMapperBuilderCustomizer validateNullValuesCustomizer() {

Check warning on line 117 in xapi-model-spring-boot-starter/src/main/java/dev/learning/xapi/autoconfigure/model/XapiModelAutoConfiguration.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=BerryCloud_xapi-java&issues=AZq5A666BlbkNXtvvB9X&open=AZq5A666BlbkNXtvvB9X&pullRequest=409
return builder ->
builder.postConfigurer(
objectMapper -> objectMapper.registerModule(new XapiStrictNullValuesModule()));
Expand All @@ -130,7 +130,7 @@
name = "xapi.model.validateProperties",
havingValue = "true",
matchIfMissing = true)
public Jackson2ObjectMapperBuilderCustomizer validatePropertiesCustomizer() {

Check warning on line 133 in xapi-model-spring-boot-starter/src/main/java/dev/learning/xapi/autoconfigure/model/XapiModelAutoConfiguration.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=BerryCloud_xapi-java&issues=AZq5A666BlbkNXtvvB9Y&open=AZq5A666BlbkNXtvvB9Y&pullRequest=409
return builder ->
builder.postConfigurer(
objectMapper ->
Expand All @@ -147,7 +147,7 @@
name = "xapi.model.validateJson",
havingValue = "true",
matchIfMissing = true)
public Jackson2ObjectMapperBuilderCustomizer validateJsonCustomizer() {

Check warning on line 150 in xapi-model-spring-boot-starter/src/main/java/dev/learning/xapi/autoconfigure/model/XapiModelAutoConfiguration.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=BerryCloud_xapi-java&issues=AZq5A666BlbkNXtvvB9Z&open=AZq5A666BlbkNXtvvB9Z&pullRequest=409
return builder ->
builder.postConfigurer(
objectMapper ->
Expand All @@ -164,7 +164,7 @@
name = "xapi.model.validateLiterals",
havingValue = "true",
matchIfMissing = true)
public Jackson2ObjectMapperBuilderCustomizer validateLiteralsCustomizer() {

Check warning on line 167 in xapi-model-spring-boot-starter/src/main/java/dev/learning/xapi/autoconfigure/model/XapiModelAutoConfiguration.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=BerryCloud_xapi-java&issues=AZq5A666BlbkNXtvvB9a&open=AZq5A666BlbkNXtvvB9a&pullRequest=409
return builder ->
builder.postConfigurer(
objectMapper -> {
Expand Down
Loading