Merge branch '2.0.x' into 2.1.x
This commit is contained in:
@@ -41,7 +41,7 @@ import org.springframework.web.util.UriTemplateHandler;
|
||||
* {@link RequestExpectationManager} that strips the specified root URI from the request
|
||||
* before verification. Can be used to simply test declarations when all REST calls start
|
||||
* the same way. For example: <pre class="code">
|
||||
* RestTemplate restTemplate = new RestTemplateBuilder().rootUri("http://example.com").build();
|
||||
* RestTemplate restTemplate = new RestTemplateBuilder().rootUri("https://example.com").build();
|
||||
* MockRestServiceServer server = RootUriRequestExpectationManager.bindTo(restTemplate);
|
||||
* server.expect(requestTo("/hello")).andRespond(withSuccess());
|
||||
* restTemplate.getForEntity("/hello", String.class);
|
||||
|
||||
@@ -826,7 +826,7 @@ public class TestRestTemplate {
|
||||
* {@link ParameterizedTypeReference} is used to pass generic type information:
|
||||
* <pre class="code">
|
||||
* ParameterizedTypeReference<List<MyBean>> myBean = new ParameterizedTypeReference<List<MyBean>>() {};
|
||||
* ResponseEntity<List<MyBean>> response = template.exchange("http://example.com",HttpMethod.GET, null, myBean);
|
||||
* ResponseEntity<List<MyBean>> response = template.exchange("https://example.com",HttpMethod.GET, null, myBean);
|
||||
* </pre>
|
||||
* @param url the URL
|
||||
* @param method the HTTP method (GET, POST, etc)
|
||||
@@ -854,7 +854,7 @@ public class TestRestTemplate {
|
||||
* {@link ParameterizedTypeReference} is used to pass generic type information:
|
||||
* <pre class="code">
|
||||
* ParameterizedTypeReference<List<MyBean>> myBean = new ParameterizedTypeReference<List<MyBean>>() {};
|
||||
* ResponseEntity<List<MyBean>> response = template.exchange("http://example.com",HttpMethod.GET, null, myBean);
|
||||
* ResponseEntity<List<MyBean>> response = template.exchange("https://example.com",HttpMethod.GET, null, myBean);
|
||||
* </pre>
|
||||
* @param url the URL
|
||||
* @param method the HTTP method (GET, POST, etc)
|
||||
@@ -882,7 +882,7 @@ public class TestRestTemplate {
|
||||
* {@link ParameterizedTypeReference} is used to pass generic type information:
|
||||
* <pre class="code">
|
||||
* ParameterizedTypeReference<List<MyBean>> myBean = new ParameterizedTypeReference<List<MyBean>>() {};
|
||||
* ResponseEntity<List<MyBean>> response = template.exchange("http://example.com",HttpMethod.GET, null, myBean);
|
||||
* ResponseEntity<List<MyBean>> response = template.exchange("https://example.com",HttpMethod.GET, null, myBean);
|
||||
* </pre>
|
||||
* @param url the URL
|
||||
* @param method the HTTP method (GET, POST, etc)
|
||||
@@ -908,7 +908,7 @@ public class TestRestTemplate {
|
||||
* response as {@link ResponseEntity}. Typically used in combination with the static
|
||||
* builder methods on {@code RequestEntity}, for instance: <pre class="code">
|
||||
* MyRequest body = ...
|
||||
* RequestEntity request = RequestEntity.post(new URI("http://example.com/foo")).accept(MediaType.APPLICATION_JSON).body(body);
|
||||
* RequestEntity request = RequestEntity.post(new URI("https://example.com/foo")).accept(MediaType.APPLICATION_JSON).body(body);
|
||||
* ResponseEntity<MyResponse> response = template.exchange(request, MyResponse.class);
|
||||
* </pre>
|
||||
* @param requestEntity the entity to write to the request
|
||||
@@ -929,7 +929,7 @@ public class TestRestTemplate {
|
||||
* response as {@link ResponseEntity}. The given {@link ParameterizedTypeReference} is
|
||||
* used to pass generic type information: <pre class="code">
|
||||
* MyRequest body = ...
|
||||
* RequestEntity request = RequestEntity.post(new URI("http://example.com/foo")).accept(MediaType.APPLICATION_JSON).body(body);
|
||||
* RequestEntity request = RequestEntity.post(new URI("https://example.com/foo")).accept(MediaType.APPLICATION_JSON).body(body);
|
||||
* ParameterizedTypeReference<List<MyResponse>> myBean = new ParameterizedTypeReference<List<MyResponse>>() {};
|
||||
* ResponseEntity<List<MyResponse>> response = template.exchange(request, myBean);
|
||||
* </pre>
|
||||
|
||||
Reference in New Issue
Block a user