Skip to content

Commit 1be6a54

Browse files
committed
Remove support for spring-restdocs-restassured
Closes spring-projectsgh-47685
1 parent 5d460bc commit 1be6a54

File tree

15 files changed

+7
-510
lines changed

15 files changed

+7
-510
lines changed

documentation/spring-boot-docs/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ plugins.withType(EclipsePlugin) {
8383
}
8484

8585
dependencies {
86+
compileOnly("org.hamcrest:hamcrest-core")
87+
8688
implementation(project(path: ":cli:spring-boot-cli"))
8789
implementation(project(path: ":core:spring-boot-docker-compose"))
8890
implementation(project(path: ":core:spring-boot-test"))
@@ -204,7 +206,6 @@ dependencies {
204206
implementation("org.springframework.pulsar:spring-pulsar")
205207
implementation("org.springframework.pulsar:spring-pulsar-reactive")
206208
implementation("org.springframework.restdocs:spring-restdocs-mockmvc")
207-
implementation("org.springframework.restdocs:spring-restdocs-restassured")
208209
implementation("org.springframework.restdocs:spring-restdocs-webtestclient")
209210
implementation("org.springframework.security:spring-security-config")
210211
implementation("org.springframework.security:spring-security-oauth2-client")

documentation/spring-boot-docs/src/docs/antora/modules/ROOT/pages/redirect.adoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,8 +1886,6 @@
18861886
* xref:reference:testing/spring-boot-applications.adoc#testing.spring-boot-applications.autoconfigured-spring-data-redis[#features.testing.spring-boot-applications.autoconfigured-spring-data-redis]
18871887
* xref:reference:testing/spring-boot-applications.adoc#testing.spring-boot-applications.autoconfigured-spring-restdocs.with-mock-mvc[#boot-features-testing-spring-boot-applications-testing-autoconfigured-rest-docs-mock-mvc]
18881888
* xref:reference:testing/spring-boot-applications.adoc#testing.spring-boot-applications.autoconfigured-spring-restdocs.with-mock-mvc[#features.testing.spring-boot-applications.autoconfigured-spring-restdocs.with-mock-mvc]
1889-
* xref:reference:testing/spring-boot-applications.adoc#testing.spring-boot-applications.autoconfigured-spring-restdocs.with-rest-assured[#boot-features-testing-spring-boot-applications-testing-autoconfigured-rest-docs-rest-assured]
1890-
* xref:reference:testing/spring-boot-applications.adoc#testing.spring-boot-applications.autoconfigured-spring-restdocs.with-rest-assured[#features.testing.spring-boot-applications.autoconfigured-spring-restdocs.with-rest-assured]
18911889
* xref:reference:testing/spring-boot-applications.adoc#testing.spring-boot-applications.autoconfigured-spring-restdocs.with-web-test-client[#boot-features-testing-spring-boot-applications-testing-autoconfigured-rest-docs-web-test-client]
18921890
* xref:reference:testing/spring-boot-applications.adoc#testing.spring-boot-applications.autoconfigured-spring-restdocs.with-web-test-client[#features.testing.spring-boot-applications.autoconfigured-spring-restdocs.with-web-test-client]
18931891
* xref:reference:testing/spring-boot-applications.adoc#testing.spring-boot-applications.autoconfigured-spring-restdocs[#boot-features-testing-spring-boot-applications-testing-autoconfigured-rest-docs]

documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/testing/spring-boot-applications.adoc

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ The specific beans that you want to test should be specified by using the `value
746746
[[testing.spring-boot-applications.autoconfigured-spring-restdocs]]
747747
== Auto-configured Spring REST Docs Tests
748748

749-
You can use the javadoc:org.springframework.boot.restdocs.test.autoconfigure.AutoConfigureRestDocs[format=annotation] annotation from the `spring-boot-restdocs- module to use {url-spring-restdocs-site}[Spring REST Docs] in your tests with Mock MVC, REST Assured, or WebTestClient.
749+
You can use the javadoc:org.springframework.boot.restdocs.test.autoconfigure.AutoConfigureRestDocs[format=annotation] annotation from the `spring-boot-restdocs- module to use {url-spring-restdocs-site}[Spring REST Docs] in your tests with Mock MVC or WebTestClient.
750750
It removes the need for the JUnit extension in Spring REST Docs.
751751

752752
javadoc:org.springframework.boot.restdocs.test.autoconfigure.AutoConfigureRestDocs[format=annotation] can be used to override the default output directory (`target/generated-snippets` if you are using Maven or `build/generated-snippets` if you are using Gradle).
@@ -799,20 +799,6 @@ include-code::MyWebTestClientBuilderCustomizerConfiguration[]
799799

800800

801801

802-
[[testing.spring-boot-applications.autoconfigured-spring-restdocs.with-rest-assured]]
803-
=== Auto-configured Spring REST Docs Tests With REST Assured
804-
805-
javadoc:org.springframework.boot.restdocs.test.autoconfigure.AutoConfigureRestDocs[format=annotation] makes a javadoc:io.restassured.specification.RequestSpecification[] bean, preconfigured to use Spring REST Docs, available to your tests.
806-
You can inject it by using javadoc:org.springframework.beans.factory.annotation.Autowired[format=annotation] and use it in your tests as you normally would when using REST Assured and Spring REST Docs, as shown in the following example:
807-
808-
include-code::MyUserDocumentationTests[]
809-
810-
If you require more control over Spring REST Docs configuration than offered by the attributes of javadoc:org.springframework.boot.restdocs.test.autoconfigure.AutoConfigureRestDocs[format=annotation], a javadoc:org.springframework.boot.restdocs.test.autoconfigure.RestDocsRestAssuredConfigurationCustomizer[] bean can be used, as shown in the following example:
811-
812-
include-code::MyRestDocsConfiguration[]
813-
814-
815-
816802
[[testing.spring-boot-applications.autoconfigured-webservices]]
817803
== Auto-configured Spring Web Services Tests
818804

documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/testing/springbootapplications/autoconfiguredspringrestdocs/withrestassured/MyRestDocsConfiguration.java

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

documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/testing/springbootapplications/autoconfiguredspringrestdocs/withrestassured/MyUserDocumentationTests.java

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

documentation/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/testing/springbootapplications/autoconfiguredspringrestdocs/withrestassured/MyRestDocsConfiguration.kt

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

documentation/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/testing/springbootapplications/autoconfiguredspringrestdocs/withrestassured/MyUserDocumentationTests.kt

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

module/spring-boot-restdocs/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ dependencies {
3232
optional(project(":module:spring-boot-webflux-test"))
3333
optional(project(":module:spring-boot-webmvc-test"))
3434
optional("org.springframework.restdocs:spring-restdocs-mockmvc")
35-
optional("org.springframework.restdocs:spring-restdocs-restassured")
3635
optional("org.springframework.restdocs:spring-restdocs-webtestclient")
3736

3837
testImplementation(project(":test-support:spring-boot-test-support"))

module/spring-boot-restdocs/src/main/java/org/springframework/boot/restdocs/test/autoconfigure/AutoConfigureRestDocs.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
import java.lang.annotation.RetentionPolicy;
2424
import java.lang.annotation.Target;
2525

26-
import io.restassured.RestAssured;
27-
2826
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
2927
import org.springframework.boot.test.context.PropertyMapping;
3028
import org.springframework.context.annotation.Import;
@@ -35,22 +33,19 @@
3533
/**
3634
* Annotation that can be applied to a test class to enable and configure
3735
* auto-configuration of Spring REST Docs. The auto-configuration sets up
38-
* {@link MockMvc}-based testing of a servlet web application, {@link WebTestClient}-based
39-
* testing of a reactive web application, or {@link RestAssured}-based testing of any web
40-
* application over HTTP.
36+
* {@link MockMvc}-based testing of a servlet web application or
37+
* {@link WebTestClient}-based testing of a reactive web application.
4138
* <p>
4239
* Allows configuration of the output directory and the host, scheme, and port of
4340
* generated URIs. When further configuration is required a
44-
* {@link RestDocsMockMvcConfigurationCustomizer},
45-
* {@link RestDocsWebTestClientConfigurationCustomizer}, or
46-
* {@link RestDocsRestAssuredConfigurationCustomizer} bean can be used.
41+
* {@link RestDocsMockMvcConfigurationCustomizer} or
42+
* {@link RestDocsWebTestClientConfigurationCustomizer} bean can be used.
4743
*
4844
* @author Andy Wilkinson
4945
* @since 4.0.0
5046
* @see RestDocsAutoConfiguration
5147
* @see RestDocsMockMvcConfigurationCustomizer
5248
* @see RestDocsWebTestClientConfigurationCustomizer
53-
* @see RestDocsRestAssuredConfigurationCustomizer
5449
*/
5550
@Target(ElementType.TYPE)
5651
@Retention(RetentionPolicy.RUNTIME)

module/spring-boot-restdocs/src/main/java/org/springframework/boot/restdocs/test/autoconfigure/RestDocsAutoConfiguration.java

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616

1717
package org.springframework.boot.restdocs.test.autoconfigure;
1818

19-
import io.restassured.builder.RequestSpecBuilder;
20-
import io.restassured.specification.RequestSpecification;
21-
2219
import org.springframework.beans.factory.ObjectProvider;
2320
import org.springframework.boot.autoconfigure.AutoConfiguration;
2421
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -34,8 +31,6 @@
3431
import org.springframework.restdocs.mockmvc.MockMvcRestDocumentation;
3532
import org.springframework.restdocs.mockmvc.MockMvcRestDocumentationConfigurer;
3633
import org.springframework.restdocs.mockmvc.RestDocumentationResultHandler;
37-
import org.springframework.restdocs.restassured.RestAssuredRestDocumentation;
38-
import org.springframework.restdocs.restassured.RestAssuredRestDocumentationConfigurer;
3934
import org.springframework.restdocs.webtestclient.WebTestClientRestDocumentation;
4035
import org.springframework.restdocs.webtestclient.WebTestClientRestDocumentationConfigurer;
4136

@@ -78,31 +73,6 @@ RestDocsMockMvcBuilderCustomizer restDocumentationConfigurer(RestDocsProperties
7873

7974
}
8075

81-
@Configuration(proxyBeanMethods = false)
82-
@ConditionalOnClass({ RequestSpecification.class, RestAssuredRestDocumentation.class })
83-
@EnableConfigurationProperties(RestDocsProperties.class)
84-
static class RestDocsRestAssuredConfiguration {
85-
86-
@Bean
87-
@ConditionalOnMissingBean
88-
RequestSpecification restDocsRestAssuredConfigurer(
89-
ObjectProvider<RestDocsRestAssuredConfigurationCustomizer> configurationCustomizers,
90-
RestDocumentationContextProvider contextProvider) {
91-
RestAssuredRestDocumentationConfigurer configurer = RestAssuredRestDocumentation
92-
.documentationConfiguration(contextProvider);
93-
configurationCustomizers.orderedStream()
94-
.forEach((configurationCustomizer) -> configurationCustomizer.customize(configurer));
95-
return new RequestSpecBuilder().addFilter(configurer).build();
96-
}
97-
98-
@Bean
99-
RestDocsRestAssuredBuilderCustomizer restAssuredBuilderCustomizer(RestDocsProperties properties,
100-
RequestSpecification configurer) {
101-
return new RestDocsRestAssuredBuilderCustomizer(properties, configurer);
102-
}
103-
104-
}
105-
10676
@Configuration(proxyBeanMethods = false)
10777
@ConditionalOnClass({ WebTestClientRestDocumentation.class, WebTestClientBuilderCustomizer.class })
10878
@ConditionalOnWebApplication(type = Type.REACTIVE)

0 commit comments

Comments
 (0)