File tree Expand file tree Collapse file tree 10 files changed +87
-20
lines changed
src/test/java/dev/learning/xapi/samples/xapiserver
src/test/java/dev/learning/xapi/client/configuration
xapi-model-spring-boot-starter
src/main/java/dev/learning/xapi/autoconfigure/model Expand file tree Collapse file tree 10 files changed +87
-20
lines changed Original file line number Diff line number Diff line change 44 <parent >
55 <groupId >org.springframework.boot</groupId >
66 <artifactId >spring-boot-starter-parent</artifactId >
7- <version >3.5.7 </version >
7+ <version >4.0.0 </version >
88 <relativePath /> <!-- lookup parent from repository -->
99 </parent >
1010 <groupId >dev.learning.xapi</groupId >
279279 <type >pom</type >
280280 <scope >import</scope >
281281 </dependency >
282+ <dependency >
283+ <groupId >org.springframework.boot</groupId >
284+ <artifactId >spring-boot-jackson2</artifactId >
285+ <version >4.0.0</version >
286+ </dependency >
282287 <dependency >
283288 <groupId >dev.learning.xapi</groupId >
284289 <artifactId >xapi-model</artifactId >
Original file line number Diff line number Diff line change 2424 </dependency >
2525 <dependency >
2626 <groupId >io.hypersistence</groupId >
27- <artifactId >hypersistence-utils-hibernate-60 </artifactId >
28- <version >3.8.3 </version >
27+ <artifactId >hypersistence-utils-hibernate-70 </artifactId >
28+ <version >3.12.0 </version >
2929 </dependency >
3030 <dependency >
3131 <groupId >org.springframework.boot</groupId >
3232 <artifactId >spring-boot-devtools</artifactId >
3333 <optional >true</optional >
3434 </dependency >
35+ <dependency >
36+ <groupId >org.springframework.boot</groupId >
37+ <artifactId >spring-boot-webmvc-test</artifactId >
38+ <scope >test</scope >
39+ </dependency >
3540 </dependencies >
3641</project >
Original file line number Diff line number Diff line change 1111
1212import org .junit .jupiter .api .Test ;
1313import org .springframework .beans .factory .annotation .Autowired ;
14- import org .springframework .boot .test .autoconfigure . web . servlet .WebMvcTest ;
14+ import org .springframework .boot .webmvc . test .autoconfigure .WebMvcTest ;
1515import org .springframework .http .MediaType ;
1616import org .springframework .test .context .bean .override .mockito .MockitoBean ;
1717import org .springframework .test .web .servlet .MockMvc ;
2525 */
2626@ WebMvcTest (
2727 value = {StatementController .class },
28- properties = "spring.jackson .deserialization.ACCEPT_SINGLE_VALUE_AS_ARRAY = true" )
28+ properties = "spring.jackson2 .deserialization.ACCEPT_SINGLE_VALUE_AS_ARRAY = true" )
2929class StatementControllerTest {
3030
3131 @ Autowired private MockMvc mvc ;
Original file line number Diff line number Diff line change 1616 <dependency >
1717 <groupId >org.springframework.boot</groupId >
1818 <artifactId >spring-boot-starter-webflux</artifactId >
19+ <exclusions >
20+ <!-- jjwt does not currently support Jackson 3. This exclusion should be
21+ removed once jjwt adds Jackson 3 support. -->
22+ <exclusion >
23+ <groupId >org.springframework.boot</groupId >
24+ <artifactId >spring-boot-starter-jackson</artifactId >
25+ </exclusion >
26+ </exclusions >
27+ </dependency >
28+ <dependency >
29+ <groupId >org.springframework.boot</groupId >
30+ <artifactId >spring-boot-jackson2</artifactId >
1931 </dependency >
2032 <dependency >
2133 <groupId >dev.learning.xapi</groupId >
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2016-2025 Berry Cloud Ltd. All rights reserved.
3+ */
4+
5+ package dev .learning .xapi .client .configuration ;
6+
7+ import org .springframework .context .annotation .Bean ;
8+ import org .springframework .context .annotation .Configuration ;
9+ import org .springframework .web .reactive .function .client .WebClient ;
10+
11+ /**
12+ * Test configuration to provide WebClient.Builder bean for tests.
13+ *
14+ * <p>In Spring Boot 4.0, WebClient.Builder autoconfiguration was moved/removed. This configuration
15+ * provides the bean for testing purposes.
16+ */
17+ @ Configuration
18+ public class WebClientTestConfiguration {
19+
20+ @ Bean
21+ public WebClient .Builder webClientBuilder () {
22+ return WebClient .builder ();
23+ }
24+ }
Original file line number Diff line number Diff line change 1616import org .junit .jupiter .api .DisplayName ;
1717import org .junit .jupiter .api .Test ;
1818import org .springframework .beans .factory .annotation .Autowired ;
19- import org .springframework .boot .autoconfigure .jackson .JacksonAutoConfiguration ;
20- import org .springframework .boot .autoconfigure .web .reactive .function .client .WebClientAutoConfiguration ;
19+ import org .springframework .boot .http .codec .autoconfigure .CodecsAutoConfiguration ;
20+ import org .springframework .boot .jackson2 .autoconfigure .Jackson2AutoConfiguration ;
21+ import org .springframework .boot .reactor .autoconfigure .ReactorAutoConfiguration ;
2122import org .springframework .boot .test .context .SpringBootTest ;
2223import org .springframework .http .HttpHeaders ;
2324import org .springframework .web .reactive .function .client .WebClient .Builder ;
3132@ SpringBootTest (
3233 classes = {
3334 XapiClientAutoConfiguration .class ,
34- WebClientAutoConfiguration .class ,
35+ WebClientTestConfiguration .class ,
36+ CodecsAutoConfiguration .class ,
37+ ReactorAutoConfiguration .class ,
3538 XapiTestClientConfiguration2 .class ,
36- JacksonAutoConfiguration .class
39+ Jackson2AutoConfiguration .class
3740 },
3841 properties = "xapi.client.authorization = bearer 1234" )
3942class XapiClientAutoConfigurationAuthorizationTest {
Original file line number Diff line number Diff line change 1515import org .junit .jupiter .api .DisplayName ;
1616import org .junit .jupiter .api .Test ;
1717import org .springframework .beans .factory .annotation .Autowired ;
18- import org .springframework .boot .autoconfigure .jackson .JacksonAutoConfiguration ;
19- import org .springframework .boot .autoconfigure .web .reactive .function .client .WebClientAutoConfiguration ;
18+ import org .springframework .boot .http .codec .autoconfigure .CodecsAutoConfiguration ;
19+ import org .springframework .boot .jackson2 .autoconfigure .Jackson2AutoConfiguration ;
20+ import org .springframework .boot .reactor .autoconfigure .ReactorAutoConfiguration ;
2021import org .springframework .boot .test .context .SpringBootTest ;
2122
2223/**
2829@ SpringBootTest (
2930 classes = {
3031 XapiClientAutoConfiguration .class ,
31- WebClientAutoConfiguration .class ,
32- JacksonAutoConfiguration .class
32+ WebClientTestConfiguration .class ,
33+ CodecsAutoConfiguration .class ,
34+ ReactorAutoConfiguration .class ,
35+ Jackson2AutoConfiguration .class
3336 },
3437 properties = {"xapi.client.baseUrl = http://127.0.0.1:55123/" })
3538class XapiClientAutoConfigurationBaseUrlTest {
Original file line number Diff line number Diff line change 1616import org .junit .jupiter .api .DisplayName ;
1717import org .junit .jupiter .api .Test ;
1818import org .springframework .beans .factory .annotation .Autowired ;
19- import org .springframework .boot .autoconfigure .jackson .JacksonAutoConfiguration ;
20- import org .springframework .boot .autoconfigure .web .reactive .function .client .WebClientAutoConfiguration ;
19+ import org .springframework .boot .http .codec .autoconfigure .CodecsAutoConfiguration ;
20+ import org .springframework .boot .jackson2 .autoconfigure .Jackson2AutoConfiguration ;
21+ import org .springframework .boot .reactor .autoconfigure .ReactorAutoConfiguration ;
2122import org .springframework .boot .test .context .SpringBootTest ;
2223import org .springframework .http .HttpHeaders ;
2324import org .springframework .web .reactive .function .client .WebClient .Builder ;
3132@ SpringBootTest (
3233 classes = {
3334 XapiClientAutoConfiguration .class ,
34- WebClientAutoConfiguration .class ,
35+ WebClientTestConfiguration .class ,
36+ CodecsAutoConfiguration .class ,
37+ ReactorAutoConfiguration .class ,
3538 XapiTestClientConfiguration .class ,
36- JacksonAutoConfiguration .class
39+ Jackson2AutoConfiguration .class
3740 },
3841 properties = {"xapi.client.username = username" , "xapi.client.password = password" })
3942class XapiClientAutoConfigurationUsernamePasswordTest {
Original file line number Diff line number Diff line change 1414 <dependency >
1515 <groupId >org.springframework.boot</groupId >
1616 <artifactId >spring-boot-starter-web</artifactId >
17+ <exclusions >
18+ <!-- jjwt does not currently support Jackson 3. This exclusion should be
19+ removed once jjwt adds Jackson 3 support. -->
20+ <exclusion >
21+ <groupId >org.springframework.boot</groupId >
22+ <artifactId >spring-boot-starter-jackson</artifactId >
23+ </exclusion >
24+ </exclusions >
25+ </dependency >
26+ <dependency >
27+ <groupId >org.springframework.boot</groupId >
28+ <artifactId >spring-boot-jackson2</artifactId >
1729 </dependency >
1830 <dependency >
1931 <groupId >org.springframework.boot</groupId >
Original file line number Diff line number Diff line change 2929import org .springframework .beans .factory .config .BeanPostProcessor ;
3030import org .springframework .boot .autoconfigure .AutoConfigureBefore ;
3131import org .springframework .boot .autoconfigure .condition .ConditionalOnProperty ;
32- import org .springframework .boot .autoconfigure . jackson .Jackson2ObjectMapperBuilderCustomizer ;
33- import org .springframework .boot .autoconfigure .jackson . JacksonProperties ;
32+ import org .springframework .boot .jackson2 . autoconfigure .Jackson2ObjectMapperBuilderCustomizer ;
33+ import org .springframework .boot .jackson2 . autoconfigure .Jackson2Properties ;
3434import org .springframework .context .annotation .Bean ;
3535import org .springframework .context .annotation .Configuration ;
3636
4040 * @author István Rátkai (Selindek)
4141 */
4242@ Configuration
43- @ AutoConfigureBefore (JacksonProperties .class )
43+ @ AutoConfigureBefore (Jackson2Properties .class )
4444public class XapiModelAutoConfiguration {
4545
4646 /**
You can’t perform that action at this time.
0 commit comments