[BAEL-14274] - Fixed article code for https://www.baeldung.com/rest-template

This commit is contained in:
amit2103 2019-06-23 17:22:18 +05:30
parent 9d7d7b4dde
commit aa80328881
1 changed files with 2 additions and 2 deletions

View File

@ -188,7 +188,7 @@ public class RestTemplateBasicLiveTest {
final String resourceUrl = fooResourceUrl + '/' + createResponse.getBody()
.getId();
final HttpEntity<Foo> requestUpdate = new HttpEntity<>(updatedResource, headers);
final ClientHttpRequestFactory requestFactory = getSimpleClientHttpRequestFactory();
final ClientHttpRequestFactory requestFactory = getClientHttpRequestFactory();
final RestTemplate template = new RestTemplate(requestFactory);
template.setMessageConverters(Arrays.asList(new MappingJackson2HttpMessageConverter()));
template.patchForObject(resourceUrl, requestUpdate, Void.class);
@ -262,7 +262,7 @@ public class RestTemplateBasicLiveTest {
// Simply setting restTemplate timeout using ClientHttpRequestFactory
ClientHttpRequestFactory getSimpleClientHttpRequestFactory() {
ClientHttpRequestFactory getClientHttpRequestFactory() {
final int timeout = 5;
final HttpComponentsClientHttpRequestFactory clientHttpRequestFactory = new HttpComponentsClientHttpRequestFactory();
clientHttpRequestFactory.setConnectTimeout(timeout * 1000);