Skip to content

Commit c6a2ba8

Browse files
xuxiaowei-com-cnkazuki43zoo
authored andcommitted
⬆️ spring-boot upgrade from 4.0.0-SNAPSHOT to 4.0.0
1 parent 2437175 commit c6a2ba8

File tree

10 files changed

+35
-11
lines changed

10 files changed

+35
-11
lines changed

mybatis-spring-boot-autoconfigure/src/main/java/org/mybatis/spring/boot/autoconfigure/MybatisProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ public void setDatabaseId(String databaseId) {
673673
}
674674

675675
public void applyTo(Configuration target) {
676-
PropertyMapper mapper = PropertyMapper.get().alwaysApplyingWhenNonNull();
676+
PropertyMapper mapper = PropertyMapper.get();
677677
mapper.from(getSafeRowBoundsEnabled()).to(target::setSafeRowBoundsEnabled);
678678
mapper.from(getSafeResultHandlerEnabled()).to(target::setSafeResultHandlerEnabled);
679679
mapper.from(getMapUnderscoreToCamelCase()).to(target::setMapUnderscoreToCamelCase);

mybatis-spring-boot-samples/mybatis-spring-boot-sample-war/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@
7878
<artifactId>spring-boot-starter-test</artifactId>
7979
<scope>test</scope>
8080
</dependency>
81+
<dependency>
82+
<groupId>org.springframework.boot</groupId>
83+
<artifactId>spring-boot-resttestclient</artifactId>
84+
<scope>test</scope>
85+
</dependency>
8186
<dependency>
8287
<groupId>org.mybatis.spring.boot</groupId>
8388
<artifactId>mybatis-spring-boot-starter-test</artifactId>

mybatis-spring-boot-samples/mybatis-spring-boot-sample-war/src/test/java/sample/mybatis/war/SampleMybatisApplicationTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121

2222
import org.junit.jupiter.api.Test;
2323
import org.springframework.beans.factory.annotation.Autowired;
24+
import org.springframework.boot.resttestclient.TestRestTemplate;
25+
import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureTestRestTemplate;
2426
import org.springframework.boot.test.context.SpringBootTest;
25-
import org.springframework.boot.web.server.test.client.TestRestTemplate;
2627

2728
/**
2829
* @author Kazuki Shimizu
2930
*/
31+
@AutoConfigureTestRestTemplate
3032
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
3133
class SampleMybatisApplicationTest {
3234

mybatis-spring-boot-samples/mybatis-spring-boot-sample-web/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@
4949
<artifactId>spring-boot-starter-restclient</artifactId>
5050
<scope>test</scope>
5151
</dependency>
52+
<dependency>
53+
<groupId>org.springframework.boot</groupId>
54+
<artifactId>spring-boot-resttestclient</artifactId>
55+
<scope>test</scope>
56+
</dependency>
5257
<dependency>
5358
<groupId>org.springframework.boot</groupId>
5459
<artifactId>spring-boot-starter-test</artifactId>

mybatis-spring-boot-samples/mybatis-spring-boot-sample-web/src/test/java/sample/mybatis/web/SampleMybatisApplicationTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121

2222
import org.junit.jupiter.api.Test;
2323
import org.springframework.beans.factory.annotation.Autowired;
24+
import org.springframework.boot.resttestclient.TestRestTemplate;
25+
import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureTestRestTemplate;
2426
import org.springframework.boot.test.context.SpringBootTest;
25-
import org.springframework.boot.web.server.test.client.TestRestTemplate;
2627

2728
/**
2829
* @author Kazuki Shimizu
2930
*/
31+
@AutoConfigureTestRestTemplate
3032
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
3133
class SampleMybatisApplicationTest {
3234

mybatis-spring-boot-samples/mybatis-spring-boot-sample-web/src/test/java/sample/mybatis/web/SampleMybatisWithMockBeanApplicationTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@
2323
import org.junit.jupiter.api.Test;
2424
import org.mockito.Mockito;
2525
import org.springframework.beans.factory.annotation.Autowired;
26+
import org.springframework.boot.resttestclient.TestRestTemplate;
27+
import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureTestRestTemplate;
2628
import org.springframework.boot.test.context.SpringBootTest;
27-
import org.springframework.boot.web.server.test.client.TestRestTemplate;
2829
import org.springframework.test.context.bean.override.mockito.MockitoBean;
2930

3031
import sample.mybatis.web.domain.City;
@@ -33,6 +34,7 @@
3334
/**
3435
* @author Kazuki Shimizu
3536
*/
37+
@AutoConfigureTestRestTemplate
3638
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
3739
class SampleMybatisWithMockBeanApplicationTest {
3840

mybatis-spring-boot-test-autoconfigure/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@
3737
<groupId>org.springframework.boot</groupId>
3838
<artifactId>spring-boot-test-autoconfigure</artifactId>
3939
</dependency>
40+
<dependency>
41+
<groupId>org.springframework.boot</groupId>
42+
<artifactId>spring-boot-jdbc-test</artifactId>
43+
</dependency>
44+
<dependency>
45+
<groupId>org.springframework.boot</groupId>
46+
<artifactId>spring-boot-cache-test</artifactId>
47+
</dependency>
4048
<dependency>
4149
<groupId>org.springframework.boot</groupId>
4250
<artifactId>spring-boot-test</artifactId>

mybatis-spring-boot-test-autoconfigure/src/main/java/org/mybatis/spring/boot/test/autoconfigure/MybatisTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2022 the original author or authors.
2+
* Copyright 2015-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,11 +25,11 @@
2525
import org.junit.jupiter.api.extension.ExtendWith;
2626
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
2727
import org.springframework.boot.autoconfigure.SpringBootApplication;
28+
import org.springframework.boot.cache.test.autoconfigure.AutoConfigureCache;
29+
import org.springframework.boot.jdbc.test.autoconfigure.AutoConfigureTestDatabase;
2830
import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration;
29-
import org.springframework.boot.test.autoconfigure.core.AutoConfigureCache;
30-
import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters;
31-
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
3231
import org.springframework.boot.test.context.SpringBootTest;
32+
import org.springframework.boot.test.context.filter.annotation.TypeExcludeFilters;
3333
import org.springframework.context.annotation.ComponentScan.Filter;
3434
import org.springframework.core.annotation.AliasFor;
3535
import org.springframework.core.env.Environment;

mybatis-spring-boot-test-autoconfigure/src/main/java/org/mybatis/spring/boot/test/autoconfigure/MybatisTypeExcludeFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2022 the original author or authors.
2+
* Copyright 2015-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@
1919
import java.util.Set;
2020

2121
import org.springframework.boot.context.TypeExcludeFilter;
22-
import org.springframework.boot.test.autoconfigure.filter.AnnotationCustomizableTypeExcludeFilter;
22+
import org.springframework.boot.test.context.filter.annotation.AnnotationCustomizableTypeExcludeFilter;
2323
import org.springframework.context.annotation.ComponentScan;
2424
import org.springframework.core.annotation.AnnotatedElementUtils;
2525

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<mybatis-freemarker.version>1.3.1</mybatis-freemarker.version>
7878
<mybatis-velocity.version>2.3.0</mybatis-velocity.version>
7979
<mybatis-thymeleaf.version>1.1.0</mybatis-thymeleaf.version>
80-
<spring-boot.version>4.0.0-SNAPSHOT</spring-boot.version>
80+
<spring-boot.version>4.0.0</spring-boot.version>
8181

8282
<argLine>--add-opens java.base/java.lang=ALL-UNNAMED -Dfile.encoding=UTF-8</argLine>
8383

0 commit comments

Comments
 (0)