Skip to content

Commit 9eb05eb

Browse files
wilkinsonaphilwebb
andcommitted
Create spring-boot-resttestclient and spring-boot-webtestclient modules
Create `spring-boot-resttestclient` and `spring-boot-webtestclient` modules to hold test client auto-configuration and `TestRestTemplate` code. Previous these classes were contained in `spring-boot-resetclient-test` and `spring-boot-webclient-test` which was incorrect since the `-test` modules should hold code need to test the given modules, not supporting test classes. See gh-46356 Co-authored-by: Phillip Webb <phil.webb@broadcom.com>
1 parent 16d8878 commit 9eb05eb

File tree

219 files changed

+1149
-1429
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+1149
-1429
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.test.web.servlet.client;
17+
package org.springframework.boot.test.http.client;
1818

1919
import java.net.URI;
2020
import java.util.Map;

core/spring-boot-test/src/main/java/org/springframework/boot/test/web/servlet/client/RestTestClientContextCustomizer.java

Lines changed: 0 additions & 181 deletions
This file was deleted.

core/spring-boot-test/src/main/java/org/springframework/boot/test/web/servlet/client/RestTestClientContextCustomizerFactory.java

Lines changed: 0 additions & 52 deletions
This file was deleted.

core/spring-boot-test/src/main/resources/META-INF/spring.factories

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ org.springframework.boot.test.context.PropertyMappingContextCustomizerFactory,\
55
org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizerFactory,\
66
org.springframework.boot.test.context.filter.annotation.TypeExcludeFiltersContextCustomizerFactory,\
77
org.springframework.boot.test.http.client.DisableReactorResourceFactoryGlobalResourcesContextCustomizerFactory,\
8-
org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory,\
9-
org.springframework.boot.test.web.servlet.client.RestTestClientContextCustomizerFactory
8+
org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory
109

1110
# Application Context Initializers
1211
org.springframework.context.ApplicationContextInitializer=\

core/spring-boot-test/src/test/java/org/springframework/boot/test/web/servlet/client/RestTestClientContextCustomizerTests.java

Lines changed: 0 additions & 92 deletions
This file was deleted.

documentation/spring-boot-docs/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ dependencies {
124124
implementation(project(path: ":module:spring-boot-reactor-netty"))
125125
implementation(project(path: ":module:spring-boot-restclient"))
126126
implementation(project(path: ":module:spring-boot-restclient-test"))
127+
implementation(project(path: ":module:spring-boot-resttestclient"))
127128
implementation(project(path: ":module:spring-boot-security"))
128129
implementation(project(path: ":module:spring-boot-tomcat"))
129130
implementation(project(path: ":module:spring-boot-webclient"))
@@ -133,6 +134,7 @@ dependencies {
133134
implementation(project(path: ":module:spring-boot-webmvc-test"))
134135
implementation(project(path: ":module:spring-boot-webservices"))
135136
implementation(project(path: ":module:spring-boot-webservices-test"))
137+
implementation(project(path: ":module:spring-boot-webtestclient"))
136138
implementation("ch.qos.logback:logback-classic")
137139
implementation("com.redis:testcontainers-redis")
138140
implementation("com.zaxxer:HikariCP")

documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/testing/springbootapplications/autoconfiguredspringrestdocs/withwebtestclient/MyWebTestClientBuilderCustomizerConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package org.springframework.boot.docs.testing.springbootapplications.autoconfiguredspringrestdocs.withwebtestclient;
1818

1919
import org.springframework.boot.test.context.TestConfiguration;
20-
import org.springframework.boot.test.web.reactive.client.WebTestClientBuilderCustomizer;
20+
import org.springframework.boot.webtestclient.WebTestClientBuilderCustomizer;
2121
import org.springframework.context.annotation.Bean;
2222

2323
import static org.springframework.restdocs.webtestclient.WebTestClientRestDocumentation.document;

documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/testing/springbootapplications/withmockenvironment/MyMockMvcTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import org.springframework.beans.factory.annotation.Autowired;
2222
import org.springframework.boot.test.context.SpringBootTest;
23+
import org.springframework.boot.testrestclient.autoconfigure.AutoConfigureRestTestClient;
2324
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
2425
import org.springframework.test.web.reactive.server.WebTestClient;
2526
import org.springframework.test.web.servlet.MockMvc;
@@ -33,6 +34,7 @@
3334

3435
@SpringBootTest
3536
@AutoConfigureMockMvc
37+
@AutoConfigureRestTestClient
3638
class MyMockMvcTests {
3739

3840
@Test

documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/testing/springbootapplications/withmockenvironment/MyMockWebTestClientTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
import org.springframework.beans.factory.annotation.Autowired;
2222
import org.springframework.boot.test.context.SpringBootTest;
23-
import org.springframework.boot.webflux.test.autoconfigure.AutoConfigureWebTestClient;
23+
import org.springframework.boot.webtestclient.AutoConfigureWebTestClient;
2424
import org.springframework.test.web.reactive.server.WebTestClient;
2525

2626
@SpringBootTest

0 commit comments

Comments
 (0)