Skip to content

Commit db4696c

Browse files
committed
Align RestTestClient and WebTestClient structure
See gh-34428
1 parent 934b8fc commit db4696c

File tree

10 files changed

+410
-365
lines changed

10 files changed

+410
-365
lines changed

spring-test/src/main/java/org/springframework/test/web/reactive/server/DefaultWebTestClient.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -261,18 +261,6 @@ public RequestBodySpec headers(Consumer<HttpHeaders> headersConsumer) {
261261
return this;
262262
}
263263

264-
@Override
265-
public RequestBodySpec attribute(String name, Object value) {
266-
this.attributes.put(name, value);
267-
return this;
268-
}
269-
270-
@Override
271-
public RequestBodySpec attributes(Consumer<Map<String, Object>> attributesConsumer) {
272-
attributesConsumer.accept(this.attributes);
273-
return this;
274-
}
275-
276264
@Override
277265
public RequestBodySpec accept(MediaType... acceptableMediaTypes) {
278266
getHeaders().setAccept(Arrays.asList(acceptableMediaTypes));
@@ -321,6 +309,18 @@ public RequestBodySpec ifNoneMatch(String... ifNoneMatches) {
321309
return this;
322310
}
323311

312+
@Override
313+
public RequestBodySpec attribute(String name, Object value) {
314+
this.attributes.put(name, value);
315+
return this;
316+
}
317+
318+
@Override
319+
public RequestBodySpec attributes(Consumer<Map<String, Object>> attributesConsumer) {
320+
attributesConsumer.accept(this.attributes);
321+
return this;
322+
}
323+
324324
@Override
325325
public RequestBodySpec apiVersion(Object version) {
326326
this.apiVersion = version;

spring-test/src/main/java/org/springframework/test/web/reactive/server/WebTestClient.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,7 @@ <T, S extends Publisher<T>> RequestHeadersSpec<?> body(
820820
interface RequestHeadersUriSpec<S extends RequestHeadersSpec<S>> extends UriSpec<S>, RequestHeadersSpec<S> {
821821
}
822822

823+
823824
/**
824825
* Specification for providing the body and the URI of a request.
825826
*/
@@ -932,7 +933,6 @@ interface ResponseSpec {
932933
@FunctionalInterface
933934
interface ResponseSpecConsumer extends Consumer<ResponseSpec> {
934935
}
935-
936936
}
937937

938938

@@ -1014,7 +1014,6 @@ interface ListBodySpec<E> extends BodySpec<List<@Nullable E>, ListBodySpec<E>> {
10141014
* Spec for expectations on the response body content.
10151015
*/
10161016
interface BodyContentSpec {
1017-
10181017
/**
10191018
* Assert the response body is empty and return the exchange result.
10201019
*/

spring-test/src/main/java/org/springframework/test/web/servlet/client/CookieAssertions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* Assertions on cookies of the response.
2525
*
2626
* @author Rob Worsnop
27+
* @since 7.0
2728
*/
2829
public class CookieAssertions extends AbstractCookieAssertions<ExchangeResult, RestTestClient.ResponseSpec> {
2930

0 commit comments

Comments
 (0)