Skip to content

Commit ec5ba78

Browse files
committed
Drop support for REST Assured
Closes gh-1000
1 parent d6024fa commit ec5ba78

File tree

47 files changed

+10
-3476
lines changed

Some content is hidden

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

47 files changed

+10
-3476
lines changed

config/checkstyle/checkstyle-suppressions.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
44
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
55
<suppressions>
6-
<suppress files="com[\\/]example[\\/]restassured" checks="IllegalImport" />
76
<suppress files="src[\\/]testFixtures" checks="JavadocPackage" />
87
</suppressions>

docs/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ configurations {
1111
dependencies {
1212
asciidoctorExt("io.spring.asciidoctor.backends:spring-asciidoctor-backends:0.0.5")
1313

14+
testCompileOnly("org.hamcrest:hamcrest-core")
15+
1416
testImplementation(project(":spring-restdocs-mockmvc"))
15-
testImplementation(project(":spring-restdocs-restassured"))
1617
testImplementation(project(":spring-restdocs-webtestclient"))
1718
testImplementation("jakarta.servlet:jakarta.servlet-api")
1819
testImplementation("jakarta.validation:jakarta.validation-api")

docs/src/docs/asciidoc/configuration.adoc

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,6 @@ TIP: To configure a request's context path, use the `contextPath` method on `Moc
4545

4646

4747

48-
[[configuration-uris-rest-assured]]
49-
==== REST Assured URI Customization
50-
51-
REST Assured tests a service by making actual HTTP requests. As a result, URIs must be
52-
customized once the operation on the service has been performed but before it is
53-
documented. A
54-
<<customizing-requests-and-responses-preprocessors-modify-uris, REST-Assured-specific
55-
preprocessor>> is provided for this purpose.
56-
57-
58-
5948
[[configuration-uris-webtestclient]]
6049
==== WebTestClient URI Customization
6150

@@ -90,12 +79,6 @@ include::{examples-dir}/com/example/mockmvc/CustomEncoding.java[tags=custom-enco
9079
include::{examples-dir}/com/example/webtestclient/CustomEncoding.java[tags=custom-encoding]
9180
----
9281

93-
[source,java,indent=0,role="secondary"]
94-
.REST Assured
95-
----
96-
include::{examples-dir}/com/example/restassured/CustomEncoding.java[tags=custom-encoding]
97-
----
98-
9982
TIP: When Spring REST Docs converts the content of a request or a response to a `String`, the `charset` specified in the `Content-Type` header is used if it is available.
10083
In its absence, the JVM's default `Charset` is used.
10184
You can configure the JVM's default `Charset` by using the `file.encoding` system property.
@@ -122,12 +105,6 @@ include::{examples-dir}/com/example/mockmvc/CustomFormat.java[tags=custom-format
122105
include::{examples-dir}/com/example/webtestclient/CustomFormat.java[tags=custom-format]
123106
----
124107

125-
[source,java,indent=0,role="secondary"]
126-
.REST Assured
127-
----
128-
include::{examples-dir}/com/example/restassured/CustomFormat.java[tags=custom-format]
129-
----
130-
131108

132109

133110
[[configuration-default-snippets]]
@@ -157,12 +134,6 @@ include::{examples-dir}/com/example/mockmvc/CustomDefaultSnippets.java[tags=cust
157134
include::{examples-dir}/com/example/webtestclient/CustomDefaultSnippets.java[tags=custom-default-snippets]
158135
----
159136

160-
[source,java,indent=0,role="secondary"]
161-
.REST Assured
162-
----
163-
include::{examples-dir}/com/example/restassured/CustomDefaultSnippets.java[tags=custom-default-snippets]
164-
----
165-
166137

167138

168139
[[configuration-default-preprocessors]]
@@ -187,12 +158,4 @@ include::{examples-dir}/com/example/webtestclient/CustomDefaultOperationPreproce
187158
<1> Apply a request preprocessor that removes the header named `Foo`.
188159
<2> Apply a response preprocessor that pretty prints its content.
189160

190-
[source,java,indent=0,role="secondary"]
191-
.REST Assured
192-
----
193-
include::{examples-dir}/com/example/restassured/CustomDefaultOperationPreprocessors.java[tags=custom-default-operation-preprocessors]
194-
----
195-
<1> Apply a request preprocessor that removes the header named `Foo`.
196-
<2> Apply a response preprocessor that pretty prints its content.
197-
198161

docs/src/docs/asciidoc/customizing-requests-and-responses.adoc

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ include::{examples-dir}/com/example/webtestclient/PerTestPreprocessing.java[tags
2424
<1> Apply a request preprocessor that removes the header named `Foo`.
2525
<2> Apply a response preprocessor that pretty prints its content.
2626

27-
[source,java,indent=0,role="secondary"]
28-
.REST Assured
29-
----
30-
include::{examples-dir}/com/example/restassured/PerTestPreprocessing.java[tags=preprocessing]
31-
----
32-
<1> Apply a request preprocessor that removes the header named `Foo`.
33-
<2> Apply a response preprocessor that pretty prints its content.
34-
3527
Alternatively, you may want to apply the same preprocessors to every test.
3628
You can do so by using the `RestDocumentationConfigurer` API in your `@Before` method to configure the preprocessors.
3729
For example, to remove the `Foo` header from all requests and pretty print all responses, you could do one of the following (depending on your testing environment):
@@ -52,14 +44,6 @@ include::{examples-dir}/com/example/webtestclient/EveryTestPreprocessing.java[ta
5244
<1> Apply a request preprocessor that removes the header named `Foo`.
5345
<2> Apply a response preprocessor that pretty prints its content.
5446

55-
[source,java,indent=0,role="secondary"]
56-
.REST Assured
57-
----
58-
include::{examples-dir}/com/example/restassured/EveryTestPreprocessing.java[tags=setup]
59-
----
60-
<1> Apply a request preprocessor that removes the header named `Foo`.
61-
<2> Apply a response preprocessor that pretty prints its content.
62-
6347
Then, in each test, you can perform any configuration specific to that test.
6448
The following examples show how to do so:
6549

@@ -75,12 +59,6 @@ include::{examples-dir}/com/example/mockmvc/EveryTestPreprocessing.java[tags=use
7559
include::{examples-dir}/com/example/webtestclient/EveryTestPreprocessing.java[tags=use]
7660
----
7761

78-
[source,java,indent=0,role="secondary"]
79-
.REST Assured
80-
----
81-
include::{examples-dir}/com/example/restassured/EveryTestPreprocessing.java[tags=use]
82-
----
83-
8462
Various built-in preprocessors, including those illustrated above, are available through the static methods on `Preprocessors`.
8563
See <<Preprocessors, below>> for further details.
8664

@@ -129,7 +107,7 @@ Any occurrences that match a regular expression are replaced.
129107
TIP: If you use MockMvc or a WebTestClient that is not bound to a server, you should customize URIs by <<configuration-uris, changing the configuration>>.
130108

131109
You can use `modifyUris` on `Preprocessors` to modify any URIs in a request or a response.
132-
When using REST Assured or WebTestClient bound to a server, this lets you customize the URIs that appear in the documentation while testing a local instance of the service.
110+
When using `WebTestClient` bound to a server, this lets you customize the URIs that appear in the documentation while testing a local instance of the service.
133111

134112

135113

0 commit comments

Comments
 (0)