Skip to content

Commit 521764e

Browse files
committed
Fix links, @⁠since tags, formatting, etc. in RestTestClient
1 parent 942fbf3 commit 521764e

File tree

2 files changed

+71
-67
lines changed

2 files changed

+71
-67
lines changed

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

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -601,23 +601,23 @@ interface RequestHeadersSpec<S extends RequestHeadersSpec<S>> {
601601
* Set the list of acceptable {@linkplain MediaType media types}, as
602602
* specified by the {@code Accept} header.
603603
* @param acceptableMediaTypes the acceptable media types
604-
* @return the same instance
604+
* @return this spec for further declaration of the request
605605
*/
606606
S accept(MediaType... acceptableMediaTypes);
607607

608608
/**
609609
* Set the list of acceptable {@linkplain Charset charsets}, as specified
610610
* by the {@code Accept-Charset} header.
611611
* @param acceptableCharsets the acceptable charsets
612-
* @return the same instance
612+
* @return this spec for further declaration of the request
613613
*/
614614
S acceptCharset(Charset... acceptableCharsets);
615615

616616
/**
617617
* Add a cookie with the given name and value.
618618
* @param name the cookie name
619619
* @param value the cookie value
620-
* @return the same instance
620+
* @return this spec for further declaration of the request
621621
*/
622622
S cookie(String name, String value);
623623

@@ -628,7 +628,7 @@ interface RequestHeadersSpec<S extends RequestHeadersSpec<S>> {
628628
* {@linkplain MultiValueMap#remove(Object) remove} values, or use any of the other
629629
* {@link MultiValueMap} methods.
630630
* @param cookiesConsumer a function that consumes the cookies map
631-
* @return this builder
631+
* @return this spec for further declaration of the request
632632
*/
633633
S cookies(Consumer<MultiValueMap<String, String>> cookiesConsumer);
634634

@@ -637,22 +637,22 @@ interface RequestHeadersSpec<S extends RequestHeadersSpec<S>> {
637637
* <p>The date should be specified as the number of milliseconds since
638638
* January 1, 1970 GMT.
639639
* @param ifModifiedSince the new value of the header
640-
* @return the same instance
640+
* @return this spec for further declaration of the request
641641
*/
642642
S ifModifiedSince(ZonedDateTime ifModifiedSince);
643643

644644
/**
645645
* Set the values of the {@code If-None-Match} header.
646646
* @param ifNoneMatches the new value of the header
647-
* @return the same instance
647+
* @return this spec for further declaration of the request
648648
*/
649649
S ifNoneMatch(String... ifNoneMatches);
650650

651651
/**
652652
* Add the given, single header value under the given name.
653653
* @param headerName the header name
654654
* @param headerValues the header value(s)
655-
* @return the same instance
655+
* @return this spec for further declaration of the request
656656
*/
657657
S header(String headerName, String... headerValues);
658658

@@ -663,7 +663,7 @@ interface RequestHeadersSpec<S extends RequestHeadersSpec<S>> {
663663
* {@linkplain HttpHeaders#remove(String) remove} values, or use any of the other
664664
* {@link HttpHeaders} methods.
665665
* @param headersConsumer a function that consumes the {@code HttpHeaders}
666-
* @return this builder
666+
* @return this spec for further declaration of the request
667667
*/
668668
S headers(Consumer<HttpHeaders> headersConsumer);
669669

@@ -674,6 +674,7 @@ interface RequestHeadersSpec<S extends RequestHeadersSpec<S>> {
674674
* @param version the API version of the request; this can be a String or
675675
* some Object that can be formatted by the inserter &mdash; for example,
676676
* through an {@link ApiVersionFormatter}
677+
* @return this spec for further declaration of the request
677678
* @since 7.0
678679
*/
679680
S apiVersion(Object version);
@@ -682,7 +683,7 @@ interface RequestHeadersSpec<S extends RequestHeadersSpec<S>> {
682683
* Set the attribute with the given name to the given value.
683684
* @param name the name of the attribute to add
684685
* @param value the value of the attribute to add
685-
* @return this builder
686+
* @return this spec for further declaration of the request
686687
*/
687688
S attribute(String name, Object value);
688689

@@ -691,28 +692,28 @@ interface RequestHeadersSpec<S extends RequestHeadersSpec<S>> {
691692
* the consumer are "live", so that the consumer can be used to inspect attributes,
692693
* remove attributes, or use any of the other map-provided methods.
693694
* @param attributesConsumer a function that consumes the attributes
694-
* @return this builder
695+
* @return this spec for further declaration of the request
695696
*/
696697
S attributes(Consumer<Map<String, Object>> attributesConsumer);
697698

698699
/**
699700
* Perform the exchange without a request body.
700-
* @return spec for decoding the response
701+
* @return a spec for decoding the response
701702
*/
702703
ResponseSpec exchange();
703704
}
704705

705706

706707
/**
707-
* Specification for providing body of a request.
708+
* Specification for providing the body of a request.
708709
*/
709710
interface RequestBodySpec extends RequestHeadersSpec<RequestBodySpec> {
710711

711712
/**
712713
* Set the length of the body in bytes, as specified by the
713714
* {@code Content-Length} header.
714715
* @param contentLength the content length
715-
* @return the same instance
716+
* @return this spec for further declaration of the request
716717
* @see HttpHeaders#setContentLength(long)
717718
*/
718719
RequestBodySpec contentLength(long contentLength);
@@ -721,7 +722,7 @@ interface RequestBodySpec extends RequestHeadersSpec<RequestBodySpec> {
721722
* Set the {@linkplain MediaType media type} of the body, as specified
722723
* by the {@code Content-Type} header.
723724
* @param contentType the content type
724-
* @return the same instance
725+
* @return this spec for further declaration of the request
725726
* @see HttpHeaders#setContentType(MediaType)
726727
*/
727728
RequestBodySpec contentType(MediaType contentType);
@@ -731,7 +732,7 @@ interface RequestBodySpec extends RequestHeadersSpec<RequestBodySpec> {
731732
* {@link WebClient.RequestBodySpec#bodyValue(Object)
732733
* bodyValue} method on the underlying {@code WebClient}.
733734
* @param body the value to write to the request body
734-
* @return spec for further declaration of the request
735+
* @return this spec for further declaration of the request
735736
* @since 5.2
736737
*/
737738
RequestHeadersSpec<?> bodyValue(Object body);
@@ -744,7 +745,7 @@ interface RequestBodySpec extends RequestHeadersSpec<RequestBodySpec> {
744745
* @param elementClass the class of elements contained in the publisher
745746
* @param <T> the type of the elements contained in the publisher
746747
* @param <S> the type of the {@code Publisher}
747-
* @return spec for further declaration of the request
748+
* @return this spec for further declaration of the request
748749
*/
749750
<T, S extends Publisher<T>> RequestHeadersSpec<?> body(S publisher, Class<T> elementClass);
750751

@@ -755,7 +756,7 @@ interface RequestBodySpec extends RequestHeadersSpec<RequestBodySpec> {
755756
* @param elementTypeRef the type reference of elements contained in the publisher
756757
* @param <T> the type of the elements contained in the publisher
757758
* @param <S> the type of the {@code Publisher}
758-
* @return spec for further declaration of the request
759+
* @return this spec for further declaration of the request
759760
* @since 5.2
760761
*/
761762
<T, S extends Publisher<T>> RequestHeadersSpec<?> body(
@@ -769,7 +770,7 @@ <T, S extends Publisher<T>> RequestHeadersSpec<?> body(
769770
* {@link Publisher} or another producer adaptable to a
770771
* {@code Publisher} via {@link ReactiveAdapterRegistry}
771772
* @param elementClass the class of elements contained in the producer
772-
* @return spec for further declaration of the request
773+
* @return this spec for further declaration of the request
773774
* @since 5.2
774775
*/
775776
RequestHeadersSpec<?> body(Object producer, Class<?> elementClass);
@@ -782,18 +783,18 @@ <T, S extends Publisher<T>> RequestHeadersSpec<?> body(
782783
* {@link Publisher} or another producer adaptable to a
783784
* {@code Publisher} via {@link ReactiveAdapterRegistry}
784785
* @param elementTypeRef the type reference of elements contained in the producer
785-
* @return spec for further declaration of the request
786+
* @return this spec for further declaration of the request
786787
* @since 5.2
787788
*/
788789
RequestHeadersSpec<?> body(Object producer, ParameterizedTypeReference<?> elementTypeRef);
789790

790791
/**
791792
* Set the body of the request to the given {@code BodyInserter}.
792-
* This method invokes the
793+
* <p>This method invokes the
793794
* {@link WebClient.RequestBodySpec#body(BodyInserter)
794795
* body(BodyInserter)} method on the underlying {@code WebClient}.
795796
* @param inserter the body inserter to use
796-
* @return spec for further declaration of the request
797+
* @return this spec for further declaration of the request
797798
* @see org.springframework.web.reactive.function.BodyInserters
798799
*/
799800
RequestHeadersSpec<?> body(BodyInserter<?, ? super ClientHttpRequest> inserter);

0 commit comments

Comments
 (0)