Skip to content

Commit c6e9cd0

Browse files
committed
Polishing
1 parent e2a5cfb commit c6e9cd0

File tree

3 files changed

+25
-29
lines changed

3 files changed

+25
-29
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535

3636
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.request;
3737

38-
3938
/**
4039
* A {@link ClientHttpRequestFactory} for requests executed via {@link MockMvc}.
4140
*

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,13 +34,13 @@ public interface MvcResult {
3434

3535
/**
3636
* Return the performed request.
37-
* @return the request, never {@code null}
37+
* @return the request (never {@code null})
3838
*/
3939
MockHttpServletRequest getRequest();
4040

4141
/**
4242
* Return the resulting response.
43-
* @return the response, never {@code null}
43+
* @return the response (never {@code null})
4444
*/
4545
MockHttpServletResponse getResponse();
4646

spring-web/src/main/java/org/springframework/web/client/RestOperations.java

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -145,7 +145,7 @@ <T> ResponseEntity<T> getForEntity(String url, Class<T> responseType, Map<String
145145
// POST
146146

147147
/**
148-
* Create a new resource by POSTing the given object to the URI template, and returns the value of
148+
* Create a new resource by POSTing the given object to the URI template, and return the value of
149149
* the {@code Location} header. This header typically indicates where the new resource is stored.
150150
* <p>URI Template variables are expanded using the given URI variables, if any.
151151
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
@@ -165,7 +165,7 @@ <T> ResponseEntity<T> getForEntity(String url, Class<T> responseType, Map<String
165165
URI postForLocation(String url, @Nullable Object request, Object... uriVariables) throws RestClientException;
166166

167167
/**
168-
* Create a new resource by POSTing the given object to the URI template, and returns the value of
168+
* Create a new resource by POSTing the given object to the URI template, and return the value of
169169
* the {@code Location} header. This header typically indicates where the new resource is stored.
170170
* <p>URI Template variables are expanded using the given map.
171171
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
@@ -186,7 +186,7 @@ URI postForLocation(String url, @Nullable Object request, Map<String, ?> uriVari
186186
throws RestClientException;
187187

188188
/**
189-
* Create a new resource by POSTing the given object to the URL, and returns the value of the
189+
* Create a new resource by POSTing the given object to the URL, and return the value of the
190190
* {@code Location} header. This header typically indicates where the new resource is stored.
191191
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
192192
* add additional HTTP headers to the request.
@@ -205,7 +205,7 @@ URI postForLocation(String url, @Nullable Object request, Map<String, ?> uriVari
205205

206206
/**
207207
* Create a new resource by POSTing the given object to the URI template,
208-
* and returns the representation found in the response.
208+
* and return the representation found in the response.
209209
* <p>URI Template variables are expanded using the given URI variables, if any.
210210
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
211211
* add additional HTTP headers to the request.
@@ -227,7 +227,7 @@ <T> T postForObject(String url, @Nullable Object request, Class<T> responseType,
227227

228228
/**
229229
* Create a new resource by POSTing the given object to the URI template,
230-
* and returns the representation found in the response.
230+
* and return the representation found in the response.
231231
* <p>URI Template variables are expanded using the given map.
232232
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
233233
* add additional HTTP headers to the request.
@@ -249,7 +249,7 @@ <T> T postForObject(String url, @Nullable Object request, Class<T> responseType,
249249

250250
/**
251251
* Create a new resource by POSTing the given object to the URL,
252-
* and returns the representation found in the response.
252+
* and return the representation found in the response.
253253
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
254254
* add additional HTTP headers to the request.
255255
* <p>The body of the entity, or {@code request} itself, can be a
@@ -268,7 +268,7 @@ <T> T postForObject(String url, @Nullable Object request, Class<T> responseType,
268268

269269
/**
270270
* Create a new resource by POSTing the given object to the URI template,
271-
* and returns the response as {@link ResponseEntity}.
271+
* and return the response as {@link ResponseEntity}.
272272
* <p>URI Template variables are expanded using the given URI variables, if any.
273273
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
274274
* add additional HTTP headers to the request.
@@ -289,7 +289,7 @@ <T> ResponseEntity<T> postForEntity(String url, @Nullable Object request, Class<
289289

290290
/**
291291
* Create a new resource by POSTing the given object to the URI template,
292-
* and returns the response as {@link HttpEntity}.
292+
* and return the response as {@link HttpEntity}.
293293
* <p>URI Template variables are expanded using the given map.
294294
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
295295
* add additional HTTP headers to the request.
@@ -310,7 +310,7 @@ <T> ResponseEntity<T> postForEntity(String url, @Nullable Object request, Class<
310310

311311
/**
312312
* Create a new resource by POSTing the given object to the URL,
313-
* and returns the response as {@link ResponseEntity}.
313+
* and return the response as {@link ResponseEntity}.
314314
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
315315
* add additional HTTP headers to the request.
316316
* <p>The body of the entity, or {@code request} itself, can be a
@@ -374,7 +374,7 @@ <T> ResponseEntity<T> postForEntity(URI url, @Nullable Object request, Class<T>
374374
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
375375
* add additional HTTP headers to the request.
376376
* <p><b>NOTE: The standard JDK HTTP library does not support HTTP PATCH.
377-
* You need to use the Apache HttpComponents or OkHttp request factory.</b>
377+
* You need to use e.g. the Apache HttpComponents request factory.</b>
378378
* @param url the URL
379379
* @param request the object to be PATCHed (may be {@code null})
380380
* @param responseType the type of the return value
@@ -384,7 +384,6 @@ <T> ResponseEntity<T> postForEntity(URI url, @Nullable Object request, Class<T>
384384
* @see HttpEntity
385385
* @see RestTemplate#setRequestFactory
386386
* @see org.springframework.http.client.HttpComponentsClientHttpRequestFactory
387-
* @see org.springframework.http.client.OkHttp3ClientHttpRequestFactory
388387
*/
389388
@Nullable
390389
<T> T patchForObject(String url, @Nullable Object request, Class<T> responseType, Object... uriVariables)
@@ -397,7 +396,7 @@ <T> T patchForObject(String url, @Nullable Object request, Class<T> responseType
397396
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
398397
* add additional HTTP headers to the request.
399398
* <p><b>NOTE: The standard JDK HTTP library does not support HTTP PATCH.
400-
* You need to use the Apache HttpComponents or OkHttp request factory.</b>
399+
* You need to use e.g. the Apache HttpComponents request factory.</b>
401400
* @param url the URL
402401
* @param request the object to be PATCHed (may be {@code null})
403402
* @param responseType the type of the return value
@@ -407,7 +406,6 @@ <T> T patchForObject(String url, @Nullable Object request, Class<T> responseType
407406
* @see HttpEntity
408407
* @see RestTemplate#setRequestFactory
409408
* @see org.springframework.http.client.HttpComponentsClientHttpRequestFactory
410-
* @see org.springframework.http.client.OkHttp3ClientHttpRequestFactory
411409
*/
412410
@Nullable
413411
<T> T patchForObject(String url, @Nullable Object request, Class<T> responseType,
@@ -419,7 +417,7 @@ <T> T patchForObject(String url, @Nullable Object request, Class<T> responseType
419417
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
420418
* add additional HTTP headers to the request.
421419
* <p><b>NOTE: The standard JDK HTTP library does not support HTTP PATCH.
422-
* You need to use the Apache HttpComponents or OkHttp request factory.</b>
420+
* You need to use e.g. the Apache HttpComponents request factory.</b>
423421
* @param url the URL
424422
* @param request the object to be PATCHed (may be {@code null})
425423
* @param responseType the type of the return value
@@ -428,7 +426,6 @@ <T> T patchForObject(String url, @Nullable Object request, Class<T> responseType
428426
* @see HttpEntity
429427
* @see RestTemplate#setRequestFactory
430428
* @see org.springframework.http.client.HttpComponentsClientHttpRequestFactory
431-
* @see org.springframework.http.client.OkHttp3ClientHttpRequestFactory
432429
*/
433430
@Nullable
434431
<T> T patchForObject(URI url, @Nullable Object request, Class<T> responseType)
@@ -492,8 +489,8 @@ <T> T patchForObject(URI url, @Nullable Object request, Class<T> responseType)
492489
// exchange
493490

494491
/**
495-
* Execute the HTTP method to the given URI template, writing the given request entity to the request, and
496-
* returns the response as {@link ResponseEntity}.
492+
* Execute the HTTP method to the given URI template, writing the given request entity to the request,
493+
* and return the response as {@link ResponseEntity}.
497494
* <p>URI Template variables are expanded using the given URI variables, if any.
498495
* @param url the URL
499496
* @param method the HTTP method (GET, POST, etc)
@@ -508,8 +505,8 @@ <T> ResponseEntity<T> exchange(String url, HttpMethod method, @Nullable HttpEnti
508505
Class<T> responseType, Object... uriVariables) throws RestClientException;
509506

510507
/**
511-
* Execute the HTTP method to the given URI template, writing the given request entity to the request, and
512-
* returns the response as {@link ResponseEntity}.
508+
* Execute the HTTP method to the given URI template, writing the given request entity to the request,
509+
* and return the response as {@link ResponseEntity}.
513510
* <p>URI Template variables are expanded using the given URI variables, if any.
514511
* @param url the URL
515512
* @param method the HTTP method (GET, POST, etc)
@@ -524,8 +521,8 @@ <T> ResponseEntity<T> exchange(String url, HttpMethod method, @Nullable HttpEnti
524521
Class<T> responseType, Map<String, ?> uriVariables) throws RestClientException;
525522

526523
/**
527-
* Execute the HTTP method to the given URI template, writing the given request entity to the request, and
528-
* returns the response as {@link ResponseEntity}.
524+
* Execute the HTTP method to the given URI template, writing the given request entity to the request,
525+
* and return the response as {@link ResponseEntity}.
529526
* @param url the URL
530527
* @param method the HTTP method (GET, POST, etc)
531528
* @param requestEntity the entity (headers and/or body) to write to the request
@@ -539,7 +536,7 @@ <T> ResponseEntity<T> exchange(URI url, HttpMethod method, @Nullable HttpEntity<
539536

540537
/**
541538
* Execute the HTTP method to the given URI template, writing the given
542-
* request entity to the request, and returns the response as {@link ResponseEntity}.
539+
* request entity to the request, and return the response as {@link ResponseEntity}.
543540
* The given {@link ParameterizedTypeReference} is used to pass generic type information:
544541
* <pre class="code">
545542
* ParameterizedTypeReference&lt;List&lt;MyBean&gt;&gt; myBean =
@@ -562,7 +559,7 @@ <T> ResponseEntity<T> exchange(String url,HttpMethod method, @Nullable HttpEntit
562559

563560
/**
564561
* Execute the HTTP method to the given URI template, writing the given
565-
* request entity to the request, and returns the response as {@link ResponseEntity}.
562+
* request entity to the request, and return the response as {@link ResponseEntity}.
566563
* The given {@link ParameterizedTypeReference} is used to pass generic type information:
567564
* <pre class="code">
568565
* ParameterizedTypeReference&lt;List&lt;MyBean&gt;&gt; myBean =
@@ -585,7 +582,7 @@ <T> ResponseEntity<T> exchange(String url, HttpMethod method, @Nullable HttpEnti
585582

586583
/**
587584
* Execute the HTTP method to the given URI template, writing the given
588-
* request entity to the request, and returns the response as {@link ResponseEntity}.
585+
* request entity to the request, and return the response as {@link ResponseEntity}.
589586
* The given {@link ParameterizedTypeReference} is used to pass generic type information:
590587
* <pre class="code">
591588
* ParameterizedTypeReference&lt;List&lt;MyBean&gt;&gt; myBean =

0 commit comments

Comments
 (0)