public class TestRestTemplate
extends 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 by default configured to ignore cookies and redirects.Modifier and Type | Class and Description |
---|---|
protected static class |
TestRestTemplate.CustomHttpComponentsClientHttpRequestFactory |
static class |
TestRestTemplate.HttpClientOption
Options used to customize the Apache Http Client if it is used.
|
Constructor and Description |
---|
TestRestTemplate(String username,
String password,
TestRestTemplate.HttpClientOption... httpClientOptions)
Create a new
TestRestTemplate instance with the specified credentials. |
TestRestTemplate(TestRestTemplate.HttpClientOption... httpClientOptions)
Create a new
TestRestTemplate instance. |
public TestRestTemplate(TestRestTemplate.HttpClientOption... httpClientOptions)
TestRestTemplate
instance.httpClientOptions
- client options to use if the Apache HTTP Client is usedpublic TestRestTemplate(String username, String password, TestRestTemplate.HttpClientOption... httpClientOptions)
TestRestTemplate
instance with the specified credentials.username
- the username to use (or null
)password
- the password (or null
)httpClientOptions
- client options to use if the Apache HTTP Client is usedCopyright © 2014 Pivotal Software, Inc.. All rights reserved.