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.HtppClientOption
Options used to customize the Apache Http Client if it is used.
|
Constructor and Description |
---|
TestRestTemplate(String username,
String password,
TestRestTemplate.HtppClientOption... httpClientOptions)
Create a new
TestRestTemplate instance with the specified credentials. |
TestRestTemplate(TestRestTemplate.HtppClientOption... httpClientOptions)
Create a new
TestRestTemplate instance. |
public TestRestTemplate(TestRestTemplate.HtppClientOption... httpClientOptions)
TestRestTemplate
instance.httpClientOptions
- client options to use if the Apache HTTP Client is usedpublic TestRestTemplate(String username, String password, TestRestTemplate.HtppClientOption... 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.