Class TestRestTemplate.CustomHttpComponentsClientHttpRequestFactory
java.lang.Object
org.springframework.http.client.HttpComponentsClientHttpRequestFactory
org.springframework.boot.test.web.client.TestRestTemplate.CustomHttpComponentsClientHttpRequestFactory
- All Implemented Interfaces:
DisposableBean
,ClientHttpRequestFactory
- Enclosing class:
- TestRestTemplate
protected static class TestRestTemplate.CustomHttpComponentsClientHttpRequestFactory
extends HttpComponentsClientHttpRequestFactory
HttpComponentsClientHttpRequestFactory
to apply customizations.-
Constructor Summary
ConstructorDescriptionCustomHttpComponentsClientHttpRequestFactory
(TestRestTemplate.HttpClientOption[] httpClientOptions, ClientHttpRequestFactorySettings settings) Create a newTestRestTemplate.CustomHttpComponentsClientHttpRequestFactory
instance.CustomHttpComponentsClientHttpRequestFactory
(TestRestTemplate.HttpClientOption[] httpClientOptions, ClientHttpRequestFactorySettings settings) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.hc.core5.http.protocol.HttpContext
createHttpContext
(HttpMethod httpMethod, URI uri) protected org.apache.hc.client5.http.config.RequestConfig
Methods inherited from class org.springframework.http.client.HttpComponentsClientHttpRequestFactory
createHttpUriRequest, createRequest, createRequestConfig, destroy, getHttpClient, mergeRequestConfig, postProcessHttpRequest, setBufferRequestBody, setConnectionRequestTimeout, setConnectionRequestTimeout, setConnectTimeout, setConnectTimeout, setHttpClient, setHttpContextFactory, setReadTimeout, setReadTimeout
-
Constructor Details
-
CustomHttpComponentsClientHttpRequestFactory
@Deprecated(since="3.4.0", forRemoval=true) public CustomHttpComponentsClientHttpRequestFactory(TestRestTemplate.HttpClientOption[] httpClientOptions, ClientHttpRequestFactorySettings settings) Deprecated, for removal: This API element is subject to removal in a future version.since 3.4.0 for removal in 3.6.0 in favor ofCustomHttpComponentsClientHttpRequestFactory(HttpClientOption[], ClientHttpRequestFactorySettings)
Create a newTestRestTemplate.CustomHttpComponentsClientHttpRequestFactory
instance.- Parameters:
httpClientOptions
- theHttpClient
optionssettings
- the settings to apply
-
CustomHttpComponentsClientHttpRequestFactory
public CustomHttpComponentsClientHttpRequestFactory(TestRestTemplate.HttpClientOption[] httpClientOptions, ClientHttpRequestFactorySettings settings) Create a newTestRestTemplate.CustomHttpComponentsClientHttpRequestFactory
instance.- Parameters:
httpClientOptions
- theHttpClient
optionssettings
- the settings to apply
-
-
Method Details
-
createHttpContext
protected org.apache.hc.core5.http.protocol.HttpContext createHttpContext(HttpMethod httpMethod, URI uri) - Overrides:
createHttpContext
in classHttpComponentsClientHttpRequestFactory
-
createRequestConfig
protected org.apache.hc.client5.http.config.RequestConfig createRequestConfig()
-
CustomHttpComponentsClientHttpRequestFactory(HttpClientOption[], ClientHttpRequestFactorySettings)