public class TestRestTemplate
extends org.springframework.web.client.RestTemplate
RestTemplate
that is suitable for integration tests.
They are fault tolerant, and optionally can carry Basic authentication headers. If
Apache Http Client 4.3.2 or better is available (recommended) it will be used as the
client, and configured to ignore cookies and redirects.Constructor and Description |
---|
TestRestTemplate()
Create a new
TestRestTemplate instance. |
TestRestTemplate(String username,
String password)
Create a new
TestRestTemplate instance with the specified credentials. |
acceptHeaderRequestCallback, delete, delete, delete, doExecute, exchange, exchange, exchange, exchange, exchange, exchange, execute, execute, execute, getErrorHandler, getForEntity, getForEntity, getForEntity, getForObject, getForObject, getForObject, getMessageConverters, headersExtractor, headForHeaders, headForHeaders, headForHeaders, httpEntityCallback, httpEntityCallback, optionsForAllow, optionsForAllow, optionsForAllow, postForEntity, postForEntity, postForEntity, postForLocation, postForLocation, postForLocation, postForObject, postForObject, postForObject, put, put, put, responseEntityExtractor, setErrorHandler, setMessageConverters
getInterceptors, getRequestFactory, setInterceptors
public TestRestTemplate()
TestRestTemplate
instance.public TestRestTemplate(String username, String password)
TestRestTemplate
instance with the specified credentials.username
- the username to use (or null
)password
- the password (or null
)Copyright © 2014 Pivotal Software, Inc.. All rights reserved.